xiangpei
2024-11-22 c8bc73954b11b40cc62945099a4f7ca1a73154a1
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
203
204
205
206
207
208
209
210
211
212
213
<?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.ycl.mapper.ActRuExecutionMapper">
 
    <resultMap type="ActRuExecution" id="ActRuExecutionResult">
        <result property="id"    column="ID_"    />
        <result property="rev"    column="REV_"    />
        <result property="procInstId"    column="PROC_INST_ID_"    />
        <result property="businessKey"    column="BUSINESS_KEY_"    />
        <result property="parentId"    column="PARENT_ID_"    />
        <result property="procDefId"    column="PROC_DEF_ID_"    />
        <result property="superExec"    column="SUPER_EXEC_"    />
        <result property="rootProcInstId"    column="ROOT_PROC_INST_ID_"    />
        <result property="actId"    column="ACT_ID_"    />
        <result property="isActive"    column="IS_ACTIVE_"    />
        <result property="isConcurrent"    column="IS_CONCURRENT_"    />
        <result property="isScope"    column="IS_SCOPE_"    />
        <result property="isEventScope"    column="IS_EVENT_SCOPE_"    />
        <result property="isMiRoot"    column="IS_MI_ROOT_"    />
        <result property="suspensionState"    column="SUSPENSION_STATE_"    />
        <result property="cachedEntState"    column="CACHED_ENT_STATE_"    />
        <result property="tenantId"    column="TENANT_ID_"    />
        <result property="name"    column="NAME_"    />
        <result property="startTime"    column="START_TIME_"    />
        <result property="startUserId"    column="START_USER_ID_"    />
        <result property="lockTime"    column="LOCK_TIME_"    />
        <result property="isCountEnabled"    column="IS_COUNT_ENABLED_"    />
        <result property="evtSubscrCount"    column="EVT_SUBSCR_COUNT_"    />
        <result property="taskCount"    column="TASK_COUNT_"    />
        <result property="jobCount"    column="JOB_COUNT_"    />
        <result property="timerJobCount"    column="TIMER_JOB_COUNT_"    />
        <result property="suspJobCount"    column="SUSP_JOB_COUNT_"    />
        <result property="deadletterJobCount"    column="DEADLETTER_JOB_COUNT_"    />
        <result property="varCount"    column="VAR_COUNT_"    />
        <result property="idLinkCount"    column="ID_LINK_COUNT_"    />
    </resultMap>
 
    <sql id="selectActRuExecutionVo">
        select ID_, REV_, PROC_INST_ID_, BUSINESS_KEY_, PARENT_ID_, PROC_DEF_ID_, SUPER_EXEC_, ROOT_PROC_INST_ID_, ACT_ID_, IS_ACTIVE_, IS_CONCURRENT_, IS_SCOPE_, IS_EVENT_SCOPE_, IS_MI_ROOT_, SUSPENSION_STATE_, CACHED_ENT_STATE_, TENANT_ID_, NAME_, START_TIME_, START_USER_ID_, LOCK_TIME_, IS_COUNT_ENABLED_, EVT_SUBSCR_COUNT_, TASK_COUNT_, JOB_COUNT_, TIMER_JOB_COUNT_, SUSP_JOB_COUNT_, DEADLETTER_JOB_COUNT_, VAR_COUNT_, ID_LINK_COUNT_ from act_ru_execution
    </sql>
 
    <select id="selectActRuExecutionList" parameterType="ActRuExecution" resultMap="ActRuExecutionResult">
        <include refid="selectActRuExecutionVo"/>
        <where>
            <if test="rev != null "> and REV_ = #{rev}</if>
            <if test="procInstId != null  and procInstId != ''"> and PROC_INST_ID_ = #{procInstId}</if>
            <if test="businessKey != null  and businessKey != ''"> and BUSINESS_KEY_ = #{businessKey}</if>
            <if test="parentId != null  and parentId != ''"> and PARENT_ID_ = #{parentId}</if>
            <if test="procDefId != null  and procDefId != ''"> and PROC_DEF_ID_ = #{procDefId}</if>
            <if test="superExec != null  and superExec != ''"> and SUPER_EXEC_ = #{superExec}</if>
            <if test="rootProcInstId != null  and rootProcInstId != ''"> and ROOT_PROC_INST_ID_ = #{rootProcInstId}</if>
            <if test="actId != null  and actId != ''"> and ACT_ID_ = #{actId}</if>
            <if test="isActive != null "> and IS_ACTIVE_ = #{isActive}</if>
            <if test="isConcurrent != null "> and IS_CONCURRENT_ = #{isConcurrent}</if>
            <if test="isScope != null "> and IS_SCOPE_ = #{isScope}</if>
            <if test="isEventScope != null "> and IS_EVENT_SCOPE_ = #{isEventScope}</if>
            <if test="isMiRoot != null "> and IS_MI_ROOT_ = #{isMiRoot}</if>
            <if test="suspensionState != null "> and SUSPENSION_STATE_ = #{suspensionState}</if>
            <if test="cachedEntState != null "> and CACHED_ENT_STATE_ = #{cachedEntState}</if>
            <if test="tenantId != null  and tenantId != ''"> and TENANT_ID_ = #{tenantId}</if>
            <if test="name != null  and name != ''"> and NAME_ = #{name}</if>
            <if test="startTime != null "> and START_TIME_ = #{startTime}</if>
            <if test="startUserId != null  and startUserId != ''"> and START_USER_ID_ = #{startUserId}</if>
            <if test="lockTime != null "> and LOCK_TIME_ = #{lockTime}</if>
            <if test="isCountEnabled != null "> and IS_COUNT_ENABLED_ = #{isCountEnabled}</if>
            <if test="evtSubscrCount != null "> and EVT_SUBSCR_COUNT_ = #{evtSubscrCount}</if>
            <if test="taskCount != null "> and TASK_COUNT_ = #{taskCount}</if>
            <if test="jobCount != null "> and JOB_COUNT_ = #{jobCount}</if>
            <if test="timerJobCount != null "> and TIMER_JOB_COUNT_ = #{timerJobCount}</if>
            <if test="suspJobCount != null "> and SUSP_JOB_COUNT_ = #{suspJobCount}</if>
            <if test="deadletterJobCount != null "> and DEADLETTER_JOB_COUNT_ = #{deadletterJobCount}</if>
            <if test="varCount != null "> and VAR_COUNT_ = #{varCount}</if>
            <if test="idLinkCount != null "> and ID_LINK_COUNT_ = #{idLinkCount}</if>
        </where>
    </select>
 
    <select id="selectActRuExecutionListByProcessName" resultMap="ActRuExecutionResult">
        SELECT
            act_ru_execution.*
        FROM
            act_ru_execution
                LEFT JOIN act_re_procdef ON act_ru_execution.PROC_DEF_ID_ = act_re_procdef.ID_
        WHERE
            1=1
        <if test="name != null ">
            and act_re_procdef.NAME_ = #{name}
        </if>
        order by proc_inst_id_
    </select>
 
    <select id="selectActRuExecutionById" parameterType="String" resultMap="ActRuExecutionResult">
        <include refid="selectActRuExecutionVo"/>
        where ID_ = #{id}
    </select>
 
    <insert id="insertActRuExecution" parameterType="ActRuExecution">
        insert into act_ru_execution
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">ID_,</if>
            <if test="rev != null">REV_,</if>
            <if test="procInstId != null">PROC_INST_ID_,</if>
            <if test="businessKey != null">BUSINESS_KEY_,</if>
            <if test="parentId != null">PARENT_ID_,</if>
            <if test="procDefId != null">PROC_DEF_ID_,</if>
            <if test="superExec != null">SUPER_EXEC_,</if>
            <if test="rootProcInstId != null">ROOT_PROC_INST_ID_,</if>
            <if test="actId != null">ACT_ID_,</if>
            <if test="isActive != null">IS_ACTIVE_,</if>
            <if test="isConcurrent != null">IS_CONCURRENT_,</if>
            <if test="isScope != null">IS_SCOPE_,</if>
            <if test="isEventScope != null">IS_EVENT_SCOPE_,</if>
            <if test="isMiRoot != null">IS_MI_ROOT_,</if>
            <if test="suspensionState != null">SUSPENSION_STATE_,</if>
            <if test="cachedEntState != null">CACHED_ENT_STATE_,</if>
            <if test="tenantId != null">TENANT_ID_,</if>
            <if test="name != null">NAME_,</if>
            <if test="startTime != null">START_TIME_,</if>
            <if test="startUserId != null">START_USER_ID_,</if>
            <if test="lockTime != null">LOCK_TIME_,</if>
            <if test="isCountEnabled != null">IS_COUNT_ENABLED_,</if>
            <if test="evtSubscrCount != null">EVT_SUBSCR_COUNT_,</if>
            <if test="taskCount != null">TASK_COUNT_,</if>
            <if test="jobCount != null">JOB_COUNT_,</if>
            <if test="timerJobCount != null">TIMER_JOB_COUNT_,</if>
            <if test="suspJobCount != null">SUSP_JOB_COUNT_,</if>
            <if test="deadletterJobCount != null">DEADLETTER_JOB_COUNT_,</if>
            <if test="varCount != null">VAR_COUNT_,</if>
            <if test="idLinkCount != null">ID_LINK_COUNT_,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="rev != null">#{rev},</if>
            <if test="procInstId != null">#{procInstId},</if>
            <if test="businessKey != null">#{businessKey},</if>
            <if test="parentId != null">#{parentId},</if>
            <if test="procDefId != null">#{procDefId},</if>
            <if test="superExec != null">#{superExec},</if>
            <if test="rootProcInstId != null">#{rootProcInstId},</if>
            <if test="actId != null">#{actId},</if>
            <if test="isActive != null">#{isActive},</if>
            <if test="isConcurrent != null">#{isConcurrent},</if>
            <if test="isScope != null">#{isScope},</if>
            <if test="isEventScope != null">#{isEventScope},</if>
            <if test="isMiRoot != null">#{isMiRoot},</if>
            <if test="suspensionState != null">#{suspensionState},</if>
            <if test="cachedEntState != null">#{cachedEntState},</if>
            <if test="tenantId != null">#{tenantId},</if>
            <if test="name != null">#{name},</if>
            <if test="startTime != null">#{startTime},</if>
            <if test="startUserId != null">#{startUserId},</if>
            <if test="lockTime != null">#{lockTime},</if>
            <if test="isCountEnabled != null">#{isCountEnabled},</if>
            <if test="evtSubscrCount != null">#{evtSubscrCount},</if>
            <if test="taskCount != null">#{taskCount},</if>
            <if test="jobCount != null">#{jobCount},</if>
            <if test="timerJobCount != null">#{timerJobCount},</if>
            <if test="suspJobCount != null">#{suspJobCount},</if>
            <if test="deadletterJobCount != null">#{deadletterJobCount},</if>
            <if test="varCount != null">#{varCount},</if>
            <if test="idLinkCount != null">#{idLinkCount},</if>
         </trim>
    </insert>
 
    <update id="updateActRuExecution" parameterType="ActRuExecution">
        update act_ru_execution
        <trim prefix="SET" suffixOverrides=",">
            <if test="rev != null">REV_ = #{rev},</if>
            <if test="procInstId != null">PROC_INST_ID_ = #{procInstId},</if>
            <if test="businessKey != null">BUSINESS_KEY_ = #{businessKey},</if>
            <if test="parentId != null">PARENT_ID_ = #{parentId},</if>
            <if test="procDefId != null">PROC_DEF_ID_ = #{procDefId},</if>
            <if test="superExec != null">SUPER_EXEC_ = #{superExec},</if>
            <if test="rootProcInstId != null">ROOT_PROC_INST_ID_ = #{rootProcInstId},</if>
            <if test="actId != null">ACT_ID_ = #{actId},</if>
            <if test="isActive != null">IS_ACTIVE_ = #{isActive},</if>
            <if test="isConcurrent != null">IS_CONCURRENT_ = #{isConcurrent},</if>
            <if test="isScope != null">IS_SCOPE_ = #{isScope},</if>
            <if test="isEventScope != null">IS_EVENT_SCOPE_ = #{isEventScope},</if>
            <if test="isMiRoot != null">IS_MI_ROOT_ = #{isMiRoot},</if>
            <if test="suspensionState != null">SUSPENSION_STATE_ = #{suspensionState},</if>
            <if test="cachedEntState != null">CACHED_ENT_STATE_ = #{cachedEntState},</if>
            <if test="tenantId != null">TENANT_ID_ = #{tenantId},</if>
            <if test="name != null">NAME_ = #{name},</if>
            <if test="startTime != null">START_TIME_ = #{startTime},</if>
            <if test="startUserId != null">START_USER_ID_ = #{startUserId},</if>
            <if test="lockTime != null">LOCK_TIME_ = #{lockTime},</if>
            <if test="isCountEnabled != null">IS_COUNT_ENABLED_ = #{isCountEnabled},</if>
            <if test="evtSubscrCount != null">EVT_SUBSCR_COUNT_ = #{evtSubscrCount},</if>
            <if test="taskCount != null">TASK_COUNT_ = #{taskCount},</if>
            <if test="jobCount != null">JOB_COUNT_ = #{jobCount},</if>
            <if test="timerJobCount != null">TIMER_JOB_COUNT_ = #{timerJobCount},</if>
            <if test="suspJobCount != null">SUSP_JOB_COUNT_ = #{suspJobCount},</if>
            <if test="deadletterJobCount != null">DEADLETTER_JOB_COUNT_ = #{deadletterJobCount},</if>
            <if test="varCount != null">VAR_COUNT_ = #{varCount},</if>
            <if test="idLinkCount != null">ID_LINK_COUNT_ = #{idLinkCount},</if>
        </trim>
        where ID_ = #{id}
    </update>
 
    <delete id="deleteActRuExecutionById" parameterType="String">
        delete from act_ru_execution where ID_ = #{id}
    </delete>
 
    <delete id="deleteActRuExecutionByIds" parameterType="String">
        delete from act_ru_execution where ID_ in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
 
</mapper>