技术答疑.常用SQL.查询已超时的待办任务(Oracle版)
【应用场景】
查询已超时的待办任务(对应执行计划中的任务【工作流超时处理服务】)
【案例演示】
<1>未启用工作流日历
SELECT T.FAPPROVALASSIGNID FROM T_WF_APPROVALASSIGN T INNER JOIN T_WF_ASSIGN B ON B.FASSIGNID = T.FASSIGNID WHERE B.FSTATUS = '0' AND T.FTIMEOUTDEAL = '1' AND T.FDEALTIME < SYSDATE - (1.0 * T.FTIMEOUTHOURS / 24 + 1.0 * T.FTIMEOUTMINUTE / 60 / 24) AND EXISTS (SELECT 1 FROM T_WF_PROCINST C WHERE B.FPROCINSTID = C.FPROCINSTID AND C.FSTATUS IN ('0', '2'));
<2>已启用工作流日历
SELECT T.FAPPROVALASSIGNID FROM T_WF_APPROVALASSIGN T INNER JOIN T_WF_ASSIGN B ON B.FASSIGNID = T.FASSIGNID WHERE ((((B.FStatus = '0' AND T.FTimeoutDeal = '1') AND ((T.FCALENDARID > 0) AND EXISTS (SELECT 1 FROM T_WF_CALENDAR TC WHERE (tc.FID = T.FCALENDARID AND tc.FFORBIDSTATUS = 'A')))) AND EXISTS (SELECT 1 FROM T_WF_PROCINST C WHERE (B.FPROCINSTID = C.FPROCINSTID AND (C.FSTATUS IN ('0', '2'))))) AND ((((((NVL(FDEALDATEHOURS, 0) + (SELECT NVL(SUM(FTEMPCOSTHOURS), 0) FROM T_WF_CALENDAR WHERE FID = T.FCALENDARID)) - CASE WHEN (ROUND((TRUNC(CAST(FDEALTIME AS DATE), 'DD') - TRUNC(CAST(SYSDATE AS DATE), 'DD'))) <= 0) THEN (SELECT NVL(SUM(FWORKHOURS), 0) FROM T_WF_CALENDARDATA WHERE ((FID = T.FCALENDARID AND FISWORKTIME = '1') AND ROUND((TRUNC(CAST(FDAY AS DATE), 'DD') - TRUNC(CAST(SYSDATE AS DATE), 'DD'))) = 0)) ELSE 0 END) + (SELECT NVL(SUM(FWORKHOURS), 0) FROM T_WF_CALENDARDATA WHERE (((FID = T.FCALENDARID AND FISWORKTIME = '1') AND (FDAY > FDEALTIME)) AND (FDAY <= (SYSDATE - 1))))) * 1.0) / 24) > (((1.0 * T.FTimeoutHours) / 24) + (((1.0 * T.FTimeoutMinute) / 60) / 24)))) UNION SELECT T.FAPPROVALASSIGNID FROM T_WF_APPROVALASSIGN T INNER JOIN T_WF_ASSIGN B ON B.FASSIGNID = T.FASSIGNID WHERE ((((B.FStatus = '0' AND T.FTimeoutDeal = '1') AND (T.FDEALTIME < (SYSDATE - (((1.0 * T.FTimeoutHours) / 24) + (((1.0 * T.FTimeoutMinute) / 60) / 24))))) AND EXISTS (SELECT 1 FROM T_WF_PROCINST C WHERE (B.FPROCINSTID = C.FPROCINSTID AND (C.FSTATUS IN ('0', '2'))))) AND ((T.FCALENDARID <= 0) OR EXISTS (SELECT 1 FROM T_WF_CALENDAR TC WHERE (tc.FID = T.FCALENDARID AND tc.FFORBIDSTATUS = 'B'))))
---------------------------------------------------------------------------------------------------------
【金蝶云星空BOS二次开发案例演示】https://vip.kingdee.com/article/94751030918525696
技术答疑.常用SQL.查询已超时的待办任务(Oracle版)
【应用场景】查询已超时的待办任务(对应执行计划中的任务【工作流超时处理服务】)【案例演示】<1>未启用工作流日历SELECT T.FAPPROVALASS...
点击下载文档
本文2024-09-23 03:57:31发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-162193.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章