admin
2024-10-15 6d313a4a6f9f9d7ea65ec50ab0d4491e595edb97
提交 | 用户 | 时间
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.inspectionPlanItemsProject.mapper.EmInspectionPlanItemsProjectMapper">
6     
7     <resultMap type="EmInspectionPlanItemsProject" id="EmInspectionPlanItemsProjectResult">
8         <result property="id"    column="id"    />
9         <result property="itemsCode"    column="items_code"    />
10         <result property="itemsName"    column="items_name"    />
11         <result property="itemsType"    column="items_type"    />
12         <result property="standard"    column="standard"    />
13         <result property="itemsContent"    column="items_content"    />
14         <result property="createUser"    column="create_user"    />
15         <result property="createTime"    column="create_time"    />
16         <result property="updateUser"    column="update_user"    />
17         <result property="updateTime"    column="update_time"    />
18         <result property="results"    column="results"    />
19         <result property="planTaskId"    column="plan_task_id"    />
20     </resultMap>
21
22     <sql id="selectEmInspectionPlanItemsProjectVo">
23         select id, items_code, items_name, items_type, standard, items_content, create_user, create_time, update_user, update_time, results, plan_task_id from em_inspection_plan_items_project
24     </sql>
25
26     <select id="selectEmInspectionPlanItemsProjectList" parameterType="EmInspectionPlanItemsProject" resultMap="EmInspectionPlanItemsProjectResult">
27         <include refid="selectEmInspectionPlanItemsProjectVo"/>
28         <where>  
29             <if test="itemsCode != null  and itemsCode != ''"> and items_code = #{itemsCode}</if>
30             <if test="itemsName != null  and itemsName != ''"> and items_name like concat('%', #{itemsName}, '%')</if>
31             <if test="itemsType != null  and itemsType != ''"> and items_type = #{itemsType}</if>
32             <if test="standard != null  and standard != ''"> and standard = #{standard}</if>
33             <if test="results != null  and results != ''"> and results = #{results}</if>
34         </where>
35     </select>
36     
37     <select id="selectEmInspectionPlanItemsProjectById" parameterType="Long" resultMap="EmInspectionPlanItemsProjectResult">
38         <include refid="selectEmInspectionPlanItemsProjectVo"/>
39         where id = #{id}
40     </select>
41         
42     <insert id="insertEmInspectionPlanItemsProject" parameterType="EmInspectionPlanItemsProject" useGeneratedKeys="true" keyProperty="id">
43         insert into em_inspection_plan_items_project
44         <trim prefix="(" suffix=")" suffixOverrides=",">
45             <if test="itemsCode != null">items_code,</if>
46             <if test="itemsName != null">items_name,</if>
47             <if test="itemsType != null">items_type,</if>
48             <if test="standard != null">standard,</if>
49             <if test="itemsContent != null">items_content,</if>
50             <if test="createUser != null">create_user,</if>
51             <if test="createTime != null">create_time,</if>
52             <if test="updateUser != null">update_user,</if>
53             <if test="updateTime != null">update_time,</if>
54             <if test="results != null">results,</if>
55             <if test="planTaskId != null">plan_task_id,</if>
56          </trim>
57         <trim prefix="values (" suffix=")" suffixOverrides=",">
58             <if test="itemsCode != null">#{itemsCode},</if>
59             <if test="itemsName != null">#{itemsName},</if>
60             <if test="itemsType != null">#{itemsType},</if>
61             <if test="standard != null">#{standard},</if>
62             <if test="itemsContent != null">#{itemsContent},</if>
63             <if test="createUser != null">#{createUser},</if>
64             <if test="createTime != null">#{createTime},</if>
65             <if test="updateUser != null">#{updateUser},</if>
66             <if test="updateTime != null">#{updateTime},</if>
67             <if test="results != null">#{results},</if>
68             <if test="planTaskId != null">#{planTaskId},</if>
69          </trim>
70     </insert>
71
72     <update id="updateEmInspectionPlanItemsProject" parameterType="EmInspectionPlanItemsProject">
73         update em_inspection_plan_items_project
74         <trim prefix="SET" suffixOverrides=",">
75             <if test="itemsCode != null">items_code = #{itemsCode},</if>
76             <if test="itemsName != null">items_name = #{itemsName},</if>
77             <if test="itemsType != null">items_type = #{itemsType},</if>
78             <if test="standard != null">standard = #{standard},</if>
79             <if test="itemsContent != null">items_content = #{itemsContent},</if>
80             <if test="createUser != null">create_user = #{createUser},</if>
81             <if test="createTime != null">create_time = #{createTime},</if>
82             <if test="updateUser != null">update_user = #{updateUser},</if>
83             <if test="updateTime != null">update_time = #{updateTime},</if>
84             <if test="results != null">results = #{results},</if>
85             <if test="planTaskId != null">plan_task_id = #{planTaskId},</if>
86         </trim>
87         where id = #{id}
88     </update>
89
90     <delete id="deleteEmInspectionPlanItemsProjectById" parameterType="Long">
91         delete from em_inspection_plan_items_project where id = #{id}
92     </delete>
93
94     <delete id="deleteEmInspectionPlanItemsProjectByIds" parameterType="String">
95         delete from em_inspection_plan_items_project where id in 
96         <foreach item="id" collection="array" open="(" separator="," close=")">
97             #{id}
98         </foreach>
99     </delete>
100 </mapper>