春风项目四线(合箱线、总装线)
yyt
2024-02-17 386e107222d673a1ea2781a03a7b1b1d28212f58
提交 | 用户 | 时间
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.em.equipmentArchives.mapper.EmEquipmentArchivesMapper">
6     
7     <resultMap type="EmEquipmentArchives" id="EmEquipmentArchivesResult">
8         <result property="id"    column="id"    />
9         <result property="equipmentCode"    column="equipment_code"    />
10         <result property="equipmentName"    column="equipment_name"    />
11         <result property="equipmentBrand"    column="equipment_brand"    />
12         <result property="equipmentSpec"    column="equipment_spec"    />
13         <result property="equipmentTypeId"    column="equipment_type_id"    />
14         <result property="equipmentTypeCode"    column="equipment_type_code"    />
15         <result property="equipmentTypeName"    column="equipment_type_name"    />
16         <result property="workshopCode"    column="workshop_code"    />
17         <result property="lineCode"    column="line_code"    />
ae70f3 18         <result property="processesCode"    column="processes_code"    />
fd2207 19         <result property="status"    column="status"    />
20         <result property="remark"    column="remark"    />
21         <result property="createUser"    column="create_user"    />
22         <result property="createTime"    column="create_time"    />
23         <result property="updateUser"    column="update_user"    />
24         <result property="updateTime"    column="update_time"    />
25         <result property="spareField1"    column="spare_field_1"    />
26         <result property="spareField2"    column="spare_field_2"    />
27         <result property="spareField3"    column="spare_field_3"    />
28         <result property="spareField4"    column="spare_field_4"    />
29     </resultMap>
30
31     <sql id="selectEmEquipmentArchivesVo">
065fe8 32         select id, equipment_code, equipment_name, equipment_brand, equipment_spec, equipment_type_id, equipment_type_code, equipment_type_name, workshop_code, line_code, processes_code, status, remark, create_user, create_time, update_user, update_time, spare_field_1, spare_field_2, spare_field_3, spare_field_4 from em_equipment_archives
fd2207 33     </sql>
34
35     <select id="selectEmEquipmentArchivesList" parameterType="EmEquipmentArchives" resultMap="EmEquipmentArchivesResult">
36         <include refid="selectEmEquipmentArchivesVo"/>
37         <where>  
38             <if test="equipmentCode != null  and equipmentCode != ''"> and equipment_code = #{equipmentCode}</if>
39             <if test="equipmentName != null  and equipmentName != ''"> and equipment_name like concat('%', #{equipmentName}, '%')</if>
40             <if test="equipmentBrand != null  and equipmentBrand != ''"> and equipment_brand = #{equipmentBrand}</if>
41             <if test="equipmentSpec != null  and equipmentSpec != ''"> and equipment_spec = #{equipmentSpec}</if>
42             <if test="equipmentTypeId != null "> and equipment_type_id = #{equipmentTypeId}</if>
43             <if test="equipmentTypeCode != null  and equipmentTypeCode != ''"> and equipment_type_code = #{equipmentTypeCode}</if>
44             <if test="equipmentTypeName != null  and equipmentTypeName != ''"> and equipment_type_name like concat('%', #{equipmentTypeName}, '%')</if>
45             <if test="workshopCode != null  and workshopCode != ''"> and workshop_code = #{workshopCode}</if>
46             <if test="lineCode != null  and lineCode != ''"> and line_code = #{lineCode}</if>
ae70f3 47             <if test="processesCode != null  and processesCode != ''"> and processes_code = #{processesCode}</if>
fd2207 48             <if test="status != null  and status != ''"> and status = #{status}</if>
49             <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
50             <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
51             <if test="spareField1 != null  and spareField1 != ''"> and spare_field_1 = #{spareField1}</if>
52             <if test="spareField2 != null  and spareField2 != ''"> and spare_field_2 = #{spareField2}</if>
53             <if test="spareField3 != null "> and spare_field_3 = #{spareField3}</if>
54             <if test="spareField4 != null "> and spare_field_4 = #{spareField4}</if>
55         </where>
56     </select>
57     
58     <select id="selectEmEquipmentArchivesById" parameterType="Long" resultMap="EmEquipmentArchivesResult">
59         <include refid="selectEmEquipmentArchivesVo"/>
60         where id = #{id}
61     </select>
62         
63     <insert id="insertEmEquipmentArchives" parameterType="EmEquipmentArchives">
64         insert into em_equipment_archives
65         <trim prefix="(" suffix=")" suffixOverrides=",">
66             <if test="id != null">id,</if>
67             <if test="equipmentCode != null and equipmentCode != ''">equipment_code,</if>
68             <if test="equipmentName != null and equipmentName != ''">equipment_name,</if>
69             <if test="equipmentBrand != null">equipment_brand,</if>
70             <if test="equipmentSpec != null">equipment_spec,</if>
71             <if test="equipmentTypeId != null">equipment_type_id,</if>
72             <if test="equipmentTypeCode != null">equipment_type_code,</if>
73             <if test="equipmentTypeName != null">equipment_type_name,</if>
74             <if test="workshopCode != null">workshop_code,</if>
75             <if test="lineCode != null">line_code,</if>
ae70f3 76             <if test="processesCode != null">processes_code,</if>
fd2207 77             <if test="status != null">status,</if>
78             <if test="remark != null">remark,</if>
79             <if test="createUser != null">create_user,</if>
80             <if test="createTime != null">create_time,</if>
81             <if test="updateUser != null">update_user,</if>
82             <if test="updateTime != null">update_time,</if>
83             <if test="spareField1 != null">spare_field_1,</if>
84             <if test="spareField2 != null">spare_field_2,</if>
85             <if test="spareField3 != null">spare_field_3,</if>
86             <if test="spareField4 != null">spare_field_4,</if>
87          </trim>
88         <trim prefix="values (" suffix=")" suffixOverrides=",">
89             <if test="id != null">#{id},</if>
90             <if test="equipmentCode != null and equipmentCode != ''">#{equipmentCode},</if>
91             <if test="equipmentName != null and equipmentName != ''">#{equipmentName},</if>
92             <if test="equipmentBrand != null">#{equipmentBrand},</if>
93             <if test="equipmentSpec != null">#{equipmentSpec},</if>
94             <if test="equipmentTypeId != null">#{equipmentTypeId},</if>
95             <if test="equipmentTypeCode != null">#{equipmentTypeCode},</if>
96             <if test="equipmentTypeName != null">#{equipmentTypeName},</if>
97             <if test="workshopCode != null">#{workshopCode},</if>
98             <if test="lineCode != null">#{lineCode},</if>
ae70f3 99             <if test="processesCode != null">#{processesCode},</if>
fd2207 100             <if test="status != null">#{status},</if>
101             <if test="remark != null">#{remark},</if>
102             <if test="createUser != null">#{createUser},</if>
103             <if test="createTime != null">#{createTime},</if>
104             <if test="updateUser != null">#{updateUser},</if>
105             <if test="updateTime != null">#{updateTime},</if>
106             <if test="spareField1 != null">#{spareField1},</if>
107             <if test="spareField2 != null">#{spareField2},</if>
108             <if test="spareField3 != null">#{spareField3},</if>
109             <if test="spareField4 != null">#{spareField4},</if>
110          </trim>
111     </insert>
112
113     <update id="updateEmEquipmentArchives" parameterType="EmEquipmentArchives">
114         update em_equipment_archives
115         <trim prefix="SET" suffixOverrides=",">
116             <if test="equipmentCode != null and equipmentCode != ''">equipment_code = #{equipmentCode},</if>
117             <if test="equipmentName != null and equipmentName != ''">equipment_name = #{equipmentName},</if>
118             <if test="equipmentBrand != null">equipment_brand = #{equipmentBrand},</if>
119             <if test="equipmentSpec != null">equipment_spec = #{equipmentSpec},</if>
120             <if test="equipmentTypeId != null">equipment_type_id = #{equipmentTypeId},</if>
121             <if test="equipmentTypeCode != null">equipment_type_code = #{equipmentTypeCode},</if>
122             <if test="equipmentTypeName != null">equipment_type_name = #{equipmentTypeName},</if>
123             <if test="workshopCode != null">workshop_code = #{workshopCode},</if>
124             <if test="lineCode != null">line_code = #{lineCode},</if>
ae70f3 125             <if test="processesCode != null">processes_code = #{processesCode},</if>
fd2207 126             <if test="status != null">status = #{status},</if>
127             <if test="remark != null">remark = #{remark},</if>
128             <if test="createUser != null">create_user = #{createUser},</if>
129             <if test="createTime != null">create_time = #{createTime},</if>
130             <if test="updateUser != null">update_user = #{updateUser},</if>
131             <if test="updateTime != null">update_time = #{updateTime},</if>
132             <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
133             <if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
134             <if test="spareField3 != null">spare_field_3 = #{spareField3},</if>
135             <if test="spareField4 != null">spare_field_4 = #{spareField4},</if>
136         </trim>
137         where id = #{id}
138     </update>
139
140     <delete id="deleteEmEquipmentArchivesById" parameterType="Long">
141         delete from em_equipment_archives where id = #{id}
142     </delete>
143
144     <delete id="deleteEmEquipmentArchivesByIds" parameterType="String">
145         delete from em_equipment_archives where id in 
146         <foreach item="id" collection="array" open="(" separator="," close=")">
147             #{id}
148         </foreach>
149     </delete>
150 </mapper>