13.flowable 待办任务列表查询

项目地址:https://gitee.com/lwj/flowable.git 分支flowable-base
视频讲解地址
https://space.bilibili.com/485524575/channel/detail?cid=94579

1. 演示

13.flowable 待办任务列表查询_第1张图片

2、代码

这里我使用的sql查询的,你也可以使用api接口

SELECT DISTINCT
            t1.ID_ AS taskId,
            t1.NAME_ AS taskName,
            t2.NAME_ AS formName,
            t2.TENANT_ID_ AS systemSn,
            t2.BUSINESS_KEY_ AS businessKey,
            t2.PROC_INST_ID_ AS processInstanceId,
            t1.CREATE_TIME_ AS startTime
        FROM
            act_ru_task t1
        INNER JOIN act_ru_execution t2 ON t1.PROC_INST_ID_ = t2.PROC_INST_ID_
        LEFT JOIN act_ru_identitylink t3 ON t3.TASK_ID_ = t1.ID_
        WHERE
            t2.BUSINESS_KEY_ IS NOT NULL
        AND (
            t1.ASSIGNEE_ = #{userCode}
            OR (
                t1.ASSIGNEE_ IN (
                    SELECT
                        G.group_id_
                    FROM
                        act_id_membership G
                    WHERE
                        G.user_id_ = #{userCode}
                )
            )
            OR (
                (
                    t1.ASSIGNEE_ IS NULL
                    OR t1.ASSIGNEE_ = ''
                )
                AND (
                    t3.USER_ID_ = #{userCode}
                    OR t3.GROUP_ID_ IN (
                        SELECT
                            g.group_id_
                        FROM
                            act_id_membership g
                        WHERE
                            g.user_id_ = #{userCode}
                    )
                )
            )
        )

你可能感兴趣的:(Flowable基础,flowable,flowable企业级)