JOBMapper.xml
5.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
<?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.JOBMapper" >
<resultMap id="BaseResultMap" type="com.sunyo.customer.order.activity.model.JOB" >
<id column="auditId" property="auditid" jdbcType="VARCHAR" />
<result column="processInstanceId" property="processinstanceid" jdbcType="VARCHAR" />
<result column="processId" property="processid" jdbcType="VARCHAR" />
<result column="taskId" property="taskid" jdbcType="VARCHAR" />
<result column="userId" property="userid" jdbcType="INTEGER" />
<result column="auditResuld" property="auditresuld" jdbcType="TINYINT" />
<result column="coment" property="coment" jdbcType="VARCHAR" />
<result column="auditTime" property="audittime" 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>
<association property="process" javaType="com.sunyo.customer.order.activity.model.ProcessForm" >
<id column="formId" property="formid"/>
<result column="processName" property="processname"/>
</association>
</resultMap>
<sql id="Base_Column_List" >
auditId, processInstanceId, taskId, userId, auditResuld, coment, auditTime, processId
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from job
where auditId = #{auditid,jdbcType=VARCHAR}
</select>
<select id="selectAllWithUser" resultMap="BaseResultMap" >
SELECT job.*,process.formId,process.processName,u.realName from job job
LEFT JOIN processForm process
on
job.taskId = process.formId
LEFT JOIN users u
on job.userId = u.user_id
where 1=1
<if test="userid != null">
AND job.userId = #{userid,jdbcType=VARCHAR}
</if>
<if test="processid != null">
AND job.processId = #{processid,jdbcType=VARCHAR}
</if>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from job
where auditId = #{auditid,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.sunyo.customer.order.activity.model.JOB" >
insert into job (auditId, processInstanceId, taskId,
userId, auditResuld, coment,
auditTime)
values (#{auditid,jdbcType=VARCHAR}, #{processinstanceid,jdbcType=VARCHAR}, #{taskid,jdbcType=VARCHAR},
#{userid,jdbcType=INTEGER}, #{auditresuld,jdbcType=TINYINT}, #{coment,jdbcType=VARCHAR},
#{audittime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.sunyo.customer.order.activity.model.JOB" >
insert into job
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="auditid != null" >
auditId,
</if>
<if test="processinstanceid != null" >
processInstanceId,
</if>
<if test="processid != null" >
processId,
</if>
<if test="taskid != null" >
taskId,
</if>
<if test="userid != null" >
userId,
</if>
<if test="auditresuld != null" >
auditResuld,
</if>
<if test="coment != null" >
coment,
</if>
<if test="audittime != null" >
auditTime,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="auditid != null" >
#{auditid,jdbcType=VARCHAR},
</if>
<if test="processinstanceid != null" >
#{processinstanceid,jdbcType=VARCHAR},
</if>
<if test="processid != null" >
#{processid,jdbcType=VARCHAR},
</if>
<if test="taskid != null" >
#{taskid,jdbcType=VARCHAR},
</if>
<if test="userid != null" >
#{userid,jdbcType=INTEGER},
</if>
<if test="auditresuld != null" >
#{auditresuld,jdbcType=TINYINT},
</if>
<if test="coment != null" >
#{coment,jdbcType=VARCHAR},
</if>
<if test="audittime != null" >
#{audittime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.customer.order.activity.model.JOB" >
update job
<set >
<if test="processinstanceid != null" >
processInstanceId = #{processinstanceid,jdbcType=VARCHAR},
</if>
<if test="processid != null" >
processId = #{processinstanceid,jdbcType=VARCHAR},
</if>
<if test="taskid != null" >
taskId = #{taskid,jdbcType=VARCHAR},
</if>
<if test="userid != null" >
userId = #{userid,jdbcType=INTEGER},
</if>
<if test="auditresuld != null" >
auditResuld = #{auditresuld,jdbcType=TINYINT},
</if>
<if test="coment != null" >
coment = #{coment,jdbcType=VARCHAR},
</if>
<if test="audittime != null" >
auditTime = #{audittime,jdbcType=TIMESTAMP},
</if>
</set>
where auditId = #{auditid,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sunyo.customer.order.activity.model.JOB" >
update job
set processInstanceId = #{processinstanceid,jdbcType=VARCHAR},
taskId = #{taskid,jdbcType=VARCHAR},
userId = #{userid,jdbcType=INTEGER},
auditResuld = #{auditresuld,jdbcType=TINYINT},
coment = #{coment,jdbcType=VARCHAR},
auditTime = #{audittime,jdbcType=TIMESTAMP}
where auditId = #{auditid,jdbcType=VARCHAR}
</update>
<update id="startJob" parameterType="com.sunyo.customer.order.activity.model.JOB" >
update job
set
userId = #{userid,jdbcType=INTEGER},
auditResuld = #{auditresuld,jdbcType=TINYINT},
coment = #{coment,jdbcType=VARCHAR}
where auditId = #{auditid,jdbcType=VARCHAR}
</update>
</mapper>