admin
2024-07-03 475e409e27c5f05b0dcf2be1063ce35700c51bf2
提交 | 用户 | 时间
0ca254 1 <?xml version="1.0" encoding="UTF-8" ?>
A 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.equipmentStatus.mapper.EmEquipmentStatusMapper">
6     
7     <resultMap type="EmEquipmentStatus" id="EmEquipmentStatusResult">
8         <result property="id"    column="id"    />
9         <result property="equipmentNo"    column="equipment_no"    />
10         <result property="equipmentName"    column="equipment_name"    />
11         <result property="workshopCode"    column="workshop_code"    />
12         <result property="productionLineCode"    column="production_line_code"    />
13         <result property="processesCode"    column="processes_code"    />
14         <result property="eqStatus"    column="eq_status"    />
15         <result property="spareField1"    column="spare_field_1"    />
16         <result property="spareField2"    column="spare_field_2"    />
17         <result property="remarks"    column="remarks"    />
18         <result property="updateTime"    column="update_time"    />
19     </resultMap>
20
21     <sql id="selectEmEquipmentStatusVo">
22         select id, equipment_no, equipment_name, workshop_code, production_line_code, processes_code, eq_status, spare_field_1, spare_field_2, remarks, update_time from em_equipment_status
23     </sql>
24
25     <select id="selectEmEquipmentStatusList" parameterType="EmEquipmentStatus" resultMap="EmEquipmentStatusResult">
26         <include refid="selectEmEquipmentStatusVo"/>
27         <where>  
28             <if test="equipmentNo != null  and equipmentNo != ''"> and equipment_no like concat('%', #{equipmentNo}, '%')</if>
29             <if test="equipmentName != null  and equipmentName != ''"> and equipment_name like concat('%', #{equipmentName}, '%')</if>
30             <if test="workshopCode != null  and workshopCode != ''"> and workshop_code like concat('%', #{workshopCode}, '%')</if>
31             <if test="productionLineCode != null  and productionLineCode != ''"> and production_line_code like concat('%', #{productionLineCode}, '%')</if>
32             <if test="processesCode != null  and processesCode != ''"> and processes_code like concat('%', #{processesCode}, '%')</if>
33             <if test="eqStatus != null  and eqStatus != ''"> and eq_status like concat('%', #{eqStatus}, '%')</if>
34         </where>
35     </select>
36     
37     <select id="selectEmEquipmentStatusById" parameterType="Long" resultMap="EmEquipmentStatusResult">
38         <include refid="selectEmEquipmentStatusVo"/>
39         where id = #{id}
40     </select>
41         
42     <insert id="insertEmEquipmentStatus" parameterType="EmEquipmentStatus">
43         insert into em_equipment_status
44         <trim prefix="(" suffix=")" suffixOverrides=",">
45             <if test="id != null">id,</if>
46             <if test="equipmentNo != null">equipment_no,</if>
47             <if test="equipmentName != null">equipment_name,</if>
48             <if test="workshopCode != null">workshop_code,</if>
49             <if test="productionLineCode != null">production_line_code,</if>
50             <if test="processesCode != null">processes_code,</if>
51             <if test="eqStatus != null">eq_status,</if>
52             <if test="spareField1 != null">spare_field_1,</if>
53             <if test="spareField2 != null">spare_field_2,</if>
54             <if test="remarks != null">remarks,</if>
55             <if test="updateTime != null">update_time,</if>
56          </trim>
57         <trim prefix="values (" suffix=")" suffixOverrides=",">
58             <if test="id != null">#{id},</if>
59             <if test="equipmentNo != null">#{equipmentNo},</if>
60             <if test="equipmentName != null">#{equipmentName},</if>
61             <if test="workshopCode != null">#{workshopCode},</if>
62             <if test="productionLineCode != null">#{productionLineCode},</if>
63             <if test="processesCode != null">#{processesCode},</if>
64             <if test="eqStatus != null">#{eqStatus},</if>
65             <if test="spareField1 != null">#{spareField1},</if>
66             <if test="spareField2 != null">#{spareField2},</if>
67             <if test="remarks != null">#{remarks},</if>
68             <if test="updateTime != null">#{updateTime},</if>
69          </trim>
70     </insert>
71
72     <update id="updateEmEquipmentStatus" parameterType="EmEquipmentStatus">
73         update em_equipment_status
74         <trim prefix="SET" suffixOverrides=",">
75             <if test="equipmentNo != null">equipment_no = #{equipmentNo},</if>
76             <if test="equipmentName != null">equipment_name = #{equipmentName},</if>
77             <if test="workshopCode != null">workshop_code = #{workshopCode},</if>
78             <if test="productionLineCode != null">production_line_code = #{productionLineCode},</if>
79             <if test="processesCode != null">processes_code = #{processesCode},</if>
80             <if test="eqStatus != null">eq_status = #{eqStatus},</if>
81             <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
82             <if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
83             <if test="remarks != null">remarks = #{remarks},</if>
84             <if test="updateTime != null">update_time = #{updateTime},</if>
85         </trim>
86         where id = #{id}
87     </update>
88
89     <delete id="deleteEmEquipmentStatusById" parameterType="Long">
90         delete from em_equipment_status where id = #{id}
91     </delete>
92
93     <delete id="deleteEmEquipmentStatusByIds" parameterType="String">
94         delete from em_equipment_status where id in 
95         <foreach item="id" collection="array" open="(" separator="," close=")">
96             #{id}
97         </foreach>
98     </delete>
99 </mapper>