懒羊羊
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
<?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.TaskHistoryMapper">
 
    <!-- 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="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="PROC_INST_ID_ != null and PROC_INST_ID_ != ''"><!-- 流程实例ID -->
            and ht.PROC_INST_ID_ = #{PROC_INST_ID_}
        </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="PROC_INST_ID_ != null and PROC_INST_ID_ != ''"><!-- 流程实例ID -->
            and ht.PROC_INST_ID_ = #{PROC_INST_ID_}
        </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="PROC_INST_ID_ != null and PROC_INST_ID_ != ''"><!-- 流程实例ID -->
            and ht.PROC_INST_ID_ = #{PROC_INST_ID_}
        </if>
        order by ht.ID_
    </select>
 
    <select id="historyTaskList" resultType="map" databaseId="oracle">
        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="PROC_INST_ID_ != null and PROC_INST_ID_ != ''"><!-- 流程实例ID -->
            and ht.PROC_INST_ID_ = #{PROC_INST_ID_}
        </if>
        order by ht.ID_
    </select>
</mapper>