懒羊羊
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
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
<?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.TaskRunningMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="cn.stylefeng.guns.workflow.modular.entity.RuTask">
        <id column="ID_" property="id"/>
        <result column="REV_" property="rev"/>
        <result column="EXECUTION_ID_" property="executionId"/>
        <result column="PROC_INST_ID_" property="procInstId"/>
        <result column="PROC_DEF_ID_" property="procDefId"/>
        <result column="NAME_" property="name"/>
        <result column="PARENT_TASK_ID_" property="parentTaskId"/>
        <result column="DESCRIPTION_" property="description"/>
        <result column="TASK_DEF_KEY_" property="taskDefKey"/>
        <result column="OWNER_" property="owner"/>
        <result column="ASSIGNEE_" property="assignee"/>
        <result column="DELEGATION_" property="delegation"/>
        <result column="PRIORITY_" property="priority"/>
        <result column="CREATE_TIME_" property="createTime"/>
        <result column="DUE_DATE_" property="dueDate"/>
        <result column="CATEGORY_" property="category"/>
        <result column="SUSPENSION_STATE_" property="suspensionState"/>
        <result column="TENANT_ID_" property="tenantId"/>
        <result column="FORM_KEY_" property="formKey"/>
        <result column="CLAIM_TIME_" property="claimTime"/>
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        ID_ AS "id", REV_ AS "rev", EXECUTION_ID_ AS "executionId", PROC_INST_ID_ AS "procInstId", PROC_DEF_ID_ AS "procDefId", NAME_ AS "name", PARENT_TASK_ID_ AS "parentTaskId", DESCRIPTION_ AS "description", TASK_DEF_KEY_ AS "taskDefKey", OWNER_ AS "owner", ASSIGNEE_ AS "assignee", DELEGATION_ AS "delegation", PRIORITY_ AS "priority", CREATE_TIME_ AS "createTime", DUE_DATE_ AS "dueDate", CATEGORY_ AS "category", SUSPENSION_STATE_ AS "suspensionState", TENANT_ID_ AS "tenantId", FORM_KEY_ AS "formKey", CLAIM_TIME_ AS "claimTime"
    </sql>
 
    <!-- ACT_HI_TASKINST -->
    <sql id="n">
      ID_ AS "id_",
      PROC_DEF_ID_ AS "proc_def_id_",
      TASK_DEF_KEY_ AS "task_def_key_",
      PROC_INST_ID_ AS "proc_inst_id_",
      EXECUTION_ID_ AS "execution_id_",
      NAME_ AS "name_",
      PARENT_TASK_ID_ AS "parent_task_id_",
      DESCRIPTION_ AS "description_",
      OWNER_ AS "owner_",
      ASSIGNEE_ AS "assignee_",
      START_TIME_ AS "start_time_",
      CLAIM_TIME_ AS "claim_time_",
      END_TIME_ AS "end_time_",
      DURATION_ AS "duration_",
      DELETE_REASON_ AS "delete_reason_",
      PRIORITY_ AS "priority_",
      DUE_DATE_ AS "due_date_",
      FORM_KEY_ AS "form_key_",
      CATEGORY_ AS "category_",
      TENANT_ID_ AS "tenant_id_"
    </sql>
 
    <select id="hitasklist" resultType="map">
        select
        f.*,
        p.NAME_ pname_ ,
        p.DEPLOYMENT_ID_ deployment_id_,
        p.DGRM_RESOURCE_NAME_ dgrm_resource_name_
        from
        (
        select
        <include refid="n"/>
        from ACT_HI_TASKINST n
        where (
        n.ASSIGNEE_ = #{pd.username}
        or
        n.ASSIGNEE_ in ${pd.rnumbers}
        )
        group by n.EXECUTION_ID_
 
        ) f
        left join
        ACT_RE_PROCDEF p
        on f.PROC_DEF_ID_ = p.ID_
        where 1=1
        <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 -->
            and
            (
            p.NAME_ LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%')
            or
            f.NAME_ LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%')
            or
            f.ASSIGNEE_ LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%')
            )
        </if>
        <if test="pd.lastStart != null and pd.lastStart != ''"><!-- 开始时间检索 -->
            and f.END_TIME_ &gt;= CONCAT(#{pd.lastStart},' 00:00:00')
        </if>
        <if test="pd.lastEnd != null and pd.lastEnd != ''"><!-- 结束时间检索 -->
            and f.END_TIME_ &lt;= CONCAT(#{pd.lastEnd},' 23:59:59')
        </if>
        <if test="pd.username != null and pd.username != ''"><!-- 办理人检索 -->
            and
            (
            f.ASSIGNEE_ = #{pd.username}
            or
            f.ASSIGNEE_ in ${pd.rnumbers}
            )
        </if>
        and f.END_TIME_ is not NULL
        order by f.END_TIME_ desc
    </select>
 
    <select id="hitasklist" resultType="map" databaseId="mssql">
        select
        f.*,
        p.NAME_ pname_ ,
        p.DEPLOYMENT_ID_ deployment_id_,
        p.DGRM_RESOURCE_NAME_ dgrm_resource_name_
        from
        (
        select
        <include refid="n"/>
        from ACT_HI_TASKINST n
        where (
        n.ASSIGNEE_ = #{pd.username}
        or
        n.ASSIGNEE_ in ${pd.rnumbers}
        )
        group by n.EXECUTION_ID_
 
        ) f
        left join
        ACT_RE_PROCDEF p
        on f.PROC_DEF_ID_ = p.ID_
        where 1=1
        <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 -->
            and
            (
            p.NAME_ LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%')
            or
            f.NAME_ LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%')
            or
            f.ASSIGNEE_ LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%')
            )
        </if>
        <if test="pd.lastStart != null and pd.lastStart != ''"><!-- 开始时间检索 -->
            and f.END_TIME_ &gt;= CONCAT(#{pd.lastStart},' 00:00:00')
        </if>
        <if test="pd.lastEnd != null and pd.lastEnd != ''"><!-- 结束时间检索 -->
            and f.END_TIME_ &lt;= CONCAT(#{pd.lastEnd},' 23:59:59')
        </if>
        <if test="pd.username != null and pd.username != ''"><!-- 办理人检索 -->
            and
            (
            f.ASSIGNEE_ = #{pd.username}
            or
            f.ASSIGNEE_ in ${pd.rnumbers}
            )
        </if>
        and f.END_TIME_ is not NULL
        order by f.END_TIME_ desc
    </select>
 
    <select id="hitasklist" resultType="map" databaseId="pgsql">
        select
        f.*,
        p.NAME_ pname_ ,
        p.DEPLOYMENT_ID_ deployment_id_,
        p.DGRM_RESOURCE_NAME_ dgrm_resource_name_
        from
        (
            select
            n.EXECUTION_ID_,n.ASSIGNEE_,n.NAME_,n.END_TIME_,n.PROC_DEF_ID_,n.DURATION_,n.ID_,n.TASK_DEF_KEY_,n.PROC_INST_ID_,n.PARENT_TASK_ID_
            ,n.DESCRIPTION_,n.OWNER_,n.START_TIME_,n.CLAIM_TIME_,n.DELETE_REASON_,n.PRIORITY_,DUE_DATE_,n.FORM_KEY_,n.CATEGORY_,n.TENANT_ID_
            from ACT_HI_TASKINST n
            where (
            n.ASSIGNEE_ = #{pd.username}
            or
            n.ASSIGNEE_ in ${pd.rnumbers}
            )
            group by n.EXECUTION_ID_,n.ASSIGNEE_,n.NAME_,n.END_TIME_,n.PROC_DEF_ID_,n.DURATION_,n.ID_,n.TASK_DEF_KEY_,n.PROC_INST_ID_,n.PARENT_TASK_ID_
            ,n.DESCRIPTION_,n.OWNER_,n.START_TIME_,n.CLAIM_TIME_,n.DELETE_REASON_,n.PRIORITY_,DUE_DATE_,n.FORM_KEY_,n.CATEGORY_,n.TENANT_ID_
        ) f
        left join
        ACT_RE_PROCDEF p
        on f.PROC_DEF_ID_ = p.ID_
        where 1=1
        <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 -->
            and
            (
            p.NAME_ LIKE '%' || #{pd.keywords} || '%'
            or
            f.NAME_ LIKE '%' || #{pd.keywords} || '%'
            or
            f.ASSIGNEE_ LIKE '%' || #{pd.keywords} || '%'
            )
        </if>
        <if test="pd.lastStart != null and pd.lastStart != ''"><!-- 开始时间检索 -->
            and f.END_TIME_ &gt;= to_timestamp(#{pd.lastStart}||' 00:00:00','yyyy-mm-dd hh24:mi:ss')
        </if>
        <if test="pd.lastEnd != null and pd.lastEnd != ''"><!-- 结束时间检索 -->
            and f.END_TIME_ &lt;= to_timestamp(#{pd.lastEnd}||' 23:59:59','yyyy-mm-dd hh24:mi:ss')
        </if>
        <if test="pd.username != null and pd.username != ''"><!-- 办理人检索 -->
            and
            (
            f.ASSIGNEE_ = #{pd.username}
            or
            f.ASSIGNEE_ in ${pd.rnumbers}
            )
        </if>
        and f.END_TIME_ is not NULL
        order by f.END_TIME_ desc
    </select>
 
    <select id="hitasklist" resultType="map" databaseId="oracle">
        select
        f.*,
        p.NAME_ "pname_" ,
        p.DEPLOYMENT_ID_ "deployment_id_",
        p.DGRM_RESOURCE_NAME_ "dgrm_resource_name_"
        from
        (
            select
            <include refid="n"/>
            from ACT_HI_TASKINST n
            where (
            n.ASSIGNEE_ = #{pd.username}
            or
            n.ASSIGNEE_ in ${pd.rnumbers}
            )
            group by n.EXECUTION_ID_,n.ASSIGNEE_,n.NAME_,n.END_TIME_,n.PROC_DEF_ID_,n.DURATION_,n.ID_,n.TASK_DEF_KEY_,n.PROC_INST_ID_,n.PARENT_TASK_ID_
            ,n.DESCRIPTION_,n.OWNER_,n.START_TIME_,n.CLAIM_TIME_,n.DELETE_REASON_,n.PRIORITY_,DUE_DATE_,n.FORM_KEY_,n.CATEGORY_,n.TENANT_ID_
        ) f
        left join
        ACT_RE_PROCDEF p
        on f."proc_def_id_" = p.ID_
        where 1=1
        <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 -->
            and
            (
            p.name_ LIKE '%' || #{pd.keywords} || '%'
            or
            f."name_" LIKE '%' || #{pd.keywords} || '%'
            or
            f."assignee_" LIKE '%' || #{pd.keywords} || '%'
            )
        </if>
        <if test="pd.lastStart != null and pd.lastStart != ''"><!-- 开始时间检索 -->
            and f."end_time_" &gt;= to_date(#{pd.lastStart}||' 00:00:00','yyyy-mm-dd hh24:mi:ss')
        </if>
        <if test="pd.lastEnd != null and pd.lastEnd != ''"><!-- 结束时间检索 -->
            and f."end_time_" &lt;= to_date(#{pd.lastEnd}||' 23:59:59','yyyy-mm-dd hh24:mi:ss')
        </if>
        <if test="pd.username != null and pd.username != ''"><!-- 办理人检索 -->
            and
            (
            f."assignee_" = #{pd.username}
            or
            f."assignee_" in ${pd.rnumbers}
            )
        </if>
        and f."end_time_" is not NULL
        order by f."end_time_" desc
    </select>
 
    <select id="customList" resultType="cn.stylefeng.guns.workflow.modular.model.result.RuTaskResult"
            parameterType="cn.stylefeng.guns.workflow.modular.model.params.RuTaskParam">
        select
        <include refid="Base_Column_List"/>
        from act_ru_task 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.RuTaskParam">
        select
        <include refid="Base_Column_List"/>
        from act_ru_task where 1 = 1
        <if test="paramCondition.name != null and paramCondition.name != ''">
            and NAME_ like CONCAT('%',#{paramCondition.name},'%')
        </if>
    </select>
 
    <select id="customPageList" resultType="cn.stylefeng.guns.workflow.modular.model.result.RuTaskResult"
            parameterType="cn.stylefeng.guns.workflow.modular.model.params.RuTaskParam">
        select
        f.ID_ AS "id", f.REV_ AS "rev", f.EXECUTION_ID_ AS "executionId", f.PROC_INST_ID_ AS "procInstId",
        f.PROC_DEF_ID_ AS "procDefId", f.NAME_ AS "name", f.PARENT_TASK_ID_ AS "parentTaskId",
        f.DESCRIPTION_ AS "description", f.TASK_DEF_KEY_ AS "taskDefKey", f.OWNER_ AS "owner",
        f.ASSIGNEE_ AS "assignee", f.DELEGATION_ AS "delegation", f.PRIORITY_ AS "priority", f.CREATE_TIME_ AS
        "createTime", f.DUE_DATE_ AS "dueDate",
        f.CATEGORY_ AS "category", f.SUSPENSION_STATE_ AS "suspensionState", f.TENANT_ID_ AS "tenantId", f.FORM_KEY_ AS
        "formKey", f.CLAIM_TIME_ AS "claimTime",
        p.NAME_ as "pname",
        p.DGRM_RESOURCE_NAME_ as "dgrmResourceName"
        from act_ru_task f
        left join ACT_RE_PROCDEF p on f.PROC_DEF_ID_ = p.ID_
        where 1=1
        <if test="paramCondition.keywords!= null and paramCondition.keywords != ''"><!-- 关键词检索 -->
            and
            (
            p.NAME_ LIKE CONCAT(CONCAT('%', #{paramCondition.keywords}),'%')
            or
            f.NAME_ LIKE CONCAT(CONCAT('%', #{paramCondition.keywords}),'%')
            or
            f.ASSIGNEE_ LIKE CONCAT(CONCAT('%', #{paramCondition.keywords}),'%')
            )
        </if>
        <if test="paramCondition.lastStart != null and paramCondition.lastStart != ''"><!-- 开始时间检索 -->
            and f.CREATE_TIME_ &gt;= #{paramCondition.lastStart}
        </if>
        <if test="paramCondition.lastEnd != null and paramCondition.lastEnd != ''"><!-- 结束时间检索 -->
            and f.CREATE_TIME_ &lt;= #{paramCondition.lastEnd}
        </if>
        <if test="paramCondition.username != null and paramCondition.username != ''"><!-- 当前办理人检索 -->
            and
            (
            f.ASSIGNEE_ = #{paramCondition.username}
            or
            f.ASSIGNEE_ in ${paramCondition.username}
            )
        </if>
        order by f.CREATE_TIME_ desc
    </select>
 
    <select id="customPageList" resultType="cn.stylefeng.guns.workflow.modular.model.result.RuTaskResult"
            parameterType="cn.stylefeng.guns.workflow.modular.model.params.RuTaskParam" databaseId="mssql">
        select
        f.ID_ AS "id", f.REV_ AS "rev", f.EXECUTION_ID_ AS "executionId", f.PROC_INST_ID_ AS "procInstId",
        f.PROC_DEF_ID_ AS "procDefId", f.NAME_ AS "name", f.PARENT_TASK_ID_ AS "parentTaskId",
        f.DESCRIPTION_ AS "description", f.TASK_DEF_KEY_ AS "taskDefKey", f.OWNER_ AS "owner",
        f.ASSIGNEE_ AS "assignee", f.DELEGATION_ AS "delegation", f.PRIORITY_ AS "priority", f.CREATE_TIME_ AS
        "createTime", f.DUE_DATE_ AS "dueDate",
        f.CATEGORY_ AS "category", f.SUSPENSION_STATE_ AS "suspensionState", f.TENANT_ID_ AS "tenantId", f.FORM_KEY_ AS
        "formKey", f.CLAIM_TIME_ AS "claimTime",
        p.NAME_ as "pname",
        p.DGRM_RESOURCE_NAME_ as "dgrmResourceName"
        from act_ru_task f
        left join ACT_RE_PROCDEF p on f.PROC_DEF_ID_ = p.ID_
        where 1=1
        <if test="paramCondition.keywords!= null and paramCondition.keywords != ''"><!-- 关键词检索 -->
            and
            (
            p.NAME_ LIKE CONCAT(CONCAT('%', #{paramCondition.keywords}),'%')
            or
            f.NAME_ LIKE CONCAT(CONCAT('%', #{paramCondition.keywords}),'%')
            or
            f.ASSIGNEE_ LIKE CONCAT(CONCAT('%', #{paramCondition.keywords}),'%')
            )
        </if>
        <if test="paramCondition.lastStart != null and paramCondition.lastStart != ''"><!-- 开始时间检索 -->
            and f.CREATE_TIME_ &gt;= #{paramCondition.lastStart}
        </if>
        <if test="paramCondition.lastEnd != null and paramCondition.lastEnd != ''"><!-- 结束时间检索 -->
            and f.CREATE_TIME_ &lt;= #{paramCondition.lastEnd}
        </if>
        <if test="paramCondition.username != null and paramCondition.username != ''"><!-- 当前办理人检索 -->
            and
            (
            f.ASSIGNEE_ = #{paramCondition.username}
            or
            f.ASSIGNEE_ in ${paramCondition.username}
            )
        </if>
        order by f.CREATE_TIME_ desc
    </select>
 
    <select id="customPageList" resultType="cn.stylefeng.guns.workflow.modular.model.result.RuTaskResult"
            parameterType="cn.stylefeng.guns.workflow.modular.model.params.RuTaskParam" databaseId="pgsql">
        select
        f.ID_ AS "id", f.REV_ AS "rev", f.EXECUTION_ID_ AS "executionId", f.PROC_INST_ID_ AS "procInstId",
        f.PROC_DEF_ID_ AS "procDefId", f.NAME_ AS "name", f.PARENT_TASK_ID_ AS "parentTaskId",
        f.DESCRIPTION_ AS "description", f.TASK_DEF_KEY_ AS "taskDefKey", f.OWNER_ AS "owner",
        f.ASSIGNEE_ AS "assignee", f.DELEGATION_ AS "delegation", f.PRIORITY_ AS "priority", f.CREATE_TIME_ AS
        "createTime", f.DUE_DATE_ AS "dueDate",
        f.CATEGORY_ AS "category", f.SUSPENSION_STATE_ AS "suspensionState", f.TENANT_ID_ AS "tenantId", f.FORM_KEY_ AS
        "formKey", f.CLAIM_TIME_ AS "claimTime",
        p.NAME_ as "pname",
        p.DGRM_RESOURCE_NAME_ as "dgrmResourceName"
        from act_ru_task f
        left join ACT_RE_PROCDEF p on f.PROC_DEF_ID_ = p.ID_
        where 1=1
        <if test="paramCondition.keywords!= null and paramCondition.keywords != ''"><!-- 关键词检索 -->
            and
            (
            p.NAME_ LIKE '%' || #{paramCondition.keywords} || '%'
            or
            f.NAME_ LIKE '%' || #{paramCondition.keywords} || '%'
            or
            f.ASSIGNEE_ LIKE '%' || #{paramCondition.keywords} || '%'
            )
        </if>
        <if test="paramCondition.lastStart != null and paramCondition.lastStart != ''"><!-- 开始时间检索 -->
            and f.CREATE_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 f.CREATE_TIME_ &lt;= to_timestamp(#{paramCondition.lastEnd}||'23:59:59','yyyy-mm-dd hh24:mi:ss')
        </if>
        <if test="paramCondition.username != null and paramCondition.username != ''"><!-- 当前办理人检索 -->
            and
            (
            f.ASSIGNEE_ = #{paramCondition.username}
            or
            f.ASSIGNEE_ in ${paramCondition.username}
            )
        </if>
        order by f.CREATE_TIME_ desc
    </select>
 
    <select id="customPageList" resultType="cn.stylefeng.guns.workflow.modular.model.result.RuTaskResult"
            parameterType="cn.stylefeng.guns.workflow.modular.model.params.RuTaskParam" databaseId="oracle">
        select
        f.ID_ AS "id", f.REV_ AS "rev", f.EXECUTION_ID_ AS "executionId", f.PROC_INST_ID_ AS "procInstId",
        f.PROC_DEF_ID_ AS "procDefId", f.NAME_ AS "name", f.PARENT_TASK_ID_ AS "parentTaskId",
        f.DESCRIPTION_ AS "description", f.TASK_DEF_KEY_ AS "taskDefKey", f.OWNER_ AS "owner",
        f.ASSIGNEE_ AS "assignee", f.DELEGATION_ AS "delegation", f.PRIORITY_ AS "priority", f.CREATE_TIME_ AS
        "createTime", f.DUE_DATE_ AS "dueDate",
        f.CATEGORY_ AS "category", f.SUSPENSION_STATE_ AS "suspensionState", f.TENANT_ID_ AS "tenantId", f.FORM_KEY_ AS
        "formKey", f.CLAIM_TIME_ AS "claimTime",
        p.NAME_ as "pname",
        p.DGRM_RESOURCE_NAME_ as "dgrmResourceName"
        from act_ru_task f
        left join ACT_RE_PROCDEF p on f.PROC_DEF_ID_ = p.ID_
        where 1=1
        <if test="paramCondition.keywords!= null and paramCondition.keywords != ''"><!-- 关键词检索 -->
            and
            (
            p.NAME_ LIKE '%' || #{paramCondition.keywords} || '%'
            or
            f.NAME_ LIKE '%' || #{paramCondition.keywords} || '%'
            or
            f.ASSIGNEE_ LIKE '%' || #{paramCondition.keywords} || '%'
            )
        </if>
        <if test="paramCondition.lastStart != null and paramCondition.lastStart != ''"><!-- 开始时间检索 -->
            and f.CREATE_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 f.CREATE_TIME_ &lt;= to_date(#{paramCondition.lastEnd}||'23:59:59','yyyy-mm-dd hh24:mi:ss')
        </if>
        <if test="paramCondition.username != null and paramCondition.username != ''"><!-- 当前办理人检索 -->
            and
            (
            f.ASSIGNEE_ = #{paramCondition.username}
            or
            f.ASSIGNEE_ in ${paramCondition.username}
            )
        </if>
        order by f.CREATE_TIME_ desc
    </select>
 
    <select id="customPageMapList" resultType="map"
            parameterType="cn.stylefeng.guns.workflow.modular.model.params.RuTaskParam">
        select
        f.ID_ AS "id", f.REV_ AS "rev", f.EXECUTION_ID_ AS "executionId", f.PROC_INST_ID_ AS "procInstId",
        f.PROC_DEF_ID_ AS "procDefId", f.NAME_ AS "name", f.PARENT_TASK_ID_ AS "parentTaskId",
        f.DESCRIPTION_ AS "description", f.TASK_DEF_KEY_ AS "taskDefKey", f.OWNER_ AS "owner",
        f.ASSIGNEE_ AS "assignee", f.DELEGATION_ AS "delegation", f.PRIORITY_ AS "priority", f.CREATE_TIME_ AS
        "createTime", f.DUE_DATE_ AS "dueDate",
        f.CATEGORY_ AS "category", f.SUSPENSION_STATE_ AS "suspensionState", f.TENANT_ID_ AS "tenantId", f.FORM_KEY_ AS
        "formKey", f.CLAIM_TIME_ AS "claimTime",
        p.NAME_ as "pname",
        p.DGRM_RESOURCE_NAME_ as "dgrmResourceName"
        from act_ru_task f
        left join ACT_RE_PROCDEF p on f.PROC_DEF_ID_ = p.ID_
        where 1=1
        <if test="paramCondition.keywords!= null and paramCondition.keywords != ''"><!-- 关键词检索 -->
            and
            (
            p.NAME_ LIKE CONCAT(CONCAT('%', #{paramCondition.keywords}),'%')
            or
            f.NAME_ LIKE CONCAT(CONCAT('%', #{paramCondition.keywords}),'%')
            or
            f.ASSIGNEE_ LIKE CONCAT(CONCAT('%', #{paramCondition.keywords}),'%')
            )
        </if>
        <if test="paramCondition.lastStart != null and paramCondition.lastStart != ''"><!-- 开始时间检索 -->
            and f.CREATE_TIME_ &gt;= #{paramCondition.lastStart}
        </if>
        <if test="paramCondition.lastEnd != null and paramCondition.lastEnd != ''"><!-- 结束时间检索 -->
            and f.CREATE_TIME_ &lt;= #{paramCondition.lastEnd}
        </if>
        <if test="paramCondition.username != null and paramCondition.username != ''"><!-- 当前办理人检索 -->
            and
            (
            f.ASSIGNEE_ = #{paramCondition.username}
            or
            f.ASSIGNEE_ in ${paramCondition.username}
            )
        </if>
        order by f.CREATE_TIME_ desc
    </select>
 
    <select id="customPageMapList" resultType="map"
            parameterType="cn.stylefeng.guns.workflow.modular.model.params.RuTaskParam" databaseId="mssql">
        select
        f.ID_ AS "id", f.REV_ AS "rev", f.EXECUTION_ID_ AS "executionId", f.PROC_INST_ID_ AS "procInstId",
        f.PROC_DEF_ID_ AS "procDefId", f.NAME_ AS "name", f.PARENT_TASK_ID_ AS "parentTaskId",
        f.DESCRIPTION_ AS "description", f.TASK_DEF_KEY_ AS "taskDefKey", f.OWNER_ AS "owner",
        f.ASSIGNEE_ AS "assignee", f.DELEGATION_ AS "delegation", f.PRIORITY_ AS "priority", f.CREATE_TIME_ AS
        "createTime", f.DUE_DATE_ AS "dueDate",
        f.CATEGORY_ AS "category", f.SUSPENSION_STATE_ AS "suspensionState", f.TENANT_ID_ AS "tenantId", f.FORM_KEY_ AS
        "formKey", f.CLAIM_TIME_ AS "claimTime",
        p.NAME_ as "pname",
        p.DGRM_RESOURCE_NAME_ as "dgrmResourceName"
        from act_ru_task f
        left join ACT_RE_PROCDEF p on f.PROC_DEF_ID_ = p.ID_
        where 1=1
        <if test="paramCondition.keywords!= null and paramCondition.keywords != ''"><!-- 关键词检索 -->
            and
            (
            p.NAME_ LIKE CONCAT(CONCAT('%', #{paramCondition.keywords}),'%')
            or
            f.NAME_ LIKE CONCAT(CONCAT('%', #{paramCondition.keywords}),'%')
            or
            f.ASSIGNEE_ LIKE CONCAT(CONCAT('%', #{paramCondition.keywords}),'%')
            )
        </if>
        <if test="paramCondition.lastStart != null and paramCondition.lastStart != ''"><!-- 开始时间检索 -->
            and f.CREATE_TIME_ &gt;= #{paramCondition.lastStart}
        </if>
        <if test="paramCondition.lastEnd != null and paramCondition.lastEnd != ''"><!-- 结束时间检索 -->
            and f.CREATE_TIME_ &lt;= #{paramCondition.lastEnd}
        </if>
        <if test="paramCondition.username != null and paramCondition.username != ''"><!-- 当前办理人检索 -->
            and
            (
            f.ASSIGNEE_ = #{paramCondition.username}
            or
            f.ASSIGNEE_ in ${paramCondition.username}
            )
        </if>
        order by f.CREATE_TIME_ desc
    </select>
 
    <select id="customPageMapList" resultType="map"
            parameterType="cn.stylefeng.guns.workflow.modular.model.params.RuTaskParam" databaseId="pgsql">
        select
        f.ID_ AS "id", f.REV_ AS "rev", f.EXECUTION_ID_ AS "executionId", f.PROC_INST_ID_ AS "procInstId",
        f.PROC_DEF_ID_ AS "procDefId", f.NAME_ AS "name", f.PARENT_TASK_ID_ AS "parentTaskId",
        f.DESCRIPTION_ AS "description", f.TASK_DEF_KEY_ AS "taskDefKey", f.OWNER_ AS "owner",
        f.ASSIGNEE_ AS "assignee", f.DELEGATION_ AS "delegation", f.PRIORITY_ AS "priority", f.CREATE_TIME_ AS
        "createTime", f.DUE_DATE_ AS "dueDate",
        f.CATEGORY_ AS "category", f.SUSPENSION_STATE_ AS "suspensionState", f.TENANT_ID_ AS "tenantId", f.FORM_KEY_ AS
        "formKey", f.CLAIM_TIME_ AS "claimTime",
        p.NAME_ as "pname",
        p.DGRM_RESOURCE_NAME_ as "dgrmResourceName"
        from act_ru_task f
        left join ACT_RE_PROCDEF p on f.PROC_DEF_ID_ = p.ID_
        where 1=1
        <if test="paramCondition.keywords!= null and paramCondition.keywords != ''"><!-- 关键词检索 -->
            and
            (
            p.NAME_ LIKE '%' || #{paramCondition.keywords} || '%'
            or
            f.NAME_ LIKE '%' || #{paramCondition.keywords} || '%'
            or
            f.ASSIGNEE_ LIKE '%' || #{paramCondition.keywords} || '%'
            )
        </if>
        <if test="paramCondition.lastStart != null and paramCondition.lastStart != ''"><!-- 开始时间检索 -->
            and f.CREATE_TIME_ &gt;= to_timestamp(#{paramCondition.lastStart},'yyyy-mm-dd hh24:mi:ss')
        </if>
        <if test="paramCondition.lastEnd != null and paramCondition.lastEnd != ''"><!-- 结束时间检索 -->
            and f.CREATE_TIME_ &lt;= to_timestamp(#{paramCondition.lastEnd},'yyyy-mm-dd hh24:mi:ss')
        </if>
        <if test="paramCondition.username != null and paramCondition.username != ''"><!-- 当前办理人检索 -->
            and
            (
            f.ASSIGNEE_ = #{paramCondition.username}
            or
            f.ASSIGNEE_ in ${paramCondition.username}
            )
        </if>
        order by f.CREATE_TIME_ desc
    </select>
 
    <select id="customPageMapList" resultType="map"
            parameterType="cn.stylefeng.guns.workflow.modular.model.params.RuTaskParam" databaseId="oracle">
        select
        f.ID_ AS "id", f.REV_ AS "rev", f.EXECUTION_ID_ AS "executionId", f.PROC_INST_ID_ AS "procInstId",
        f.PROC_DEF_ID_ AS "procDefId", f.NAME_ AS "name", f.PARENT_TASK_ID_ AS "parentTaskId",
        f.DESCRIPTION_ AS "description", f.TASK_DEF_KEY_ AS "taskDefKey", f.OWNER_ AS "owner",
        f.ASSIGNEE_ AS "assignee", f.DELEGATION_ AS "delegation", f.PRIORITY_ AS "priority", f.CREATE_TIME_ AS
        "createTime", f.DUE_DATE_ AS "dueDate",
        f.CATEGORY_ AS "category", f.SUSPENSION_STATE_ AS "suspensionState", f.TENANT_ID_ AS "tenantId", f.FORM_KEY_ AS
        "formKey", f.CLAIM_TIME_ AS "claimTime",
        p.NAME_ as "pname",
        p.DGRM_RESOURCE_NAME_ as "dgrmResourceName"
        from act_ru_task f
        left join ACT_RE_PROCDEF p on f.PROC_DEF_ID_ = p.ID_
        where 1=1
        <if test="paramCondition.keywords!= null and paramCondition.keywords != ''"><!-- 关键词检索 -->
            and
            (
            p.NAME_ LIKE '%' || #{paramCondition.keywords} || '%'
            or
            f.NAME_ LIKE '%' || #{paramCondition.keywords} || '%'
            or
            f.ASSIGNEE_ LIKE '%' || #{paramCondition.keywords} || '%'
            )
        </if>
        <if test="paramCondition.lastStart != null and paramCondition.lastStart != ''"><!-- 开始时间检索 -->
            and f.CREATE_TIME_ &gt;= to_date(#{paramCondition.lastStart},'yyyy-mm-dd hh24:mi:ss')
        </if>
        <if test="paramCondition.lastEnd != null and paramCondition.lastEnd != ''"><!-- 结束时间检索 -->
            and f.CREATE_TIME_ &lt;= to_date(#{paramCondition.lastEnd},'yyyy-mm-dd hh24:mi:ss')
        </if>
        <if test="paramCondition.username != null and paramCondition.username != ''"><!-- 当前办理人检索 -->
            and
            (
            f.ASSIGNEE_ = #{paramCondition.username}
            or
            f.ASSIGNEE_ in ${paramCondition.username}
            )
        </if>
        order by f.CREATE_TIME_ desc
    </select>
</mapper>