春风项目四线(合箱线、总装线)
jiang
2024-01-12 c9a5c5c9a57abee05470e958e4dc161809f73cf4
提交 | 用户 | 时间
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.equipmentAlarm.mapper.EmEquipmentAlarmMapper">
6
7     <resultMap type="EmEquipmentAlarm" id="EmEquipmentAlarmResult">
8         <result property="id"    column="id"    />
9         <result property="equipmentCode"    column="equipment_code"    />
10         <result property="equipmentName"    column="equipment_name"    />
11         <result property="equipmentType"    column="equipment_type"    />
12         <result property="workshopCode"    column="workshop_code"    />
13         <result property="lineCode"    column="line_code"    />
14         <result property="processesCode"    column="processes_code"    />
15         <result property="errorNo"    column="error_no"    />
16         <result property="errorDesc"    column="error_desc"    />
17         <result property="alarmTime"    column="alarm_time"    />
18         <result property="whetherRecovery"    column="whether_recovery"    />
19         <result property="recoveryTime"    column="recovery_time"    />
20         <result property="spareField1"    column="spare_field_1"    />
21         <result property="spareField2"    column="spare_field_2"    />
22         <result property="spareField3"    column="spare_field_3"    />
23         <result property="spareField4"    column="spare_field_4"    />
24         <result property="remarks"    column="remarks"    />
25     </resultMap>
26
27     <sql id="selectEmEquipmentAlarmVo">
28         select id, equipment_code, equipment_name, equipment_type, workshop_code, line_code, processes_code, error_no, error_desc, alarm_time, whether_recovery, recovery_time, spare_field_1, spare_field_2, spare_field_3, spare_field_4, remarks from em_equipment_alarm
29     </sql>
30
31     <select id="selectEmEquipmentAlarmList" parameterType="EmEquipmentAlarm" resultMap="EmEquipmentAlarmResult">
32         <include refid="selectEmEquipmentAlarmVo"/>
33         <where>  
34             <if test="equipmentCode != null  and equipmentCode != ''"> and equipment_code like concat('%', #{equipmentCode}, '%')</if>
35             <if test="equipmentName != null  and equipmentName != ''"> and equipment_name like concat('%', #{equipmentName}, '%')</if>
36             <if test="equipmentType != null  and equipmentType != ''"> and equipment_type = #{equipmentType}</if>
37             <if test="errorNo != null  and errorNo != ''"> and error_no = #{errorNo}</if>
38         </where>
39     </select>
40     
41     <select id="selectEmEquipmentAlarmById" parameterType="Long" resultMap="EmEquipmentAlarmResult">
42         <include refid="selectEmEquipmentAlarmVo"/>
43         where id = #{id}
44     </select>
45         
46     <insert id="insertEmEquipmentAlarm" parameterType="EmEquipmentAlarm">
47         insert into em_equipment_alarm
48         <trim prefix="(" suffix=")" suffixOverrides=",">
49             <if test="id != null">id,</if>
50             <if test="equipmentCode != null and equipmentCode != ''">equipment_code,</if>
51             <if test="equipmentName != null and equipmentName != ''">equipment_name,</if>
52             <if test="equipmentType != null and equipmentType != ''">equipment_type,</if>
53             <if test="workshopCode != null">workshop_code,</if>
54             <if test="lineCode != null">line_code,</if>
55             <if test="processesCode != null and processesCode != ''">processes_code,</if>
56             <if test="errorNo != null and errorNo != ''">error_no,</if>
57             <if test="errorDesc != null">error_desc,</if>
58             <if test="alarmTime != null">alarm_time,</if>
59             <if test="whetherRecovery != null">whether_recovery,</if>
60             <if test="recoveryTime != null">recovery_time,</if>
61             <if test="spareField1 != null">spare_field_1,</if>
62             <if test="spareField2 != null">spare_field_2,</if>
63             <if test="spareField3 != null">spare_field_3,</if>
64             <if test="spareField4 != null">spare_field_4,</if>
65             <if test="remarks != null">remarks,</if>
66          </trim>
67         <trim prefix="values (" suffix=")" suffixOverrides=",">
68             <if test="id != null">#{id},</if>
69             <if test="equipmentCode != null and equipmentCode != ''">#{equipmentCode},</if>
70             <if test="equipmentName != null and equipmentName != ''">#{equipmentName},</if>
71             <if test="equipmentType != null and equipmentType != ''">#{equipmentType},</if>
72             <if test="workshopCode != null">#{workshopCode},</if>
73             <if test="lineCode != null">#{lineCode},</if>
74             <if test="processesCode != null and processesCode != ''">#{processesCode},</if>
75             <if test="errorNo != null and errorNo != ''">#{errorNo},</if>
76             <if test="errorDesc != null">#{errorDesc},</if>
77             <if test="alarmTime != null">#{alarmTime},</if>
78             <if test="whetherRecovery != null">#{whetherRecovery},</if>
79             <if test="recoveryTime != null">#{recoveryTime},</if>
80             <if test="spareField1 != null">#{spareField1},</if>
81             <if test="spareField2 != null">#{spareField2},</if>
82             <if test="spareField3 != null">#{spareField3},</if>
83             <if test="spareField4 != null">#{spareField4},</if>
84             <if test="remarks != null">#{remarks},</if>
85          </trim>
86     </insert>
87
88     <update id="updateEmEquipmentAlarm" parameterType="EmEquipmentAlarm">
89         update em_equipment_alarm
90         <trim prefix="SET" suffixOverrides=",">
91             <if test="equipmentCode != null and equipmentCode != ''">equipment_code = #{equipmentCode},</if>
92             <if test="equipmentName != null and equipmentName != ''">equipment_name = #{equipmentName},</if>
93             <if test="equipmentType != null and equipmentType != ''">equipment_type = #{equipmentType},</if>
94             <if test="workshopCode != null">workshop_code = #{workshopCode},</if>
95             <if test="lineCode != null">line_code = #{lineCode},</if>
96             <if test="processesCode != null and processesCode != ''">processes_code = #{processesCode},</if>
97             <if test="errorNo != null and errorNo != ''">error_no = #{errorNo},</if>
98             <if test="errorDesc != null">error_desc = #{errorDesc},</if>
99             <if test="alarmTime != null">alarm_time = #{alarmTime},</if>
100             <if test="whetherRecovery != null">whether_recovery = #{whetherRecovery},</if>
101             <if test="recoveryTime != null">recovery_time = #{recoveryTime},</if>
102             <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
103             <if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
104             <if test="spareField3 != null">spare_field_3 = #{spareField3},</if>
105             <if test="spareField4 != null">spare_field_4 = #{spareField4},</if>
106             <if test="remarks != null">remarks = #{remarks},</if>
107         </trim>
108         where id = #{id}
109     </update>
110
111     <delete id="deleteEmEquipmentAlarmById" parameterType="Long">
112         delete from em_equipment_alarm where id = #{id}
113     </delete>
114
115     <delete id="deleteEmEquipmentAlarmByIds" parameterType="String">
116         delete from em_equipment_alarm where id in 
117         <foreach item="id" collection="array" open="(" separator="," close=")">
118             #{id}
119         </foreach>
120     </delete>
121 </mapper>