春风项目四线(合箱线、总装线)
wujian
2024-04-27 cffac1169880b8c55aa64517fdcaad118a3a972e
提交 | 用户 | 时间
fd2207 1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper
3 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 <mapper namespace="com.jcdm.main.rm.repairRecord.mapper.RmRepairRecordMapper">
6     
7     <resultMap type="RmRepairRecord" id="RmRepairRecordResult">
8         <result property="id"    column="id"    />
9         <result property="snCode"    column="sn_code"    />
10         <result property="repairIdentification"    column="repair_identification"    />
11         <result property="boxCode"    column="box_code"    />
12         <result property="processesCode"    column="processes_code"    />
13         <result property="originalResult"    column="original_result"    />
14         <result property="createUser"    column="create_user"    />
15         <result property="createTime"    column="create_time"    />
16         <result property="updateTime"    column="update_time"    />
17         <result property="updateUser"    column="update_user"    />
18         <result property="repairResults"    column="repair_results"    />
19         <result property="status"    column="status"    />
20         <result property="remarks"    column="remarks"    />
21         <result property="spareField1"    column="spare_field_1"    />
22         <result property="spareField2"    column="spare_field_2"    />
23     </resultMap>
24
25     <sql id="selectRmRepairRecordVo">
26         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
27     </sql>
28
29     <select id="selectRmRepairRecordList" parameterType="RmRepairRecord" resultMap="RmRepairRecordResult">
30         <include refid="selectRmRepairRecordVo"/>
31         <where>  
32             <if test="snCode != null  and snCode != ''"> and sn_code = #{snCode}</if>
33             <if test="repairIdentification != null  and repairIdentification != ''"> and repair_identification = #{repairIdentification}</if>
34             <if test="boxCode != null  and boxCode != ''"> and box_code = #{boxCode}</if>
35             <if test="processesCode != null  and processesCode != ''"> and processes_code = #{processesCode}</if>
36             <if test="originalResult != null  and originalResult != ''"> and original_result = #{originalResult}</if>
37             <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
38             <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
39             <if test="repairResults != null  and repairResults != ''"> and repair_results = #{repairResults}</if>
40             <if test="status != null  and status != ''"> and status = #{status}</if>
41             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
42             <if test="spareField1 != null  and spareField1 != ''"> and spare_field_1 = #{spareField1}</if>
43             <if test="spareField2 != null  and spareField2 != ''"> and spare_field_2 = #{spareField2}</if>
8aafc5 44             <if test="engineNoList != null and engineNoList.size() > 0">
W 45                 and box_code in
46                 <foreach collection="engineNoList" open="(" close=")" separator="," item="engine">
47                     #{engine}
48                 </foreach>
49             </if>
50             <if test="engineNoListExcel != null and engineNoListExcel.size() > 0">
51                 and box_code in
52                 <foreach collection="engineNoListExcel" open="(" close=")" separator="," item="engine">
53                     #{engine}
54                 </foreach>
55             </if>
fd2207 56         </where>
57     </select>
58     
59     <select id="selectRmRepairRecordById" parameterType="Long" resultMap="RmRepairRecordResult">
60         <include refid="selectRmRepairRecordVo"/>
61         where id = #{id}
62     </select>
63         
64     <insert id="insertRmRepairRecord" parameterType="RmRepairRecord" useGeneratedKeys="true" keyProperty="id">
65         insert into rm_repair_record
66         <trim prefix="(" suffix=")" suffixOverrides=",">
67             <if test="snCode != null">sn_code,</if>
68             <if test="repairIdentification != null">repair_identification,</if>
69             <if test="boxCode != null">box_code,</if>
70             <if test="processesCode != null">processes_code,</if>
71             <if test="originalResult != null">original_result,</if>
72             <if test="createUser != null">create_user,</if>
73             <if test="createTime != null">create_time,</if>
74             <if test="updateTime != null">update_time,</if>
75             <if test="updateUser != null">update_user,</if>
76             <if test="repairResults != null">repair_results,</if>
77             <if test="status != null">status,</if>
78             <if test="remarks != null">remarks,</if>
79             <if test="spareField1 != null">spare_field_1,</if>
80             <if test="spareField2 != null">spare_field_2,</if>
81          </trim>
82         <trim prefix="values (" suffix=")" suffixOverrides=",">
83             <if test="snCode != null">#{snCode},</if>
84             <if test="repairIdentification != null">#{repairIdentification},</if>
85             <if test="boxCode != null">#{boxCode},</if>
86             <if test="processesCode != null">#{processesCode},</if>
87             <if test="originalResult != null">#{originalResult},</if>
88             <if test="createUser != null">#{createUser},</if>
89             <if test="createTime != null">#{createTime},</if>
90             <if test="updateTime != null">#{updateTime},</if>
91             <if test="updateUser != null">#{updateUser},</if>
92             <if test="repairResults != null">#{repairResults},</if>
93             <if test="status != null">#{status},</if>
94             <if test="remarks != null">#{remarks},</if>
95             <if test="spareField1 != null">#{spareField1},</if>
96             <if test="spareField2 != null">#{spareField2},</if>
97          </trim>
98     </insert>
99
100     <update id="updateRmRepairRecord" parameterType="RmRepairRecord">
101         update rm_repair_record
102         <trim prefix="SET" suffixOverrides=",">
103             <if test="snCode != null">sn_code = #{snCode},</if>
104             <if test="repairIdentification != null">repair_identification = #{repairIdentification},</if>
105             <if test="boxCode != null">box_code = #{boxCode},</if>
106             <if test="processesCode != null">processes_code = #{processesCode},</if>
107             <if test="originalResult != null">original_result = #{originalResult},</if>
108             <if test="createUser != null">create_user = #{createUser},</if>
109             <if test="createTime != null">create_time = #{createTime},</if>
110             <if test="updateTime != null">update_time = #{updateTime},</if>
111             <if test="updateUser != null">update_user = #{updateUser},</if>
112             <if test="repairResults != null">repair_results = #{repairResults},</if>
113             <if test="status != null">status = #{status},</if>
114             <if test="remarks != null">remarks = #{remarks},</if>
115             <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
116             <if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
117         </trim>
118         where id = #{id}
119     </update>
120
121     <delete id="deleteRmRepairRecordById" parameterType="Long">
122         delete from rm_repair_record where id = #{id}
123     </delete>
124
125     <delete id="deleteRmRepairRecordByIds" parameterType="String">
126         delete from rm_repair_record where id in 
127         <foreach item="id" collection="array" open="(" separator="," close=")">
128             #{id}
129         </foreach>
130     </delete>
131 </mapper>