懒羊羊
2023-11-14 8286c62256f23bc2367a6729c0f46f84215e380b
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
<?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="cn.stylefeng.guns.workflow.modular.mapper.ProcessMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="cn.stylefeng.guns.workflow.modular.entity.Procdef">
        <id column="ID_" property="id"/>
        <result column="REV_" property="rev"/>
        <result column="CATEGORY_" property="category"/>
        <result column="NAME_" property="name"/>
        <result column="KEY_" property="key"/>
        <result column="VERSION_" property="version"/>
        <result column="DEPLOYMENT_ID_" property="deploymentId"/>
        <result column="RESOURCE_NAME_" property="resourceName"/>
        <result column="DGRM_RESOURCE_NAME_" property="dgrmResourceName"/>
        <result column="DESCRIPTION_" property="description"/>
        <result column="HAS_START_FORM_KEY_" property="hasStartFormKey"/>
        <result column="HAS_GRAPHICAL_NOTATION_" property="hasGraphicalNotation"/>
        <result column="SUSPENSION_STATE_" property="suspensionState"/>
        <result column="TENANT_ID_" property="tenantId"/>
        <result column="ENGINE_VERSION_" property="engineVersion"/>
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        ID_ AS "id", REV_ AS "rev", CATEGORY_ AS "category", NAME_ AS "name", KEY_ AS "key", VERSION_ AS "version", DEPLOYMENT_ID_ AS "deploymentId", RESOURCE_NAME_ AS "resourceName", DGRM_RESOURCE_NAME_ AS "dgrmResourceName", DESCRIPTION_ AS "description", HAS_START_FORM_KEY_ AS "hasStartFormKey", HAS_GRAPHICAL_NOTATION_ AS "hasGraphicalNotation", SUSPENSION_STATE_ AS "suspensionState", TENANT_ID_ AS "tenantId", ENGINE_VERSION_ AS "engineVersion"
    </sql>
 
    <!-- 激活or挂起任务(指定某个任务) -->
    <update id="onoffTask">
        update
        ACT_RU_TASK
        set
        SUSPENSION_STATE_ = #{status}
        where ID_ = #{id}
    </update>
 
    <update id="onoffTask" databaseId="mssql">
        update
        ACT_RU_TASK
        set
        SUSPENSION_STATE_ = #{status}
        where ID_ = #{id}
    </update>
 
    <update id="onoffTask" databaseId="pgsql">
        update
        ACT_RU_TASK
        set
        SUSPENSION_STATE_ = #{status}
        where ID_ = #{id}
    </update>
 
    <update id="onoffTask" databaseId="oracle">
        update
        ACT_RU_TASK
        set
        SUSPENSION_STATE_ = #{status}
        where ID_ = #{id}
    </update>
 
    <!-- 激活or挂起任务(指定某个流程的所有任务) -->
    <update id="onoffAllTask">
        update
        ACT_RU_TASK
        set
        SUSPENSION_STATE_ = #{status}
        where PROC_DEF_ID_ = #{id}
    </update>
 
    <update id="onoffAllTask" databaseId="mssql">
        update
        ACT_RU_TASK
        set
        SUSPENSION_STATE_ = #{status}
        where PROC_DEF_ID_ = #{id}
    </update>
 
    <update id="onoffAllTask" databaseId="pgsql">
        update
        ACT_RU_TASK
        set
        SUSPENSION_STATE_ = #{status}
        where PROC_DEF_ID_ = #{id}
    </update>
 
    <update id="onoffAllTask" databaseId="oracle">
        update
        ACT_RU_TASK
        set
        SUSPENSION_STATE_ = #{status}
        where PROC_DEF_ID_ = #{id}
    </update>
 
    <select id="customList" resultType="cn.stylefeng.guns.workflow.modular.model.result.ProcdefResult" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ProcdefParam">
        select
        <include refid="Base_Column_List"/>
        from act_re_procdef where 1 = 1
        <if test="paramCondition.name != null and paramCondition.name != ''">
            and NAME_ like CONCAT('%',#{paramCondition.name},'%')
        </if>
    </select>
 
    <select id="customList" resultType="cn.stylefeng.guns.workflow.modular.model.result.ProcdefResult"
            parameterType="cn.stylefeng.guns.workflow.modular.model.params.ProcdefParam" databaseId="mssql">
        select
        <include refid="Base_Column_List"/>
        from act_re_procdef where 1 = 1
        <if test="paramCondition.name != null and paramCondition.name != ''">
            and NAME_ like CONCAT('%',#{paramCondition.name},'%')
        </if>
    </select>
 
    <select id="customList" resultType="cn.stylefeng.guns.workflow.modular.model.result.ProcdefResult"
            parameterType="cn.stylefeng.guns.workflow.modular.model.params.ProcdefParam" databaseId="pgsql">
        select
        <include refid="Base_Column_List"/>
        from act_re_procdef where 1 = 1
        <if test="paramCondition.name != null and paramCondition.name != ''">
            and NAME_ like '%' || #{paramCondition.name} || '%'
        </if>
    </select>
 
    <select id="customList" resultType="cn.stylefeng.guns.workflow.modular.model.result.ProcdefResult"
            parameterType="cn.stylefeng.guns.workflow.modular.model.params.ProcdefParam" databaseId="oracle">
        select
        <include refid="Base_Column_List"/>
        from act_re_procdef where 1 = 1
        <if test="paramCondition.name != null and paramCondition.name != ''">
            and NAME_ like '%' || #{paramCondition.name} || '%'
        </if>
    </select>
 
    <select id="customMapList" resultType="map" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ProcdefParam">
        select
        <include refid="Base_Column_List"/>
        from act_re_procdef where 1 = 1
        <if test="paramCondition.name != null and paramCondition.name != ''">
            and NAME_ like CONCAT('%',#{paramCondition.name},'%')
        </if>
    </select>
 
    <select id="customMapList" resultType="map" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ProcdefParam" databaseId="mssql">
        select
        <include refid="Base_Column_List"/>
        from act_re_procdef where 1 = 1
        <if test="paramCondition.name != null and paramCondition.name != ''">
            and NAME_ like CONCAT('%',#{paramCondition.name},'%')
        </if>
    </select>
 
    <select id="customMapList" resultType="map" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ProcdefParam" databaseId="pgsql">
        select
        <include refid="Base_Column_List"/>
        from act_re_procdef where 1 = 1
        <if test="paramCondition.name != null and paramCondition.name != ''">
            and NAME_ like '%' || #{paramCondition.name} || '%'
        </if>
    </select>
 
    <select id="customMapList" resultType="map" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ProcdefParam" databaseId="oracle">
        select
        <include refid="Base_Column_List"/>
        from act_re_procdef where 1 = 1
        <if test="paramCondition.name != null and paramCondition.name != ''">
            and NAME_ like '%' || #{paramCondition.name} || '%'
        </if>
    </select>
 
    <select id="customPageList" resultType="cn.stylefeng.guns.workflow.modular.model.result.ProcdefResult" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ProcdefParam">
        select
        p.ID_ AS "id", p.CATEGORY_ AS "category", p.NAME_ AS "name", p.KEY_ AS "key", p.VERSION_ AS "version", p.DEPLOYMENT_ID_ AS "deploymentId",
        p.RESOURCE_NAME_ AS "resourceName", p.DGRM_RESOURCE_NAME_ AS "dgrmResourceName", DESCRIPTION_ AS "description", p.SUSPENSION_STATE_ AS "suspensionState",
        d.DEPLOY_TIME_ as deployTime
        from act_re_procdef p
        left join
        ACT_RE_DEPLOYMENT d
        on p.DEPLOYMENT_ID_ = d.ID_
        where 1=1
        <if test="paramCondition.keywords!= null and paramCondition.keywords != ''"><!-- 关键词检索 -->
            and
            (
            p.NAME_ LIKE CONCAT(CONCAT('%', #{paramCondition.keywords}),'%')
            )
        </if>
        <if test="paramCondition.lastStart != null and paramCondition.lastStart != ''"><!-- 开始时间检索 -->
            and d.DEPLOY_TIME_ &gt;= #{paramCondition.lastStart}
        </if>
        <if test="paramCondition.lastEnd != null and paramCondition.lastEnd != ''"><!-- 结束时间检索 -->
            and d.DEPLOY_TIME_ &lt;= #{paramCondition.lastEnd}
        </if>
        order by d.DEPLOY_TIME_ desc
    </select>
 
    <select id="customPageList" resultType="cn.stylefeng.guns.workflow.modular.model.result.ProcdefResult"
            parameterType="cn.stylefeng.guns.workflow.modular.model.params.ProcdefParam" databaseId="mssql">
        select
        p.ID_ AS "id", p.CATEGORY_ AS "category", p.NAME_ AS "name", p.KEY_ AS "key", p.VERSION_ AS "version", p.DEPLOYMENT_ID_ AS "deploymentId",
        p.RESOURCE_NAME_ AS "resourceName", p.DGRM_RESOURCE_NAME_ AS "dgrmResourceName", DESCRIPTION_ AS "description", p.SUSPENSION_STATE_ AS "suspensionState",
        d.DEPLOY_TIME_ as deployTime
        from act_re_procdef p
        left join
        ACT_RE_DEPLOYMENT d
        on p.DEPLOYMENT_ID_ = d.ID_
        where 1=1
        <if test="paramCondition.keywords!= null and paramCondition.keywords != ''"><!-- 关键词检索 -->
            and
            (
            p.NAME_ LIKE CONCAT(CONCAT('%', #{paramCondition.keywords}),'%')
            )
        </if>
        <if test="paramCondition.lastStart != null and paramCondition.lastStart != ''"><!-- 开始时间检索 -->
            and d.DEPLOY_TIME_ &gt;= #{paramCondition.lastStart}
        </if>
        <if test="paramCondition.lastEnd != null and paramCondition.lastEnd != ''"><!-- 结束时间检索 -->
            and d.DEPLOY_TIME_ &lt;= #{paramCondition.lastEnd}
        </if>
        order by d.DEPLOY_TIME_ desc
    </select>
 
    <select id="customPageList" resultType="cn.stylefeng.guns.workflow.modular.model.result.ProcdefResult"
            parameterType="cn.stylefeng.guns.workflow.modular.model.params.ProcdefParam" databaseId="pgsql">
        select
        p.ID_ AS "id", p.CATEGORY_ AS "category", p.NAME_ AS "name", p.KEY_ AS "key", p.VERSION_ AS "version", p.DEPLOYMENT_ID_ AS "deploymentId",
        p.RESOURCE_NAME_ AS "resourceName", p.DGRM_RESOURCE_NAME_ AS "dgrmResourceName", DESCRIPTION_ AS "description", p.SUSPENSION_STATE_ AS "suspensionState",
        d.DEPLOY_TIME_ as deployTime
        from act_re_procdef p
        left join
        ACT_RE_DEPLOYMENT d
        on p.DEPLOYMENT_ID_ = d.ID_
        where 1=1
        <if test="paramCondition.keywords!= null and paramCondition.keywords != ''"><!-- 关键词检索 -->
            and
            (
            p.NAME_ LIKE '%' || #{paramCondition.keywords} || '%'
            )
        </if>
        <if test="paramCondition.lastStart != null and paramCondition.lastStart != ''"><!-- 开始时间检索 -->
            and d.DEPLOY_TIME_ &gt;= to_timestamp(#{paramCondition.lastStart}||'00:00:00','yyyy-mm-dd hh24:mi:ss')
        </if>
        <if test="paramCondition.lastEnd != null and paramCondition.lastEnd != ''"><!-- 结束时间检索 -->
            and d.DEPLOY_TIME_ &lt;= to_timestamp(#{paramCondition.lastEnd}||'23:59:59','yyyy-mm-dd hh24:mi:ss')
        </if>
        order by d.DEPLOY_TIME_ desc
    </select>
 
    <select id="customPageList" resultType="cn.stylefeng.guns.workflow.modular.model.result.ProcdefResult"
            parameterType="cn.stylefeng.guns.workflow.modular.model.params.ProcdefParam" databaseId="oracle">
        select
        p.ID_ AS "id", p.CATEGORY_ AS "category", p.NAME_ AS "name", p.KEY_ AS "key", p.VERSION_ AS "version", p.DEPLOYMENT_ID_ AS "deploymentId",
        p.RESOURCE_NAME_ AS "resourceName", p.DGRM_RESOURCE_NAME_ AS "dgrmResourceName", DESCRIPTION_ AS "description", p.SUSPENSION_STATE_ AS "suspensionState",
        d.DEPLOY_TIME_ as deployTime
        from act_re_procdef p
        left join
        ACT_RE_DEPLOYMENT d
        on p.DEPLOYMENT_ID_ = d.ID_
        where 1=1
        <if test="paramCondition.keywords!= null and paramCondition.keywords != ''"><!-- 关键词检索 -->
            and
            (
            p.NAME_ LIKE '%' || #{paramCondition.keywords} || '%'
            )
        </if>
        <if test="paramCondition.lastStart != null and paramCondition.lastStart != ''"><!-- 开始时间检索 -->
            and d.DEPLOY_TIME_ &gt;= to_date(#{paramCondition.lastStart}||'00:00:00','yyyy-mm-dd hh24:mi:ss')
        </if>
        <if test="paramCondition.lastEnd != null and paramCondition.lastEnd != ''"><!-- 结束时间检索 -->
            and d.DEPLOY_TIME_ &lt;= to_date(#{paramCondition.lastEnd}||'23:59:59','yyyy-mm-dd hh24:mi:ss')
        </if>
        order by d.DEPLOY_TIME_ desc
    </select>
 
    <select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ProcdefParam">
        select
        <include refid="Base_Column_List"/>
        from act_re_procdef where 1 = 1
        <if test="paramCondition.name != null and paramCondition.name != ''">
            and NAME_ like CONCAT('%',#{paramCondition.name},'%')
        </if>
    </select>
 
    <select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ProcdefParam" databaseId="mssql">
        select
        <include refid="Base_Column_List"/>
        from act_re_procdef where 1 = 1
        <if test="paramCondition.name != null and paramCondition.name != ''">
            and NAME_ like CONCAT('%',#{paramCondition.name},'%')
        </if>
    </select>
 
    <select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ProcdefParam" databaseId="pgsql">
        select
        <include refid="Base_Column_List"/>
        from act_re_procdef where 1 = 1
        <if test="paramCondition.name != null and paramCondition.name != ''">
            and NAME_ like '%' || #{paramCondition.name} || '%'
        </if>
    </select>
 
    <select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ProcdefParam" databaseId="oracle">
        select
        <include refid="Base_Column_List"/>
        from act_re_procdef where 1 = 1
        <if test="paramCondition.name != null and paramCondition.name != ''">
            and NAME_ like '%' || #{paramCondition.name} || '%'
        </if>
    </select>
 
    <!-- ACT_RU_VARIABLE -->
    <sql id="arv">
      ID_ AS "id_",
      REV_ AS "rev_",
      TYPE_ AS "type_",
      NAME_ AS "name_",
      EXECUTION_ID_ AS "execution_id_",
      PROC_INST_ID_ AS "proc_inst_id_",
      TASK_ID_ AS "task_id_",
      BYTEARRAY_ID_ AS "bytearray_id_",
      DOUBLE_ AS "double_",
      LONG_ AS "long_",
      TEXT_ AS "text_",
      TEXT2_ AS "text2_"
    </sql>
    <!-- ACT_HI_ACTINST -->
    <sql id="ht">
      ht.ID_ AS "id_",
      ht.PROC_DEF_ID_ AS "proc_def_id_",
      ht.PROC_INST_ID_ AS "proc_inst_id_",
      ht.EXECUTION_ID_ AS "execution_id_",
      ht.ACT_ID_ AS "act_id_",
      ht.TASK_ID_ AS "task_id_",
      ht.CALL_PROC_INST_ID_ AS "call_proc_inst_id_",
      ht.ACT_NAME_ AS "act_name_",
      ht.ACT_TYPE_ AS "act_type_",
      ht.ASSIGNEE_ AS "assignee_",
      ht.START_TIME_ AS "start_time_",
      ht.END_TIME_ AS "end_time_",
      ht.DURATION_ AS "duration_",
      ht.DELETE_REASON_ AS "delete_reason_",
      ht.TENANT_ID_ AS "tenant_id_"
    </sql>
    <!-- 流程变量列表 -->
    <select id="varList" resultType="map">
        select
        <include refid="arv"/>
        from
        ACT_RU_VARIABLE
        where 1=1
        <if test="_parameter != null and _parameter != ''"><!-- 流程实例ID -->
            and PROC_INST_ID_ = #{procInstId}
            and TASK_ID_ is NULL
        </if>
    </select>
 
    <select id="varList" resultType="map" databaseId="mssql">
        select
        <include refid="arv"/>
        from
        ACT_RU_VARIABLE
        where 1=1
        <if test="_parameter != null and _parameter != ''"><!-- 流程实例ID -->
            and PROC_INST_ID_ = #{procInstId}
            and TASK_ID_ is NULL
        </if>
    </select>
 
    <select id="varList" resultType="map" databaseId="pgsql">
        select
        <include refid="arv"/>
        from
        ACT_RU_VARIABLE
        where 1=1
        <if test="_parameter != null and _parameter != ''"><!-- 流程实例ID -->
            and PROC_INST_ID_ = #{procInstId}
            and TASK_ID_ is NULL
        </if>
    </select>
 
    <select id="varList" resultType="map" databaseId="oracle">
        select
        <include refid="arv"/>
        from
        ACT_RU_VARIABLE
        where 1=1
        <if test="_parameter != null and _parameter != ''"><!-- 流程实例ID -->
            and PROC_INST_ID_ = #{procInstId}
            and TASK_ID_ is NULL
        </if>
    </select>
 
    <!-- 历史任务节点列表关联历史流程变量表 -->
    <select id="historyTaskList" resultType="map">
        select
        <include refid="ht"/>
        ,
        hv.TEXT_ text_
        from
        ACT_HI_ACTINST ht
        left join
        ACT_HI_VARINST hv
        on ht.TASK_ID_ = hv.TASK_ID_
        where 1=1
        <if test="_parameter != null and _parameter != ''"><!-- 流程实例ID -->
            and ht.PROC_INST_ID_ = #{procInstId}
        </if>
        order by ht.ID_
    </select>
 
    <select id="historyTaskList" resultType="map" databaseId="mssql">
        select
        <include refid="ht"/>
        ,
        hv.TEXT_ text_
        from
        ACT_HI_ACTINST ht
        left join
        ACT_HI_VARINST hv
        on ht.TASK_ID_ = hv.TASK_ID_
        where 1=1
        <if test="_parameter != null and _parameter != ''"><!-- 流程实例ID -->
            and ht.PROC_INST_ID_ = #{procInstId}
        </if>
        order by ht.ID_
    </select>
 
    <select id="historyTaskList" resultType="map" databaseId="pgsql">
        select
        <include refid="ht"/>
        ,
        hv.TEXT_ text_
        from
        ACT_HI_ACTINST ht
        left join
        ACT_HI_VARINST hv
        on ht.TASK_ID_ = hv.TASK_ID_
        where 1=1
        <if test="_parameter != null and _parameter != ''"><!-- 流程实例ID -->
            and ht.PROC_INST_ID_ = #{procInstId}
        </if>
        order by ht.ID_
    </select>
 
    <select id="historyTaskList" resultType="map" databaseId="oracle">
        select
        <include refid="ht"/>
        ,
        hv.TEXT_ as "text_"
        from
        ACT_HI_ACTINST ht
        left join
        ACT_HI_VARINST hv
        on ht.TASK_ID_ = hv.TASK_ID_
        where 1=1
        <if test="_parameter != null and _parameter != ''"><!-- 流程实例ID -->
            and ht.PROC_INST_ID_ = #{procInstId}
        </if>
        order by ht.ID_
    </select>
 
    <!--ACT_HI_VARINST-->
    <sql id="ahv">
      ID_ AS "id_",
      PROC_INST_ID_ AS "proc_inst_id_",
      EXECUTION_ID_ AS "execution_id_",
      TASK_ID_ AS "task_id_",
      NAME_ AS "name_",
      VAR_TYPE_ AS "var_type_",
      REV_ AS "REV_",
      BYTEARRAY_ID_ AS "bytearray_id_",
      DOUBLE_ AS "double_",
      LONG_ AS "long_",
      TEXT_ AS "text_",
      TEXT2_ AS "text2_",
      CREATE_TIME_ AS "create_time_",
      LAST_UPDATED_TIME_  AS "last_updated_time_"
    </sql>
    <!-- 历史流程变量列表 -->
    <select id="historyVariableList" resultType="map">
        select
        <include refid="ahv"/>
        from
        ACT_HI_VARINST
        where 1=1
        <if test="_parameter != null and _parameter != ''"><!-- 流程实例ID -->
            and PROC_INST_ID_ = #{procInstId}
            and TASK_ID_ is NULL
        </if>
    </select>
 
    <select id="historyVariableList" resultType="map" databaseId="mssql">
        select
        <include refid="ahv"/>
        from
        ACT_HI_VARINST
        where 1=1
        <if test="_parameter != null and _parameter != ''"><!-- 流程实例ID -->
            and PROC_INST_ID_ = #{procInstId}
            and TASK_ID_ is NULL
        </if>
    </select>
 
    <select id="historyVariableList" resultType="map" databaseId="pgsql">
        select
        <include refid="ahv"/>
        from
        ACT_HI_VARINST
        where 1=1
        <if test="_parameter != null and _parameter != ''"><!-- 流程实例ID -->
            and PROC_INST_ID_ = #{procInstId}
            and TASK_ID_ is NULL
        </if>
    </select>
 
    <select id="historyVariableList" resultType="map" databaseId="oracle">
        select
        <include refid="ahv"/>
        from
        ACT_HI_VARINST
        where 1=1
        <if test="_parameter != null and _parameter != ''"><!-- 流程实例ID -->
            and PROC_INST_ID_ = #{procInstId}
            and TASK_ID_ is NULL
        </if>
    </select>
 
</mapper>