ProcessFormMapper.xml
6.8 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?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.sunyo.customer.order.activity.dao.ProcessFormMapper" >
<resultMap id="BaseResultMap" type="com.sunyo.customer.order.activity.model.ProcessForm" >
<id column="formId" property="formid" jdbcType="VARCHAR" />
<id column="processInstanceId" property="processinstanceid" jdbcType="VARCHAR" />
<result column="userId" property="userid" jdbcType="INTEGER" />
<result column="processName" property="processname" jdbcType="VARCHAR" />
<result column="beginDate" property="begindate" jdbcType="TIMESTAMP" />
<result column="endDate" property="enddate" jdbcType="TIMESTAMP" />
<result column="vacationType" property="vacationtype" jdbcType="TINYINT" />
<result column="reason" property="reason" jdbcType="VARCHAR" />
<result column="processStatus" property="processstatus" jdbcType="TINYINT" />
<result column="createTime" property="createtime" jdbcType="TIMESTAMP" />
<result column="updateTime" property="updatetime" jdbcType="TIMESTAMP" />
<association property="user" javaType="com.sunyo.customer.order.activity.model.USER" >
<id column="user_id" property="userId"/>
<result column="realName" property="realname"/>
</association>
</resultMap>
<sql id="Base_Column_List" >
formId, processInstanceId, userId, processName, beginDate, endDate, vacationType,
reason, processStatus, createTime, updateTime
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="com.sunyo.customer.order.activity.model.ProcessForm" >
select
<include refid="Base_Column_List" />
from processForm
where formId = #{formid,jdbcType=VARCHAR}
and processInstanceId = #{processinstanceid,jdbcType=VARCHAR}
</select>
<select id="selectAllWithUser" resultMap="BaseResultMap" >
select
p.*,
u.realName
from processForm p
LEFT JOIN users u
ON p.userId = u.user_id
</select>
<delete id="deleteByPrimaryKey" parameterType="com.sunyo.customer.order.activity.model.ProcessForm" >
delete from processForm
where formId = #{formid,jdbcType=VARCHAR}
and processInstanceId = #{processinstanceid,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.sunyo.customer.order.activity.model.ProcessForm" >
insert into processForm (formId, processInstanceId, userId,
processName, beginDate, endDate,
vacationType, reason, processStatus,
createTime, updateTime)
values (#{formid,jdbcType=VARCHAR}, #{processinstanceid,jdbcType=VARCHAR}, #{userid,jdbcType=INTEGER},
#{processname,jdbcType=VARCHAR}, #{begindate,jdbcType=TIMESTAMP}, #{enddate,jdbcType=TIMESTAMP},
#{vacationtype,jdbcType=TINYINT}, #{reason,jdbcType=VARCHAR}, #{processstatus,jdbcType=TINYINT},
#{createtime,jdbcType=TIMESTAMP}, #{updatetime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.sunyo.customer.order.activity.model.ProcessForm" >
insert into processForm
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="formid != null" >
formId,
</if>
<if test="processinstanceid != null" >
processInstanceId,
</if>
<if test="userid != null" >
userId,
</if>
<if test="processname != null" >
processName,
</if>
<if test="begindate != null" >
beginDate,
</if>
<if test="enddate != null" >
endDate,
</if>
<if test="vacationtype != null" >
vacationType,
</if>
<if test="reason != null" >
reason,
</if>
<if test="processstatus != null" >
processStatus,
</if>
<if test="createtime != null" >
createTime,
</if>
<if test="updatetime != null" >
updateTime,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="formid != null" >
#{formid,jdbcType=VARCHAR},
</if>
<if test="processinstanceid != null" >
#{processinstanceid,jdbcType=VARCHAR},
</if>
<if test="userid != null" >
#{userid,jdbcType=INTEGER},
</if>
<if test="processname != null" >
#{processname,jdbcType=VARCHAR},
</if>
<if test="begindate != null" >
#{begindate,jdbcType=TIMESTAMP},
</if>
<if test="enddate != null" >
#{enddate,jdbcType=TIMESTAMP},
</if>
<if test="vacationtype != null" >
#{vacationtype,jdbcType=TINYINT},
</if>
<if test="reason != null" >
#{reason,jdbcType=VARCHAR},
</if>
<if test="processstatus != null" >
#{processstatus,jdbcType=TINYINT},
</if>
<if test="createtime != null" >
#{createtime,jdbcType=TIMESTAMP},
</if>
<if test="updatetime != null" >
#{updatetime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.customer.order.activity.model.ProcessForm" >
update processForm
<set >
<if test="userid != null" >
userId = #{userid,jdbcType=INTEGER},
</if>
<if test="processname != null" >
processName = #{processname,jdbcType=VARCHAR},
</if>
<if test="begindate != null" >
beginDate = #{begindate,jdbcType=TIMESTAMP},
</if>
<if test="enddate != null" >
endDate = #{enddate,jdbcType=TIMESTAMP},
</if>
<if test="vacationtype != null" >
vacationType = #{vacationtype,jdbcType=TINYINT},
</if>
<if test="reason != null" >
reason = #{reason,jdbcType=VARCHAR},
</if>
<if test="processstatus != null" >
processStatus = #{processstatus,jdbcType=TINYINT},
</if>
<if test="createtime != null" >
createTime = #{createtime,jdbcType=TIMESTAMP},
</if>
<if test="updatetime != null" >
updateTime = #{updatetime,jdbcType=TIMESTAMP},
</if>
</set>
where formId = #{formid,jdbcType=VARCHAR}
and processInstanceId = #{processinstanceid,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sunyo.customer.order.activity.model.ProcessForm" >
update processForm
set userId = #{userid,jdbcType=INTEGER},
processName = #{processname,jdbcType=VARCHAR},
beginDate = #{begindate,jdbcType=TIMESTAMP},
endDate = #{enddate,jdbcType=TIMESTAMP},
vacationType = #{vacationtype,jdbcType=TINYINT},
reason = #{reason,jdbcType=VARCHAR},
processStatus = #{processstatus,jdbcType=TINYINT},
createTime = #{createtime,jdbcType=TIMESTAMP},
updateTime = #{updatetime,jdbcType=TIMESTAMP}
where formId = #{formid,jdbcType=VARCHAR}
and processInstanceId = #{processinstanceid,jdbcType=VARCHAR}
</update>
</mapper>