-
懒羊羊
2024-03-23 e20d7373595960ad6be9bd6373a3c6f186e76e5c
提交 | 用户 | 时间
e57a89 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>
44         </where>
45     </select>
46     
47     <select id="selectRmRepairRecordById" parameterType="Long" resultMap="RmRepairRecordResult">
48         <include refid="selectRmRepairRecordVo"/>
49         where id = #{id}
50     </select>
51         
52     <insert id="insertRmRepairRecord" parameterType="RmRepairRecord" useGeneratedKeys="true" keyProperty="id">
53         insert into rm_repair_record
54         <trim prefix="(" suffix=")" suffixOverrides=",">
55             <if test="snCode != null">sn_code,</if>
56             <if test="repairIdentification != null">repair_identification,</if>
57             <if test="boxCode != null">box_code,</if>
58             <if test="processesCode != null">processes_code,</if>
59             <if test="originalResult != null">original_result,</if>
60             <if test="createUser != null">create_user,</if>
61             <if test="createTime != null">create_time,</if>
62             <if test="updateTime != null">update_time,</if>
63             <if test="updateUser != null">update_user,</if>
64             <if test="repairResults != null">repair_results,</if>
65             <if test="status != null">status,</if>
66             <if test="remarks != null">remarks,</if>
67             <if test="spareField1 != null">spare_field_1,</if>
68             <if test="spareField2 != null">spare_field_2,</if>
69          </trim>
70         <trim prefix="values (" suffix=")" suffixOverrides=",">
71             <if test="snCode != null">#{snCode},</if>
72             <if test="repairIdentification != null">#{repairIdentification},</if>
73             <if test="boxCode != null">#{boxCode},</if>
74             <if test="processesCode != null">#{processesCode},</if>
75             <if test="originalResult != null">#{originalResult},</if>
76             <if test="createUser != null">#{createUser},</if>
77             <if test="createTime != null">#{createTime},</if>
78             <if test="updateTime != null">#{updateTime},</if>
79             <if test="updateUser != null">#{updateUser},</if>
80             <if test="repairResults != null">#{repairResults},</if>
81             <if test="status != null">#{status},</if>
82             <if test="remarks != null">#{remarks},</if>
83             <if test="spareField1 != null">#{spareField1},</if>
84             <if test="spareField2 != null">#{spareField2},</if>
85          </trim>
86     </insert>
87
88     <update id="updateRmRepairRecord" parameterType="RmRepairRecord">
89         update rm_repair_record
90         <trim prefix="SET" suffixOverrides=",">
91             <if test="snCode != null">sn_code = #{snCode},</if>
92             <if test="repairIdentification != null">repair_identification = #{repairIdentification},</if>
93             <if test="boxCode != null">box_code = #{boxCode},</if>
94             <if test="processesCode != null">processes_code = #{processesCode},</if>
95             <if test="originalResult != null">original_result = #{originalResult},</if>
96             <if test="createUser != null">create_user = #{createUser},</if>
97             <if test="createTime != null">create_time = #{createTime},</if>
98             <if test="updateTime != null">update_time = #{updateTime},</if>
99             <if test="updateUser != null">update_user = #{updateUser},</if>
100             <if test="repairResults != null">repair_results = #{repairResults},</if>
101             <if test="status != null">status = #{status},</if>
102             <if test="remarks != null">remarks = #{remarks},</if>
103             <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
104             <if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
105         </trim>
106         where id = #{id}
107     </update>
108
109     <delete id="deleteRmRepairRecordById" parameterType="Long">
110         delete from rm_repair_record where id = #{id}
111     </delete>
112
113     <delete id="deleteRmRepairRecordByIds" parameterType="String">
114         delete from rm_repair_record where id in 
115         <foreach item="id" collection="array" open="(" separator="," close=")">
116             #{id}
117         </foreach>
118     </delete>
119 </mapper>