ActExecutionMapper.xml
7.78 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<?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.hotent.bpm.persistence.dao.ActExecutionDao">
<resultMap id="ActExecution" type="com.hotent.bpm.persistence.model.ActExecution">
<id property="id" column="ID_" jdbcType="VARCHAR"/>
<result property="rev" column="REV_" jdbcType="NUMERIC"/>
<result property="procInstId" column="PROC_INST_ID_" jdbcType="VARCHAR"/>
<result property="businessKey" column="BUSINESS_KEY_" jdbcType="VARCHAR"/>
<result property="parentId" column="PARENT_ID_" jdbcType="VARCHAR"/>
<result property="procDefId" column="PROC_DEF_ID_" jdbcType="VARCHAR"/>
<result property="superExec" column="SUPER_EXEC_" jdbcType="VARCHAR"/>
<result property="actId" column="ACT_ID_" jdbcType="VARCHAR"/>
<result property="isActive" column="IS_ACTIVE_" jdbcType="BOOLEAN"/>
<result property="isConcurrent" column="IS_CONCURRENT_" jdbcType="BOOLEAN"/>
<result property="isScope" column="IS_SCOPE_" jdbcType="BOOLEAN"/>
<result property="isEventScope" column="IS_EVENT_SCOPE_" jdbcType="BOOLEAN"/>
<result property="suspensionState" column="SUSPENSION_STATE_" jdbcType="NUMERIC"/>
<result property="cachedEntState" column="CACHED_ENT_STATE_" jdbcType="NUMERIC"/>
</resultMap>
<select id="getByParentsId" parameterType="java.lang.String" resultType="java.lang.String">
SELECT ID_ FROM act_ru_execution WHERE PARENT_ID_=#{parentId}
</select>
<select id="getBySupperId" parameterType="java.lang.String" resultType="java.lang.String">
SELECT ID_ FROM act_ru_execution WHERE SUPER_EXEC_=#{supperId}
</select>
<delete id="delTaskByByInstList">
delete FROM act_ru_task where PROC_INST_ID_
in <foreach collection="list" index="index" item="instId" open="(" separator="," close=")">
#{instId}
</foreach>
</delete>
<delete id="delCandidateByInstList">
delete FROM act_ru_identitylink where PROC_INST_ID_
in <foreach collection="list" index="index" item="instId" open="(" separator="," close=")">
#{instId}
</foreach>
</delete>
<delete id="delEventSubByInstList">
delete FROM act_ru_event_subscr where PROC_INST_ID_
in <foreach collection="list" index="index" item="instId" open="(" separator="," close=")">
#{instId}
</foreach>
</delete>
<delete id="delVarsByInstList">
delete FROM act_ru_variable where PROC_INST_ID_
in <foreach collection="list" index="index" item="instId" open="(" separator="," close=")">
#{instId}
</foreach>
</delete>
<delete id="delHiVarByInstList">
delete FROM act_hi_varinst where PROC_INST_ID_
in <foreach collection="list" index="index" item="instId" open="(" separator="," close=")">
#{instId}
</foreach>
</delete>
<delete id="delHiTaskByInstList">
delete FROM act_hi_taskinst where PROC_INST_ID_
in <foreach collection="list" index="index" item="instId" open="(" separator="," close=")">
#{instId}
</foreach>
</delete>
<delete id="delHiProcinstByInstList">
delete FROM act_hi_procinst where PROC_INST_ID_
in <foreach collection="list" index="index" item="instId" open="(" separator="," close=")">
#{instId}
</foreach>
</delete>
<delete id="delHiCandidateByInstList">
delete FROM act_hi_identitylink where PROC_INST_ID_
in <foreach collection="list" index="index" item="instId" open="(" separator="," close=")">
#{instId}
</foreach>
</delete>
<delete id="delHiActInstByInstList">
delete FROM act_hi_actinst where PROC_INST_ID_
in <foreach collection="list" index="index" item="instId" open="(" separator="," close=")">
#{instId}
</foreach>
</delete>
<delete id="delExectionByInstList">
delete FROM act_ru_execution where PROC_INST_ID_
in <foreach collection="list" index="index" item="instId" open="(" separator="," close=")">
#{instId}
</foreach>
</delete>
<!-- 撤回发起人 需要清除多实例任务相关的数据 如 会签, 同步的act_ru_variable ,act_ru_execution 数据 -->
<delete id="delActiveByInstList" >
delete FROM act_ru_execution where PROC_INST_ID_
in <foreach collection="list" index="index" item="instId" open="(" separator="," close=")">
#{instId}
</foreach>
AND ID_ != PARENT_ID_
</delete>
<delete id="delActiveVarsByInstList">
delete FROM act_ru_variable where execution_id_ in (
select id_ from act_ru_execution where PROC_INST_ID_
in <foreach collection="list" index="index" item="instId" open="(" separator="," close=")">
#{instId}
</foreach>
AND ID_ != PARENT_ID_
)
</delete>
<update id="updateRejectExecution" parameterType="com.hotent.bpm.persistence.model.ActExecution">
UPDATE act_ru_execution SET IS_SCOPE_ = 0,IS_ACTIVE_ = 0,ACT_ID_=#{actId},CACHED_ENT_STATE_=1 WHERE PARENT_ID_=#{parentId} AND ID_ != #{execId}
</update>
<update id="updateRejectExecution" databaseId="pg" parameterType="com.hotent.bpm.persistence.model.ActExecution">
UPDATE act_ru_execution SET IS_SCOPE_ = false,IS_ACTIVE_ = false,ACT_ID_=#{actId},CACHED_ENT_STATE_=1 WHERE PARENT_ID_=#{parentId} AND ID_ != #{execId}
</update>
<delete id="removeByParentIds">
delete FROM act_ru_execution where PARENT_ID_
in <foreach collection="parentIds" index="index" item="parentId" open="(" separator="," close=")">
#{parentId}
</foreach>
AND ID_ != PARENT_ID_
</delete>
<update id="updateRejectExecutionByProcInstIdAndNodeIds">
UPDATE act_ru_execution SET IS_SCOPE_ = 0,IS_ACTIVE_ = 0,CACHED_ENT_STATE_=1 WHERE PROC_INST_ID_=#{procInstId} AND ID_ not in
<foreach collection="execIds" item="execId" separator="," open="(" close=")">
#{execId}
</foreach>
and ACT_ID_ in
<foreach collection="parentUpdateNodeIds" item="nodeId" separator="," open="(" close=")">
#{nodeId}
</foreach>
</update>
<update id="updateRejectExecutionByProcInstIdAndNodeIds" databaseId="pg" >
UPDATE act_ru_execution SET IS_SCOPE_ = false,IS_ACTIVE_ = false,CACHED_ENT_STATE_=1 WHERE PROC_INST_ID_=#{procInstId} AND ID_ not in
<foreach collection="execIds" item="execId" separator="," open="(" close=")">
#{execId}
</foreach>
and ACT_ID_ in
<foreach collection="parentUpdateNodeIds" item="nodeId" separator="," open="(" close=")">
#{nodeId}
</foreach>
</update>
<select id="getRejectByProcInstId" resultMap="ActExecution">
select * from act_ru_execution where PROC_INST_ID_=#{procInstId}
</select>
<update id="updateActIdByIdAndActId">
UPDATE act_ru_execution SET ACT_ID_ = #{actId} WHERE ID_ = #{executionId}
</update>
<delete id="delVariableExcludeProcInstIdAndExecId">
delete from act_ru_variable where PROC_INST_ID_ = #{procInstId} and EXECUTION_ID_ != PROC_INST_ID_ and id_ != #{execId};
</delete>
<select id="getExecutionIdsByProcInstIdAndNodeIds" resultType="string" >
select id_ from act_ru_execution WHERE PROC_INST_ID_=#{procInstId}
<if test="@com.hotent.base.ognl.Ognl@isNotEmpty(execIds)">
AND ID_ not in
<foreach collection="execIds" item="execId" separator="," open="(" close=")">
#{execId}
</foreach>
</if>
and ACT_ID_ in
<foreach collection="parentUpdateNodeIds" item="nodeId" separator="," open="(" close=")">
#{nodeId}
</foreach>
</select>
<delete id="delVarsByExecutionIds">
delete from act_ru_variable where EXECUTION_ID_ in
<foreach collection="executionIds" item="executionId" separator="," open="(" close=")">
#{executionId}
</foreach>
</delete>
<delete id="delExecutionByExecutionIds">
delete from act_ru_execution where id_ in
<foreach collection="executionIds" item="executionId" separator="," open="(" close=")">
#{executionId}
</foreach>
</delete>
</mapper>