春风项目四线(合箱线、总装线)
wujian
2024-04-27 cffac1169880b8c55aa64517fdcaad118a3a972e
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?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.jcdm.main.rm.repairRecord.mapper.RmRepairRecordMapper">
    
    <resultMap type="RmRepairRecord" id="RmRepairRecordResult">
        <result property="id"    column="id"    />
        <result property="snCode"    column="sn_code"    />
        <result property="repairIdentification"    column="repair_identification"    />
        <result property="boxCode"    column="box_code"    />
        <result property="processesCode"    column="processes_code"    />
        <result property="originalResult"    column="original_result"    />
        <result property="createUser"    column="create_user"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
        <result property="updateUser"    column="update_user"    />
        <result property="repairResults"    column="repair_results"    />
        <result property="status"    column="status"    />
        <result property="remarks"    column="remarks"    />
        <result property="spareField1"    column="spare_field_1"    />
        <result property="spareField2"    column="spare_field_2"    />
    </resultMap>
 
    <sql id="selectRmRepairRecordVo">
        select id, sn_code, repair_identification, box_code, processes_code, original_result, create_user, create_time, update_time, update_user, repair_results, status, remarks, spare_field_1, spare_field_2,repair_time from rm_repair_record
    </sql>
 
    <select id="selectRmRepairRecordList" parameterType="RmRepairRecord" resultMap="RmRepairRecordResult">
        <include refid="selectRmRepairRecordVo"/>
        <where>  
            <if test="snCode != null  and snCode != ''"> and sn_code = #{snCode}</if>
            <if test="repairIdentification != null  and repairIdentification != ''"> and repair_identification = #{repairIdentification}</if>
            <if test="boxCode != null  and boxCode != ''"> and box_code = #{boxCode}</if>
            <if test="processesCode != null  and processesCode != ''"> and processes_code = #{processesCode}</if>
            <if test="originalResult != null  and originalResult != ''"> and original_result = #{originalResult}</if>
            <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
            <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
            <if test="repairResults != null  and repairResults != ''"> and repair_results = #{repairResults}</if>
            <if test="status != null  and status != ''"> and status = #{status}</if>
            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
            <if test="spareField1 != null  and spareField1 != ''"> and spare_field_1 = #{spareField1}</if>
            <if test="spareField2 != null  and spareField2 != ''"> and spare_field_2 = #{spareField2}</if>
            <if test="engineNoList != null and engineNoList.size() > 0">
                and box_code in
                <foreach collection="engineNoList" open="(" close=")" separator="," item="engine">
                    #{engine}
                </foreach>
            </if>
            <if test="engineNoListExcel != null and engineNoListExcel.size() > 0">
                and box_code in
                <foreach collection="engineNoListExcel" open="(" close=")" separator="," item="engine">
                    #{engine}
                </foreach>
            </if>
        </where>
    </select>
    
    <select id="selectRmRepairRecordById" parameterType="Long" resultMap="RmRepairRecordResult">
        <include refid="selectRmRepairRecordVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertRmRepairRecord" parameterType="RmRepairRecord" useGeneratedKeys="true" keyProperty="id">
        insert into rm_repair_record
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="snCode != null">sn_code,</if>
            <if test="repairIdentification != null">repair_identification,</if>
            <if test="boxCode != null">box_code,</if>
            <if test="processesCode != null">processes_code,</if>
            <if test="originalResult != null">original_result,</if>
            <if test="createUser != null">create_user,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="updateUser != null">update_user,</if>
            <if test="repairResults != null">repair_results,</if>
            <if test="status != null">status,</if>
            <if test="remarks != null">remarks,</if>
            <if test="spareField1 != null">spare_field_1,</if>
            <if test="spareField2 != null">spare_field_2,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="snCode != null">#{snCode},</if>
            <if test="repairIdentification != null">#{repairIdentification},</if>
            <if test="boxCode != null">#{boxCode},</if>
            <if test="processesCode != null">#{processesCode},</if>
            <if test="originalResult != null">#{originalResult},</if>
            <if test="createUser != null">#{createUser},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="updateUser != null">#{updateUser},</if>
            <if test="repairResults != null">#{repairResults},</if>
            <if test="status != null">#{status},</if>
            <if test="remarks != null">#{remarks},</if>
            <if test="spareField1 != null">#{spareField1},</if>
            <if test="spareField2 != null">#{spareField2},</if>
         </trim>
    </insert>
 
    <update id="updateRmRepairRecord" parameterType="RmRepairRecord">
        update rm_repair_record
        <trim prefix="SET" suffixOverrides=",">
            <if test="snCode != null">sn_code = #{snCode},</if>
            <if test="repairIdentification != null">repair_identification = #{repairIdentification},</if>
            <if test="boxCode != null">box_code = #{boxCode},</if>
            <if test="processesCode != null">processes_code = #{processesCode},</if>
            <if test="originalResult != null">original_result = #{originalResult},</if>
            <if test="createUser != null">create_user = #{createUser},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="updateUser != null">update_user = #{updateUser},</if>
            <if test="repairResults != null">repair_results = #{repairResults},</if>
            <if test="status != null">status = #{status},</if>
            <if test="remarks != null">remarks = #{remarks},</if>
            <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
            <if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteRmRepairRecordById" parameterType="Long">
        delete from rm_repair_record where id = #{id}
    </delete>
 
    <delete id="deleteRmRepairRecordByIds" parameterType="String">
        delete from rm_repair_record where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>