activiti查詢個人任務和組任務結合
A.PROC_INST_ID_ PROC_INST_ID,
A.TASK_DEF_KEY_ AS ACT_ID,
A.NAME_ AS ACT_NAME,
A.ASSIGNEE_ AS ASSIGNEE,
A.DELEGATION_ AS DELEGATION_ID,
A.DESCRIPTION_ AS DESCRIPTION,
A.CREATE_TIME_ as CREATE_TIME,
A.DUE_DATE_ AS DUE_DATE,
I.USER_ID CANDIDATE
FROM ACT_RU_TASK A
LEFT JOIN (SELECT DISTINCT * FROM (SELECT TASK_ID_, USER_ID_ as USER_ID
FROM ACT_RU_IDENTITYLINK I, ACT_RU_TASK T
WHERE TASK_ID_ IS NOT NULL
AND USER_ID_ IS NOT NULL
AND I.TASK_ID_ = T.ID_
AND T.ASSIGNEE_ IS NULL
AND TYPE_ = 'candidate'
UNION
SELECT TASK_ID_,USER_ID_ as USER_ID
FROM ACT_RU_IDENTITYLINK I,ACT_RU_TASK T
WHERE I.TASK_ID_ IS NOT NULL
AND I.GROUP_ID_ IS NOT NULL
AND I.TASK_ID_ = T.ID_
AND T.ASSIGNEE_ IS NULL
AND TYPE_ = 'candidate')U) I
ON A.ID_ = I.TASK_ID_