czt
2023-06-01 419e76f6256868851ed245940297f7f5bfd99e55
igds-inout/src/main/resources/mapper/InoutCheckMapper.xml
@@ -5,6 +5,7 @@
<mapper namespace="com.ld.igds.inout.mapper.InoutCheckMapper">
    <!--分页获取扦样数据-->
    <select id="pageSampleData" resultType="com.ld.igds.inout.dto.InoutCheckData"
            parameterType="com.ld.igds.inout.dto.InoutCheckParam">
        select
@@ -41,15 +42,74 @@
        ORDER BY REGISTER_TIME_
    </select>
    <update id="updateSampleData" parameterType="com.ld.igds.inout.dto.InoutData">
        update D_INOUT_RECORD set
    <!--更新扦样信息-->
    <update id="updateSampleData" parameterType="com.ld.igds.inout.dto.InoutCheckData">
        UPDATE D_INOUT_RECORD SET
        <if test="data.sampleUser != null">SAMPLE_USER_ = #{data.sampleUser},</if>
        <if test="data.sampleTime != null">SAMPLE_TIME_ = #{data.sampleTime},</if>
        <if test="data.sampleType != null">SAMPLE_TYPE_ = #{data.sampleType},</if>
        TYPE_ = #{data.type}
        where
        WHERE
        COMPANY_ID_ =#{data.companyId}
        and ID_ =#{data.id}
        AND ID_ =#{data.id}
    </update>
    <!--分页获取化验数据-->
    <select id="pageCheckData" resultType="com.ld.igds.inout.dto.InoutCheckData"
            parameterType="com.ld.igds.inout.dto.InoutCheckParam">
        select
        ID_ as id,
        COMPANY_ID_ as companyId,
        DEPT_ID_ as deptId,
        TYPE_ as type,
        PROGRESS_ as progress,
        RECORD_STATUS_ as recordStatus,
        INTEL_CARD_ as intelCard,
        REGISTER_TIME_ as registerTime,
        REGISTER_USER_ as registerUser,
        DEPOT_ID_ as depotId,
        FOOD_VARIETY_ as foodVariety,
        PLATE_NUM_ as plateNum,
        SAMPLE_USER_ as sampleUser,
        SAMPLE_TIME_ as sampleTime,
        CHECK_USER_ as checkUser,
        CHECK_TIME_ as checkTime,
        CHECK_ID_ as checkId,
        CHECK_STATUS_ AS checkStatus,
        IF(ISNULL(SAMPLE_TIME_),'NONE','SAMPLE') AS sampleStatus
        from
        D_INOUT_RECORD
        <where>
            <if test="param.companyId != null and param.companyId != '' ">AND COMPANY_ID_ = #{param.companyId}</if>
            <if test="param.deptId != null and  param.deptId != '' ">AND DEPT_ID_ = #{param.deptId}</if>
            <if test="param.checkId != null and param.checkId != '' ">AND CHECK_ID_ like #{param.checkId}</if>
            <if test="param.foodVariety != null and param.foodVariety != '' ">AND FOOD_VARIETY_ = #{param.foodVariety}</if>
            <if test="param.depotId != null and param.depotId != '' ">AND DEPOT_ID_ = #{param.depotId}</if>
            <if test="param.progress != null and param.progress != '' ">AND PROGRESS_ = #{param.progress}</if>
            <if test="param.start != null">AND REGISTER_TIME_ <![CDATA[ >= ]]>#{param.start,jdbcType=TIMESTAMP}</if>
            <if test="param.end != null">AND REGISTER_TIME_  <![CDATA[ <= ]]>#{param.end,jdbcType=TIMESTAMP}</if>
            <if test="param.checkStatus != null and param.checkStatus != 'NONE' ">AND CHECK_STATUS_ != 'NONE' AND CHECK_STATUS_ IS NOT NULL</if>
            <if test="param.checkStatus != null and param.checkStatus == 'NONE' ">AND CHECK_STATUS_ = 'NONE'</if>
        </where>
        AND RECORD_STATUS_ != 'DEL'
        AND RECORD_STATUS_ != 'ERROR'
        ORDER BY REGISTER_TIME_
    </select>
    <!--更新化验信息-->
    <update id="updateCheckData" parameterType="com.ld.igds.inout.dto.InoutCheckData">
        UPDATE D_INOUT_RECORD SET
        <if test="data.depotId != null">DEPOT_ID_ = #{data.depotId},</if>
        <if test="data.checkUser != null">CHECK_USER_ = #{data.checkUser},</if>
        <if test="data.checkTime != null">CHECK_TIME_ = #{data.checkTime},</if>
        <if test="data.checkStatus != null">CEHCK_STATUS = #{data.checkStatus},</if>
        <if test="data.foodLevel != null">FOOD_LEVEL = #{data.foodLevel},</if>
        <if test="data.deCheck != null">DE_CHECK_ = #{data.deCheck},</if>
        <if test="data.addCheck != null">ADD_CHECK = #{data.addCheck},</if>
        TYPE_ = #{data.type}
        WHERE
        COMPANY_ID_ =#{data.companyId}
        AND ID_ =#{data.id}
    </update>
</mapper>