提交 | 用户 | 时间
|
b5450a
|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
H |
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.inspectionPlanArchives.mapper.EmInspectionPlanArchivesMapper"> |
|
6 |
|
|
7 |
<resultMap type="EmInspectionPlanArchives" id="EmInspectionPlanArchivesResult"> |
|
8 |
<result property="id" column="id" /> |
|
9 |
<result property="equipmentCode" column="equipment_code" /> |
|
10 |
<result property="equipmentName" column="equipment_name" /> |
|
11 |
<result property="equipmentBrand" column="equipment_brand" /> |
|
12 |
<result property="equipmentSpec" column="equipment_spec" /> |
|
13 |
<result property="remark" column="remark" /> |
|
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="spareField1" column="spare_field_1" /> |
|
19 |
<result property="spareField2" column="spare_field_2" /> |
|
20 |
<result property="spareField3" column="spare_field_3" /> |
|
21 |
<result property="spareField4" column="spare_field_4" /> |
|
22 |
<result property="planCode" column="plan_code" /> |
|
23 |
</resultMap> |
|
24 |
|
|
25 |
<sql id="selectEmInspectionPlanArchivesVo"> |
|
26 |
select id, equipment_code, equipment_name, equipment_brand, equipment_spec, remark, create_user, create_time, update_user, update_time, spare_field_1, spare_field_2, spare_field_3, spare_field_4, plan_code from em_inspection_plan_archives |
|
27 |
</sql> |
|
28 |
|
|
29 |
<select id="selectEmInspectionPlanArchivesList" parameterType="EmInspectionPlanArchives" resultMap="EmInspectionPlanArchivesResult"> |
|
30 |
<include refid="selectEmInspectionPlanArchivesVo"/> |
|
31 |
<where> |
|
32 |
<if test="equipmentCode != null and equipmentCode != ''"> and equipment_code = #{equipmentCode}</if> |
|
33 |
<if test="equipmentName != null and equipmentName != ''"> and equipment_name like concat('%', #{equipmentName}, '%')</if> |
|
34 |
<if test="equipmentBrand != null and equipmentBrand != ''"> and equipment_brand = #{equipmentBrand}</if> |
|
35 |
<if test="equipmentSpec != null and equipmentSpec != ''"> and equipment_spec = #{equipmentSpec}</if> |
|
36 |
<if test="createUser != null and createUser != ''"> and create_user = #{createUser}</if> |
|
37 |
<if test="updateUser != null and updateUser != ''"> and update_user = #{updateUser}</if> |
|
38 |
<if test="spareField1 != null and spareField1 != ''"> and spare_field_1 = #{spareField1}</if> |
|
39 |
<if test="spareField2 != null and spareField2 != ''"> and spare_field_2 = #{spareField2}</if> |
|
40 |
<if test="spareField3 != null "> and spare_field_3 = #{spareField3}</if> |
|
41 |
<if test="spareField4 != null "> and spare_field_4 = #{spareField4}</if> |
|
42 |
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if> |
|
43 |
</where> |
|
44 |
</select> |
|
45 |
|
|
46 |
<select id="selectEmInspectionPlanArchivesById" parameterType="Long" resultMap="EmInspectionPlanArchivesResult"> |
|
47 |
<include refid="selectEmInspectionPlanArchivesVo"/> |
|
48 |
where id = #{id} |
|
49 |
</select> |
|
50 |
|
|
51 |
<insert id="insertEmInspectionPlanArchives" parameterType="EmInspectionPlanArchives" useGeneratedKeys="true" keyProperty="id"> |
|
52 |
insert into em_inspection_plan_archives |
|
53 |
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
54 |
<if test="equipmentCode != null">equipment_code,</if> |
|
55 |
<if test="equipmentName != null">equipment_name,</if> |
|
56 |
<if test="equipmentBrand != null">equipment_brand,</if> |
|
57 |
<if test="equipmentSpec != null">equipment_spec,</if> |
|
58 |
<if test="remark != null">remark,</if> |
|
59 |
<if test="createUser != null">create_user,</if> |
|
60 |
<if test="createTime != null">create_time,</if> |
|
61 |
<if test="updateUser != null">update_user,</if> |
|
62 |
<if test="updateTime != null">update_time,</if> |
|
63 |
<if test="spareField1 != null">spare_field_1,</if> |
|
64 |
<if test="spareField2 != null">spare_field_2,</if> |
|
65 |
<if test="spareField3 != null">spare_field_3,</if> |
|
66 |
<if test="spareField4 != null">spare_field_4,</if> |
|
67 |
<if test="planCode != null">plan_code,</if> |
|
68 |
</trim> |
|
69 |
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
70 |
<if test="equipmentCode != null">#{equipmentCode},</if> |
|
71 |
<if test="equipmentName != null">#{equipmentName},</if> |
|
72 |
<if test="equipmentBrand != null">#{equipmentBrand},</if> |
|
73 |
<if test="equipmentSpec != null">#{equipmentSpec},</if> |
|
74 |
<if test="remark != null">#{remark},</if> |
|
75 |
<if test="createUser != null">#{createUser},</if> |
|
76 |
<if test="createTime != null">#{createTime},</if> |
|
77 |
<if test="updateUser != null">#{updateUser},</if> |
|
78 |
<if test="updateTime != null">#{updateTime},</if> |
|
79 |
<if test="spareField1 != null">#{spareField1},</if> |
|
80 |
<if test="spareField2 != null">#{spareField2},</if> |
|
81 |
<if test="spareField3 != null">#{spareField3},</if> |
|
82 |
<if test="spareField4 != null">#{spareField4},</if> |
|
83 |
<if test="planCode != null">#{planCode},</if> |
|
84 |
</trim> |
|
85 |
</insert> |
|
86 |
|
|
87 |
<update id="updateEmInspectionPlanArchives" parameterType="EmInspectionPlanArchives"> |
|
88 |
update em_inspection_plan_archives |
|
89 |
<trim prefix="SET" suffixOverrides=","> |
|
90 |
<if test="equipmentCode != null">equipment_code = #{equipmentCode},</if> |
|
91 |
<if test="equipmentName != null">equipment_name = #{equipmentName},</if> |
|
92 |
<if test="equipmentBrand != null">equipment_brand = #{equipmentBrand},</if> |
|
93 |
<if test="equipmentSpec != null">equipment_spec = #{equipmentSpec},</if> |
|
94 |
<if test="remark != null">remark = #{remark},</if> |
|
95 |
<if test="createUser != null">create_user = #{createUser},</if> |
|
96 |
<if test="createTime != null">create_time = #{createTime},</if> |
|
97 |
<if test="updateUser != null">update_user = #{updateUser},</if> |
|
98 |
<if test="updateTime != null">update_time = #{updateTime},</if> |
|
99 |
<if test="spareField1 != null">spare_field_1 = #{spareField1},</if> |
|
100 |
<if test="spareField2 != null">spare_field_2 = #{spareField2},</if> |
|
101 |
<if test="spareField3 != null">spare_field_3 = #{spareField3},</if> |
|
102 |
<if test="spareField4 != null">spare_field_4 = #{spareField4},</if> |
|
103 |
<if test="planCode != null">plan_code = #{planCode},</if> |
|
104 |
</trim> |
|
105 |
where id = #{id} |
|
106 |
</update> |
|
107 |
|
|
108 |
<delete id="deleteEmInspectionPlanArchivesById" parameterType="Long"> |
|
109 |
delete from em_inspection_plan_archives where id = #{id} |
|
110 |
</delete> |
|
111 |
|
|
112 |
<delete id="deleteEmInspectionPlanArchivesByIds" parameterType="String"> |
|
113 |
delete from em_inspection_plan_archives where id in |
|
114 |
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|
115 |
#{id} |
|
116 |
</foreach> |
|
117 |
</delete> |
|
118 |
</mapper> |