/** 驰骋工作流引擎重要数据查询大全 **/
-- 查询所有流程的实例.
SELECT * FROM WF_GenerWorkFlow;
-- 流程状态字典.
SELECT * FROM Sys_Enum WHERE EnumKey='WFState'
-- 查询已经完成的流程
SELECT * FROM WF_GenerWorkFlow WHERE WFState=3;
-- 查询我参与的已经完成的流程
SELECT * FROM WF_GenerWorkFlow WHERE WFState=3 AND Emps LIKE '%@zhangsan,%';
-- 查询我参与的退回中的流程
SELECT * FROM WF_GenerWorkFlow WHERE WFState=5 AND Emps LIKE '%@zhangsan,%';
-- 查询我参与的退回中的流程.
SELECT * FROM WF_GenerWorkFlow WHERE WFState=5 AND Emps LIKE '%@zhangsan,%';
-- 查询我发起的流程.
SELECT * FROM WF_GenerWorkFlow WHERE Starter='admin' AND WFState!=0 ;
-- 查询我发起的并且已经完成的流程.
SELECT * FROM WF_GenerWorkFlow WHERE Starter='admin' AND WFState=3 ;
-- 查询我发起的并且退回中的流程.
SELECT * FROM WF_GenerWorkFlow WHERE Starter='admin' AND WFState=5 ;
-- 查询我的待办
SELECT * FROM WF_EmpWorks WHERE FK_Emp='admin' ;
-- 查询即将预期的待办.
SELECT * FROM WF_EmpWorks WHERE FK_Emp='admin' AND SDT <='2020-01-09' ;
/*** 抄送查询. *******/
-- 我抄送给别人的流程.
SELECT * FROM WF_CCList WHERE Rec='admin'
-- 别人抄送给我的流程.
SELECT * FROM WF_CCList WHERE CCTo='admin'