inspect-server/src/main/resources/mapper/InsSampleMapper.xml
@@ -3,7 +3,6 @@
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yuanchu.mom.mapper.InsSampleMapper">
    <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.InsSample">
        <id property="id" column="id" jdbcType="INTEGER"/>
        <result property="insResult" column="ins_result" jdbcType="INTEGER"/>
@@ -56,7 +55,9 @@
        io.id
        ) a
        LEFT JOIN ins_order_state ios ON ios.ins_order_id = a.id AND ios.laboratory = a.son_laboratory
        left join (SELECT td.user_id order_user_id, td.ins_sample_id FROM ins_sample_user td,(SELECT max(id) id FROM ins_sample_user GROUP BY ins_sample_id) md  where td.id = md.id and user_id = #{userId}) isu2 on isu2.ins_sample_id = a.id
        left join (SELECT td.user_id order_user_id, td.ins_sample_id FROM ins_sample_user td,(SELECT max(id) id FROM
        ins_sample_user GROUP BY ins_sample_id) md where td.id = md.id and user_id = #{userId}) isu2 on
        isu2.ins_sample_id = a.id
        ORDER BY
        a.user_id DESC,
        a.type DESC,
@@ -98,7 +99,9 @@
        io.id
        ) a
        LEFT JOIN ins_order_state ios ON ios.ins_order_id = a.id AND ios.laboratory = a.son_laboratory
        left join (SELECT td.user_id order_user_id, td.ins_sample_id FROM ins_sample_user td,(SELECT max(id) id FROM ins_sample_user GROUP BY ins_sample_id) md  where td.id = md.id and user_id = #{userId}) isu2 on isu2.ins_sample_id = a.id
        left join (SELECT td.user_id order_user_id, td.ins_sample_id FROM ins_sample_user td,(SELECT max(id) id FROM
        ins_sample_user GROUP BY ins_sample_id) md where td.id = md.id and user_id = #{userId}) isu2 on
        isu2.ins_sample_id = a.id
        ORDER BY
        a.user_id DESC,
        a.type DESC,
@@ -214,7 +217,8 @@
        and ins_fibers_id is null
    </select>
    <select id="getSampleEn" resultType="java.lang.String">
        select name_en from `center-lims`.product
        select name_en
        from `center-lims`.product
        where name = #{sample}
    </select>
    <select id="selectSampleProductListByOrderId2" resultMap="sampleDto">
@@ -265,6 +269,33 @@
        where ins_order_id = #{id}
          and state = 1
    </select>
    <select id="selectSampleProductListByOrderId3" resultMap="sampleDto3">
        select isa.id,
        sample_code,
        entrust_code,
        is_leave,
        isa.model,
        isa.ins_state,
        ip.id ip_id,
        inspection_item,
        inspection_item_subclass,
        io.sample_type io_sample_type,
        ip.sample ip_sample,
        ip.model ip_model,
        ip.state,
        ins_sample_id
        from ins_sample isa
        left join ins_product ip on isa.id = ip.ins_sample_id
        left join ins_product_result ipr on ip.id = ipr.ins_product_id
        left join ins_order io on io.id = ins_order_id
        where  ip.state = 1
        and ins_order_id in
        <foreach collection="ids" open="(" close=")" item="id" separator=",">
            #{id}
        </foreach>
    </select>
    <select id="getInsProduct1" resultMap="product">
        select ip.id ip_id,
               inspection_item,
@@ -483,6 +514,33 @@
        <collection property="insProductResult" resultMap="insProductResult"/>
    </resultMap>
    <resultMap id="sampleDto3" type="com.yuanchu.mom.dto.SampleProductDto3">
        <id property="id" column="id" jdbcType="INTEGER"/>
        <result property="insResult" column="ins_result" jdbcType="INTEGER"/>
        <result property="insOrderId" column="ins_order_id" jdbcType="INTEGER"/>
        <result property="joinModel" column="join_model" jdbcType="VARCHAR"/>
        <result property="joinName" column="join_name" jdbcType="VARCHAR"/>
        <result property="ioSampleType" column="io_sample_type" jdbcType="VARCHAR"/>
        <result property="code" column="entrust_code" jdbcType="VARCHAR"/>
        <result property="isLeave" column="is_leave" jdbcType="VARCHAR"/>
        <result property="sampleCode" column="sample_code" jdbcType="VARCHAR"/>
        <result property="factory" column="factory" jdbcType="VARCHAR"/>
        <result property="laboratory" column="laboratory" jdbcType="VARCHAR"/>
        <result property="sampleType" column="sample_type" jdbcType="VARCHAR"/>
        <result property="sample" column="sample" jdbcType="VARCHAR"/>
        <result property="model" column="model" jdbcType="VARCHAR"/>
        <result property="insState" column="ins_state" jdbcType="INTEGER"/>
        <result property="joinNum" column="join_num" jdbcType="INTEGER"/>
        <result property="remark" column="remark" jdbcType="VARCHAR"/>
        <result property="createUser" column="create_user" jdbcType="INTEGER"/>
        <result property="updateUser" column="update_user" jdbcType="INTEGER"/>
        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
        <result property="standardMethodListId" column="standard_method_list_id"/>
        <result property="unit" column="unit"/>
        <collection property="insProduct" resultMap="product"/>
    </resultMap>
    <resultMap id="insProductResult" type="com.yuanchu.mom.pojo.InsProductResult">
        <result property="insValue" column="ins_value" jdbcType="VARCHAR"/>
        <result property="comValue" column="com_value" jdbcType="VARCHAR"/>