租户级

userTenantId:用户所属租户ID
userId:用户ID

我办理的流程(全部)

SELECT
    hp.ID_ AS instanceId,
    hp.NAME_ AS title,
    rp.NAME_ AS processName,
    extend.DISPLAY_ALIAS_ AS processNameAlias,
    hp.END_TIME_ AS endDate,
    hp.DELETE_REASON_ AS `state`,
    hp.START_TIME_ AS `createDate`,
    hp.START_USER_ID_ AS `creator`
FROM ACT_HI_PROCINST hp
    LEFT JOIN ACT_RE_PROCDEF rp ON rp.ID_ = hp.PROC_DEF_ID_
    LEFT JOIN DN_ACT_RE_EXTEND extend ON rp.KEY_ = extend.KEY_ and rp.TENANT_ID_=extend.TENANT_ID_
WHERE hp.TENANT_ID_='{userTenantId}'
    AND EXISTS (SELECT ACT_HI_TASKINST.PROC_INST_ID_
        FROM ACT_HI_TASKINST
        WHERE (ACT_HI_TASKINST.ASSIGNEE_ = '{userId}'  OR ACT_HI_TASKINST.OWNER_ ='{userId}')
        AND ( ACT_HI_TASKINST.DELETE_REASON_ != 'cancel_back' OR ACT_HI_TASKINST.DELETE_REASON_ is NULL )
        AND hp.PROC_INST_ID_ = ACT_HI_TASKINST.PROC_INST_ID_)
    AND hp.START_USER_ID_ != '{userId}'
 order by `createDate` DESC  LIMIT 0,10

我办理的流程(办理中)

SELECT
    hp.ID_ AS instanceId,
    hp.NAME_ AS title,
    rp.NAME_ AS processName,
    extend.DISPLAY_ALIAS_ AS processNameAlias,
    hp.END_TIME_ AS endDate,
    hp.DELETE_REASON_ AS `state`,
    hp.START_TIME_ AS `createDate`,
    hp.START_USER_ID_ AS `creator`
FROM ACT_HI_PROCINST hp
    LEFT JOIN ACT_RE_PROCDEF rp ON rp.ID_ = hp.PROC_DEF_ID_
    LEFT JOIN DN_ACT_RE_EXTEND extend ON rp.KEY_ = extend.KEY_ and rp.TENANT_ID_=extend.TENANT_ID_
WHERE hp.TENANT_ID_='{userTenantId}'
    AND EXISTS (SELECT ACT_HI_TASKINST.PROC_INST_ID_
        FROM ACT_HI_TASKINST
        WHERE (ACT_HI_TASKINST.ASSIGNEE_ = '{userId}'  OR ACT_HI_TASKINST.OWNER_ ='{userId}')
        AND ( ACT_HI_TASKINST.DELETE_REASON_ != 'cancel_back' OR ACT_HI_TASKINST.DELETE_REASON_ is NULL )
        AND hp.PROC_INST_ID_ = ACT_HI_TASKINST.PROC_INST_ID_)
    AND END_TIME_ is null
    AND hp.START_USER_ID_ != '{userId}'
 --   AND rp.KEY_ in ('processId-32a80a36-7bab-49e2-a','processId-229fa97c-5c0b-4ce0-9')
 order by `createDate` DESC  LIMIT 0,10

我办理的流程(已办结)

SELECT
    hp.ID_ AS instanceId,
    hp.NAME_ AS title,
    rp.NAME_ AS processName,
    extend.DISPLAY_ALIAS_ AS processNameAlias,
    hp.END_TIME_ AS endDate,
    hp.DELETE_REASON_ AS `state`,
    hp.START_TIME_ AS `createDate`,
    hp.START_USER_ID_ AS `creator`
FROM ACT_HI_PROCINST hp
    LEFT JOIN ACT_RE_PROCDEF rp ON rp.ID_ = hp.PROC_DEF_ID_
    LEFT JOIN DN_ACT_RE_EXTEND extend ON rp.KEY_ = extend.KEY_ and rp.TENANT_ID_=extend.TENANT_ID_
WHERE hp.TENANT_ID_='{userTenantId}'
    AND EXISTS (SELECT ACT_HI_TASKINST.PROC_INST_ID_
        FROM ACT_HI_TASKINST
        WHERE (ACT_HI_TASKINST.ASSIGNEE_ = '{userId}'  OR ACT_HI_TASKINST.OWNER_ ='{userId}')
        AND ( ACT_HI_TASKINST.DELETE_REASON_ != 'cancel_back' OR ACT_HI_TASKINST.DELETE_REASON_ is NULL )
        AND hp.PROC_INST_ID_ = ACT_HI_TASKINST.PROC_INST_ID_)
    AND END_TIME_ is not null
    AND hp.START_USER_ID_ != '{userId}'
 --   AND rp.KEY_ in ('processId-32a80a36-7bab-49e2-a','processId-229fa97c-5c0b-4ce0-9')
 order by `createDate` DESC  LIMIT 0,10

应用级

查看某个应用或某些应用中我办理的流程信息。

userTenantId:用户所属租户ID
userId:用户ID
volumeId:流程所属应用ID

我办理的流程(全部)

SELECT
    hp.ID_ AS instanceId,
    hp.NAME_ AS title,
    rp.NAME_ AS processName,
    extend.DISPLAY_ALIAS_ AS processNameAlias,
    hp.END_TIME_ AS endDate,
    hp.DELETE_REASON_ AS `state`,
    hp.START_TIME_ AS `createDate`,
    hp.START_USER_ID_ AS `creator`
FROM ACT_HI_PROCINST hp
    LEFT JOIN ACT_RE_PROCDEF rp ON rp.ID_ = hp.PROC_DEF_ID_
    LEFT JOIN DN_ACT_RE_EXTEND extend ON rp.KEY_ = extend.KEY_ and rp.TENANT_ID_=extend.TENANT_ID_
WHERE hp.TENANT_ID_='{userTenantId}'
    AND EXISTS (SELECT ACT_HI_TASKINST.PROC_INST_ID_
        FROM ACT_HI_TASKINST
        WHERE (ACT_HI_TASKINST.ASSIGNEE_ = '{userId}'  OR ACT_HI_TASKINST.OWNER_ ='{userId}')
        AND ( ACT_HI_TASKINST.DELETE_REASON_ != 'cancel_back' OR ACT_HI_TASKINST.DELETE_REASON_ is NULL )
        AND hp.PROC_INST_ID_ = ACT_HI_TASKINST.PROC_INST_ID_)
    AND hp.START_USER_ID_ != '{userId}'
    AND rp.KEY_  in (
        SELECT act_re_procdef.KEY_ from dn_file_property
        INNER JOIN act_re_procdef
        where dn_file_property.EXTRA_ like concat('%',act_re_procdef.KEY_,'%')
        and dn_file_property.VOLUME_ID in ('{volumeId}'))
 order by `createDate` DESC  LIMIT 0,10

我办理的流程(办理中)

SELECT
    hp.ID_ AS instanceId,
    hp.NAME_ AS title,
    rp.NAME_ AS processName,
    extend.DISPLAY_ALIAS_ AS processNameAlias,
    hp.END_TIME_ AS endDate,
    hp.DELETE_REASON_ AS `state`,
    hp.START_TIME_ AS `createDate`,
    hp.START_USER_ID_ AS `creator`
FROM ACT_HI_PROCINST hp
    LEFT JOIN ACT_RE_PROCDEF rp ON rp.ID_ = hp.PROC_DEF_ID_
    LEFT JOIN DN_ACT_RE_EXTEND extend ON rp.KEY_ = extend.KEY_ and rp.TENANT_ID_=extend.TENANT_ID_
WHERE hp.TENANT_ID_='{userTenantId}'
    AND EXISTS (SELECT ACT_HI_TASKINST.PROC_INST_ID_
        FROM ACT_HI_TASKINST
        WHERE (ACT_HI_TASKINST.ASSIGNEE_ = '{userId}'  OR ACT_HI_TASKINST.OWNER_ ='{userId}')
        AND ( ACT_HI_TASKINST.DELETE_REASON_ != 'cancel_back' OR ACT_HI_TASKINST.DELETE_REASON_ is NULL )
        AND hp.PROC_INST_ID_ = ACT_HI_TASKINST.PROC_INST_ID_)
    AND END_TIME_ is null
    AND hp.START_USER_ID_ != '{userId}'
    AND rp.KEY_  in (
        SELECT act_re_procdef.KEY_ from dn_file_property
        INNER JOIN act_re_procdef
        where dn_file_property.EXTRA_ like concat('%',act_re_procdef.KEY_,'%')
        and dn_file_property.VOLUME_ID in ('{volumeId}'))
 order by `createDate` DESC  LIMIT 0,10

我办理的流程(已办结)

SELECT
    hp.ID_ AS instanceId,
    hp.NAME_ AS title,
    rp.NAME_ AS processName,
    extend.DISPLAY_ALIAS_ AS processNameAlias,
    hp.END_TIME_ AS endDate,
    hp.DELETE_REASON_ AS `state`,
    hp.START_TIME_ AS `createDate`,
    hp.START_USER_ID_ AS `creator`
FROM ACT_HI_PROCINST hp
    LEFT JOIN ACT_RE_PROCDEF rp ON rp.ID_ = hp.PROC_DEF_ID_
    LEFT JOIN DN_ACT_RE_EXTEND extend ON rp.KEY_ = extend.KEY_ and rp.TENANT_ID_=extend.TENANT_ID_
WHERE hp.TENANT_ID_='{userTenantId}'
    AND EXISTS (SELECT ACT_HI_TASKINST.PROC_INST_ID_
        FROM ACT_HI_TASKINST
        WHERE (ACT_HI_TASKINST.ASSIGNEE_ = '{userId}'  OR ACT_HI_TASKINST.OWNER_ ='{userId}')
        AND ( ACT_HI_TASKINST.DELETE_REASON_ != 'cancel_back' OR ACT_HI_TASKINST.DELETE_REASON_ is NULL )
        AND hp.PROC_INST_ID_ = ACT_HI_TASKINST.PROC_INST_ID_)
    AND END_TIME_ is not null
    AND hp.START_USER_ID_ != '{userId}'
    AND rp.KEY_  in (
        SELECT act_re_procdef.KEY_ from dn_file_property
        INNER JOIN act_re_procdef
        where dn_file_property.EXTRA_ like concat('%',act_re_procdef.KEY_,'%')
        and dn_file_property.VOLUME_ID in ('{volumeId}'))
 order by `createDate` DESC  LIMIT 0,10
作者:柳杨  创建时间:2025-12-08 14:34
最后编辑:柳杨  更新时间:2025-12-11 19:52