cl
2024-07-03 2de8567d25edbe0c020f75182b44016bfcc85d0b
提交 | 用户 | 时间
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.inspectionPlan.mapper.EmInspectionPlanMapper">
6     
7     <resultMap type="EmInspectionPlan" id="EmInspectionPlanResult">
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="frequency"    column="frequency"    />
14         <result property="dimension"    column="dimension"    />
15         <result property="lastGenerationTime"    column="last_generation_time"    />
16         <result property="startTime"    column="start_time"    />
17         <result property="endTime"    column="end_time"    />
18         <result property="devices"    column="devices"    />
19         <result property="inspectionItems"    column="Inspection_items"    />
20         <result property="remarks"    column="remarks"    />
21         <result property="createTime"    column="create_time"    />
22         <result property="createUser"    column="create_user"    />
23         <result property="updateTime"    column="update_time"    />
24         <result property="updateUser"    column="update_user"    />
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="selectEmInspectionPlanVo">
32         select id, plan_code, plan_name, plan_type, state, frequency, dimension, last_generation_time, start_time, end_time, devices, Inspection_items, remarks, create_time, create_user, update_time, update_user, spare_field_1, spare_field_2, spare_field_3, spare_field_4 from em_inspection_plan
33     </sql>
34
35     <select id="selectEmInspectionPlanList" parameterType="EmInspectionPlan" resultMap="EmInspectionPlanResult">
36         <include refid="selectEmInspectionPlanVo"/>
37         <where>  
38             <if test="planCode != null  and planCode != ''"> and plan_code like concat('%', #{planCode}, '%')</if>
39             <if test="planName != null  and planName != ''"> and plan_name like concat('%', #{planName}, '%')</if>
40             <if test="planType != null  and planType != ''"> and plan_type = #{planType}</if>
41             <if test="state != null  and state != ''"> and state = #{state}</if>
42             <if test="frequency != null  and frequency != ''"> and frequency = #{frequency}</if>
43             <if test="dimension != null  and dimension != ''"> and dimension = #{dimension}</if>
44             <if test="startTime != null  and startTime != ''"> and start_time = #{startTime}</if>
45             <if test="endTime != null  and endTime != ''"> and end_time = #{endTime}</if>
46         </where>
47     </select>
48     
49     <select id="selectEmInspectionPlanById" parameterType="Long" resultMap="EmInspectionPlanResult">
50         <include refid="selectEmInspectionPlanVo"/>
51         where id = #{id}
52     </select>
53         
54     <insert id="insertEmInspectionPlan" parameterType="EmInspectionPlan" useGeneratedKeys="true" keyProperty="id">
55         insert into em_inspection_plan
56         <trim prefix="(" suffix=")" suffixOverrides=",">
57             <if test="planCode != null">plan_code,</if>
58             <if test="planName != null">plan_name,</if>
59             <if test="planType != null">plan_type,</if>
60             <if test="state != null">state,</if>
61             <if test="frequency != null">frequency,</if>
62             <if test="dimension != null">dimension,</if>
63             <if test="lastGenerationTime != null">last_generation_time,</if>
64             <if test="startTime != null">start_time,</if>
65             <if test="endTime != null">end_time,</if>
66             <if test="devices != null">devices,</if>
67             <if test="inspectionItems != null">Inspection_items,</if>
68             <if test="remarks != null">remarks,</if>
69             <if test="createTime != null">create_time,</if>
70             <if test="createUser != null">create_user,</if>
71             <if test="updateTime != null">update_time,</if>
72             <if test="updateUser != null">update_user,</if>
73             <if test="spareField1 != null">spare_field_1,</if>
74             <if test="spareField2 != null">spare_field_2,</if>
75             <if test="spareField3 != null">spare_field_3,</if>
76             <if test="spareField4 != null">spare_field_4,</if>
77          </trim>
78         <trim prefix="values (" suffix=")" suffixOverrides=",">
79             <if test="planCode != null">#{planCode},</if>
80             <if test="planName != null">#{planName},</if>
81             <if test="planType != null">#{planType},</if>
82             <if test="state != null">#{state},</if>
83             <if test="frequency != null">#{frequency},</if>
84             <if test="dimension != null">#{dimension},</if>
85             <if test="lastGenerationTime != null">#{lastGenerationTime},</if>
86             <if test="startTime != null">#{startTime},</if>
87             <if test="endTime != null">#{endTime},</if>
88             <if test="devices != null">#{devices},</if>
89             <if test="inspectionItems != null">#{inspectionItems},</if>
90             <if test="remarks != null">#{remarks},</if>
91             <if test="createTime != null">#{createTime},</if>
92             <if test="createUser != null">#{createUser},</if>
93             <if test="updateTime != null">#{updateTime},</if>
94             <if test="updateUser != null">#{updateUser},</if>
95             <if test="spareField1 != null">#{spareField1},</if>
96             <if test="spareField2 != null">#{spareField2},</if>
97             <if test="spareField3 != null">#{spareField3},</if>
98             <if test="spareField4 != null">#{spareField4},</if>
99          </trim>
100     </insert>
101
102     <update id="updateEmInspectionPlan" parameterType="EmInspectionPlan">
103         update em_inspection_plan
104         <trim prefix="SET" suffixOverrides=",">
105             <if test="planCode != null">plan_code = #{planCode},</if>
106             <if test="planName != null">plan_name = #{planName},</if>
107             <if test="planType != null">plan_type = #{planType},</if>
108             <if test="state != null">state = #{state},</if>
109             <if test="frequency != null">frequency = #{frequency},</if>
110             <if test="dimension != null">dimension = #{dimension},</if>
111             <if test="lastGenerationTime != null">last_generation_time = #{lastGenerationTime},</if>
112             <if test="startTime != null">start_time = #{startTime},</if>
113             <if test="endTime != null">end_time = #{endTime},</if>
114             <if test="devices != null">devices = #{devices},</if>
115             <if test="inspectionItems != null">Inspection_items = #{inspectionItems},</if>
116             <if test="remarks != null">remarks = #{remarks},</if>
117             <if test="createTime != null">create_time = #{createTime},</if>
118             <if test="createUser != null">create_user = #{createUser},</if>
119             <if test="updateTime != null">update_time = #{updateTime},</if>
120             <if test="updateUser != null">update_user = #{updateUser},</if>
121             <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
122             <if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
123             <if test="spareField3 != null">spare_field_3 = #{spareField3},</if>
124             <if test="spareField4 != null">spare_field_4 = #{spareField4},</if>
125         </trim>
126         where id = #{id}
127     </update>
128
129     <delete id="deleteEmInspectionPlanById" parameterType="Long">
130         delete from em_inspection_plan where id = #{id}
131     </delete>
132
133     <delete id="deleteEmInspectionPlanByIds" parameterType="String">
134         delete from em_inspection_plan where id in 
135         <foreach item="id" collection="array" open="(" separator="," close=")">
136             #{id}
137         </foreach>
138     </delete>
139 </mapper>