工作流关联的表比较多,开发过程中遇到需要查看某个单据的所有工作流审批信息,查询语句中体现了工作流相关表之间的关联关系,供参考!
SQL语句:
select distinct detail.FAssignID,bill.fnumber as billnumber,act.FActDefName_l2 as actName,
approve.FOpinion_l2 as FOpinion,approve.FHandlerContent as FContext,
approve.FIsPass AS ISPASS,
detail.FPersonuserName_l2 as person,approve.FcreateTime as comleteTime,
posit.FName_l2 as position, adm.FName_l2 as adminorg
from t_wfr_actInst as act
inner join t_WFR_ProcinstRef as bizRef on bizRef.FProcInstID=act.FProcInstID
inner join T_WFR_ProcInst as pro on pro.FProcInstID=ACT.FProcInstID
inner join t_wfr_Assigndetail as detail on detail.FActdefID=act.FActdefID and detail.FProcInstID=act.FProcInstID
inner join T_CON_ChangeAuditBill bill on bill.fid=bizRef.FrefID --业务单据
inner join T_BAS_MultiApprove as approve on approve.FASSIGNMENTID=detail.FAssignID
inner join T_BD_Person