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
<?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="org.jeecg.modules.flowable.apithird.business.mapper.FlowMyBusinessMapper">
    <select id="PageList" resultType="org.jeecg.modules.flowable.apithird.business.dto.FlowMyBusinessDto">
        SELECT
        flow_my_business.id,
        flow_my_business.title,
        flow_my_business.proposer,
        flow_my_business.task_name,
        flow_my_business.task_id,
        ACT_RU_TASK.ASSIGNEE_ as todoUsers,
        flow_my_business.done_Users,
        ACT_HI_PROCINST.START_TIME_ AS start_time,
        ACT_HI_PROCINST.END_TIME_ AS end_time,
        ACT_RE_PROCDEF.NAME_ AS flowName,
        ACT_RE_PROCDEF.CATEGORY_ AS category
        FROM
        flow_my_business
        LEFT JOIN ACT_HI_PROCINST ON flow_my_business.process_instance_id = ACT_HI_PROCINST.ID_
        LEFT JOIN ACT_RE_PROCDEF ON flow_my_business.process_definition_id = ACT_RE_PROCDEF.ID_
        left join ACT_RU_TASK on flow_my_business.task_id = ACT_RU_TASK.ID_
        WHERE
        1 = 1
        <if test="flowMyBusinessDto.category != null and flowMyBusinessDto.category != ''">
            and ACT_RE_PROCDEF.CATEGORY_ = #{flowMyBusinessDto.category}
        </if>
        <if test="flowMyBusinessDto.flowName!= null and flowMyBusinessDto.flowName!= ''">
            AND ACT_RE_PROCDEF.name_ LIKE CONCAT('%',#{flowMyBusinessDto.flowName},'%')
        </if>
        <if test="flowMyBusinessDto.title != null and flowMyBusinessDto.title != ''">
            AND flow_my_business.title LIKE CONCAT('%',#{flowMyBusinessDto.title},'%')
        </if>
        <if test="flowMyBusinessDto.startTime!= null and flowMyBusinessDto.startTime!= ''">
            AND ACT_HI_PROCINST.START_TIME_ &gt;= #{flowMyBusinessDto.startTime}
        </if>
        <if test="flowMyBusinessDto.endTime!= null and flowMyBusinessDto.endTime!= ''">
            AND ACT_HI_PROCINST.END_TIME_ &lt;= #{flowMyBusinessDto.endTime}
        </if>
        ORDER BY
            flow_my_business.create_time desc
    </select>
    <select id="PageListMyBusiness" resultType="org.jeecg.modules.flowable.domain.dto.FlowTaskDto">
        SELECT
            task.ID_ as 'hisProcInsId',
            TASK.PROC_INST_ID_ AS 'taskId',
            ACT_RE_PROCDEF.CATEGORY_ AS 'category',
            ACT_RE_PROCDEF.NAME_ 'procDefName',
            flow_my_business.title AS 'Description',
            flow_my_business.data_id AS 'dataId',
            flow_my_business.process_definition_key AS 'processDefinitionKey',
            flow_my_business.process_definition_id AS 'processDefinitionId',
            flow_my_business.process_instance_id AS 'processInstanceId',
            TASK.EXECUTION_ID_ AS 'executionId',
            task.NAME_ AS 'taskName',
            task.DURATION_ 'duration',
            task.START_TIME_ AS 'createTime',
            task.END_TIME_ AS 'finishTime',
            task.TASK_DEF_KEY_ AS 'TaskDefKey'
        FROM
            ACT_HI_TASKINST TASK
                LEFT JOIN flow_my_business ON flow_my_business.process_instance_id = TASK.PROC_INST_ID_
                LEFT JOIN ACT_RE_PROCDEF ON flow_my_business.process_definition_id = ACT_RE_PROCDEF.ID_
        WHERE
           TASK.END_TIME_ IS NOT NULL
        <if test="flowMyBusinessDto.currentUser != null and flowMyBusinessDto.currentUser != ''">
            AND TASK.ASSIGNEE_ = #{flowMyBusinessDto.currentUser}
        </if>
        <if test="flowMyBusinessDto.category != null and flowMyBusinessDto.category != ''">
            and ACT_RE_PROCDEF.CATEGORY_ = #{flowMyBusinessDto.category}
        </if>
        <if test="flowMyBusinessDto.flowName!= null and flowMyBusinessDto.flowName!= ''">
            AND ACT_RE_PROCDEF.name_ LIKE CONCAT('%',#{flowMyBusinessDto.flowName},'%')
        </if>
        <if test="flowMyBusinessDto.title != null and flowMyBusinessDto.title != ''">
            AND flow_my_business.title LIKE CONCAT('%',#{flowMyBusinessDto.title},'%')
        </if>
        <if test="flowMyBusinessDto.startTime!= null and flowMyBusinessDto.startTime!= ''">
            AND TASK.START_TIME_ &gt;= #{flowMyBusinessDto.startTime}
        </if>
        <if test="flowMyBusinessDto.endTime!= null and flowMyBusinessDto.endTime!= ''">
            AND TASK.END_TIME_ &lt;= #{flowMyBusinessDto.endTime}
        </if>
        ORDER BY
            TASK.END_TIME_ DESC
    </select>
</mapper>