jiazx0107@163.com
2023-05-31 607e62cd6ec91d53bac549299d986c23e5143d28
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 
<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
        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,
        PLATE_NUM_ as plateNum,
        SAMPLE_USER_ as sampleUser,
        SAMPLE_TIME_ as sampleTime,
        SAMPLE_TYPE_ as sampleType,
        CHECK_ID_ as checkId,
        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.plateNum != null and param.plateNum != '' ">AND PLATE_NUM_ like #{param.plateNum}</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.sampleStatus != null and param.sampleStatus == 'NONE' ">AND SAMPLE_TIME_ IS NULL</if>
            <if test="param.sampleStatus != null and param.sampleStatus != 'NONE' ">AND SAMPLE_TIME_ IS NOT NULL</if>
        </where>
        AND RECORD_STATUS_ != 'DEL'
        AND RECORD_STATUS_ != 'ERROR'
        ORDER BY REGISTER_TIME_
    </select>
 
    <update id="updateSampleData" parameterType="com.ld.igds.inout.dto.InoutData">
        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
        COMPANY_ID_ =#{data.companyId}
        and ID_ =#{data.id}
    </update>
 
</mapper>