-
admin
2024-06-05 16714e1a824acd878b105e6ac433866cfc50ed89
提交 | 用户 | 时间
523903 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.inspectionPlanTask.mapper.EmInspectionPlanTaskMapper">
6     
7     <resultMap type="EmInspectionPlanTask" id="EmInspectionPlanTaskResult">
8         <result property="id"    column="id"    />
9         <result property="planCode"    column="plan_code"    />
10         <result property="planName"    column="plan_name"    />
11         <result property="planType"    column="plan_type"    />
12         <result property="state"    column="state"    />
13         <result property="devicesCode"    column="devices_code"    />
14         <result property="devicesName"    column="devices_name"    />
15         <result property="brand"    column="brand"    />
16         <result property="specs"    column="specs"    />
17         <result property="results"    column="results"    />
18         <result property="remarks"    column="remarks"    />
19         <result property="createTime"    column="create_time"    />
20         <result property="createUser"    column="create_user"    />
21         <result property="updateTime"    column="update_time"    />
22         <result property="updateUser"    column="update_user"    />
23     </resultMap>
24
25     <sql id="selectEmInspectionPlanTaskVo">
26         select id, plan_code, plan_name, plan_type, state, devices_code, devices_name, brand, specs, results, remarks, create_time, create_user, update_time, update_user from em_inspection_plan_task
27     </sql>
28
29     <select id="selectEmInspectionPlanTaskList" parameterType="EmInspectionPlanTask" resultMap="EmInspectionPlanTaskResult">
30         <include refid="selectEmInspectionPlanTaskVo"/>
31         <where>  
32             <if test="planCode != null  and planCode != ''"> and plan_code = #{planCode}</if>
33             <if test="planName != null  and planName != ''"> and plan_name like concat('%', #{planName}, '%')</if>
34             <if test="planType != null  and planType != ''"> and plan_type = #{planType}</if>
35             <if test="state != null  and state != ''"> and state = #{state}</if>
36             <if test="devicesCode != null  and devicesCode != ''"> and devices_code = #{devicesCode}</if>
37             <if test="devicesName != null  and devicesName != ''"> and devices_name like concat('%', #{devicesName}, '%')</if>
38         </where>
39     </select>
40     
41     <select id="selectEmInspectionPlanTaskById" parameterType="Long" resultMap="EmInspectionPlanTaskResult">
42         <include refid="selectEmInspectionPlanTaskVo"/>
43         where id = #{id}
44     </select>
45         
46     <insert id="insertEmInspectionPlanTask" parameterType="EmInspectionPlanTask" useGeneratedKeys="true" keyProperty="id">
47         insert into em_inspection_plan_task
48         <trim prefix="(" suffix=")" suffixOverrides=",">
49             <if test="planCode != null">plan_code,</if>
50             <if test="planName != null">plan_name,</if>
51             <if test="planType != null">plan_type,</if>
52             <if test="state != null">state,</if>
53             <if test="devicesCode != null">devices_code,</if>
54             <if test="devicesName != null">devices_name,</if>
55             <if test="brand != null">brand,</if>
56             <if test="specs != null">specs,</if>
57             <if test="results != null">results,</if>
58             <if test="remarks != null">remarks,</if>
59             <if test="createTime != null">create_time,</if>
60             <if test="createUser != null">create_user,</if>
61             <if test="updateTime != null">update_time,</if>
62             <if test="updateUser != null">update_user,</if>
63          </trim>
64         <trim prefix="values (" suffix=")" suffixOverrides=",">
65             <if test="planCode != null">#{planCode},</if>
66             <if test="planName != null">#{planName},</if>
67             <if test="planType != null">#{planType},</if>
68             <if test="state != null">#{state},</if>
69             <if test="devicesCode != null">#{devicesCode},</if>
70             <if test="devicesName != null">#{devicesName},</if>
71             <if test="brand != null">#{brand},</if>
72             <if test="specs != null">#{specs},</if>
73             <if test="results != null">#{results},</if>
74             <if test="remarks != null">#{remarks},</if>
75             <if test="createTime != null">#{createTime},</if>
76             <if test="createUser != null">#{createUser},</if>
77             <if test="updateTime != null">#{updateTime},</if>
78             <if test="updateUser != null">#{updateUser},</if>
79          </trim>
80     </insert>
81
82     <update id="updateEmInspectionPlanTask" parameterType="EmInspectionPlanTask">
83         update em_inspection_plan_task
84         <trim prefix="SET" suffixOverrides=",">
85             <if test="planCode != null">plan_code = #{planCode},</if>
86             <if test="planName != null">plan_name = #{planName},</if>
87             <if test="planType != null">plan_type = #{planType},</if>
88             <if test="state != null">state = #{state},</if>
89             <if test="devicesCode != null">devices_code = #{devicesCode},</if>
90             <if test="devicesName != null">devices_name = #{devicesName},</if>
91             <if test="brand != null">brand = #{brand},</if>
92             <if test="specs != null">specs = #{specs},</if>
93             <if test="results != null">results = #{results},</if>
94             <if test="remarks != null">remarks = #{remarks},</if>
95             <if test="createTime != null">create_time = #{createTime},</if>
96             <if test="createUser != null">create_user = #{createUser},</if>
97             <if test="updateTime != null">update_time = #{updateTime},</if>
98             <if test="updateUser != null">update_user = #{updateUser},</if>
99         </trim>
100         where id = #{id}
101     </update>
102
103     <delete id="deleteEmInspectionPlanTaskById" parameterType="Long">
104         delete from em_inspection_plan_task where id = #{id}
105     </delete>
106
107     <delete id="deleteEmInspectionPlanTaskByIds" parameterType="String">
108         delete from em_inspection_plan_task where id in 
109         <foreach item="id" collection="array" open="(" separator="," close=")">
110             #{id}
111         </foreach>
112     </delete>
113 </mapper>