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