技术答疑.常用SQL.全流程跟踪
【适应场景】
全流程跟踪
下查
---------------------------------------------------------------------------------------------------------
【按分录查询】
FTId:分录数据行ID
FTTableName :分录表名
FTTableId:分录表ID
【按整单查询】
FTId:单据ID
FTTableName :单据头表名
FTTableId:单据头表ID
其中,FTTableName 和FTTableId通过以下SQL获取:
SELECT * FROM t_BF_TableDefine WHERE FFORMID='STK_INSTOCK'
-- 全流程跟踪查询路线
-- <1>先查流程表,找到FMasterId
-- <2>根据FMasterId,再去流程表t_BF_Instance查FInstanceId
-- 查询业务流程实例
SELECT *
FROM t_BF_Instance TInst
INNER JOIN t_BF_InstanceEntry TEntry ON (TInst.FInstanceId = TEntry.FInstanceId) AND TEntry.FTId=100494
WHERE TEntry.FTTableName = 'T_STK_INSTOCKENTRY'
-- 查询业务流程历史表实例
-- FTTableId来自t_BF_TableDefine.FSeq:SELECT * FROM t_BF_TableDefine WHERE FFORMID='STK_INSTOCK'
SELECT *
FROM t_BF_InstanceHis TInst
INNER JOIN t_BF_InstanceEntryHis TEntry ON (TInst.FInstanceId = TEntry.FInstanceId) AND TEntry.FTId=100494
WHERE TEntry.FTTableId = 5100
-- 查询业务流程备份表实例
SELECT *
FROM t_BF_InstBackUp TInst
INNER JOIN t_BF_InstEntryBackUp TEntry ON (TInst.FInstanceId = TEntry.FInstanceId) AND TEntry.FTId=100494
WHERE TEntry.FTTableId = 5100
-- 根据FMasterId,再去流程表t_BF_Instance查FInstanceId
SELECT Distinct t0.FInstanceId, t0.FFlowId, t0.FSourceId, t0.FMasterId, t0.FStatus, t0.FStartTime
FROM t_BF_Instance t0 where t0.FMasterId ='5a1cbdcce64e72'
---------------------------------------------------------------------------------------------------------
【金蝶云星空BOS二次开发案例演示】https://vip.kingdee.com/article/94751030918525696
技术答疑.常用SQL.全流程跟踪
本文2024-09-23 04:18:35发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-164484.html