ConstructionSignMapper.xml
5.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.trash.business.mapper.ConstructionSignMapper">
<resultMap type="ConstructionSign" id="ConstructionSignResult">
<result property="id" column="id" />
<result property="objectId" column="object_id" />
<result property="workflowId" column="workflow_id" />
<result property="createTime" column="create_time" />
<result property="sign1" column="sign1" />
<result property="sign2" column="sign2" />
<result property="sign3" column="sign3" />
<result property="sign4" column="sign4" />
<result property="sign1Time" column="sign1_time" />
<result property="sign2Time" column="sign2_time" />
<result property="sign3Time" column="sign3_time" />
<result property="sign4Time" column="sign4_time" />
<result property="sign1Text" column="sign1_text" />
<result property="sign2Text" column="sign2_text" />
<result property="sign3Text" column="sign3_text" />
<result property="sign4Text" column="sign4_text" />
</resultMap>
<sql id="selectConstructionSignVo">
select id, object_id, workflow_id, create_time, sign1, sign2, sign3, sign4,sign1_time,sign2_time,sign3_time,sign4_time,sign1_text,sign2_text,sign3_text,sign4_text from construction_sign
</sql>
<select id="selectConstructionSignList" parameterType="ConstructionSign" resultMap="ConstructionSignResult">
<include refid="selectConstructionSignVo"/>
<where>
<if test="objectId != null and objectId != ''"> and object_id = #{objectId}</if>
<if test="workflowId != null and workflowId != ''"> and workflow_id = #{workflowId}</if>
</where>
</select>
<select id="selectConstructionSignById" parameterType="Long" resultMap="ConstructionSignResult">
<include refid="selectConstructionSignVo"/>
where id = #{id}
</select>
<select id="selectConstructionSignByObjId" parameterType="String" resultMap="ConstructionSignResult">
<include refid="selectConstructionSignVo"/>
where object_id = #{objectId}
</select>
<insert id="insertConstructionSign" parameterType="ConstructionSign" useGeneratedKeys="true" keyProperty="id">
insert into construction_sign
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="objectId != null">object_id,</if>
<if test="workflowId != null">workflow_id,</if>
<if test="createTime != null">create_time,</if>
<if test="sign1 != null">sign1,</if>
<if test="sign2 != null">sign2,</if>
<if test="sign3 != null">sign3,</if>
<if test="sign4 != null">sign4,</if>
<if test="sign1Time != null">sign1_time,</if>
<if test="sign2Time != null">sign2_time,</if>
<if test="sign3Time != null">sign3_time,</if>
<if test="sign4Time != null">sign4_time,</if>
<if test="sign1Text != null">sign1_text,</if>
<if test="sign2Text != null">sign2_text,</if>
<if test="sign3Text != null">sign3_text,</if>
<if test="sign4Text != null">sign4_text,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="objectId != null">#{objectId},</if>
<if test="workflowId != null">#{workflowId},</if>
<if test="createTime != null">#{createTime},</if>
<if test="sign1 != null">#{sign1},</if>
<if test="sign2 != null">#{sign2},</if>
<if test="sign3 != null">#{sign3},</if>
<if test="sign4 != null">#{sign4},</if>
<if test="sign1Time != null">#{sign1Time},</if>
<if test="sign2Time != null">#{sign2Time},</if>
<if test="sign3Time != null">#{sign3Time},</if>
<if test="sign4Time != null">#{sign4Time},</if>
<if test="sign1Text != null">#{sign1Text},</if>
<if test="sign2Text != null">#{sign2Text},</if>
<if test="sign3Text != null">#{sign3Text},</if>
<if test="sign4Text != null">#{sign4Text},</if>
</trim>
</insert>
<update id="updateConstructionSign" parameterType="ConstructionSign">
update construction_sign
<trim prefix="SET" suffixOverrides=",">
<if test="objectId != null">object_id = #{objectId},</if>
<if test="workflowId != null">workflow_id = #{workflowId},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="sign1 != null">sign1 = #{sign1},</if>
<if test="sign2 != null">sign2 = #{sign2},</if>
<if test="sign3 != null">sign3 = #{sign3},</if>
<if test="sign4 != null">sign4 = #{sign4},</if>
<if test="sign1Time != null">sign1_time = #{sign1Time},</if>
<if test="sign2Time != null">sign2_time =#{sign2Time},</if>
<if test="sign3Time != null">sign3_time =#{sign3Time},</if>
<if test="sign4Time != null">sign4_time =#{sign4Time},</if>
<if test="sign1Text != null">sign1_text = #{sign1Text},</if>
<if test="sign2Text != null">sign2_text =#{sign2Text},</if>
<if test="sign3Text != null">sign3_text =#{sign3Text},</if>
<if test="sign4Text != null">sign4_text =#{sign4Text},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteConstructionSignById" parameterType="Long">
delete from construction_sign where id = #{id}
</delete>
<delete id="deleteConstructionSignByIds" parameterType="String">
delete from construction_sign where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>