-未归档流程节点耗时
SELECT 操作人id,操作人名称,COUNT(1) 处理流程数量,SUM(耗时) 总耗时,SUM(耗时)/COUNT(1) 平均耗时
FROM(SELECT
a.requestid '请求id',
a.workflowid '流程id',
a.nodeid '节点id',
c.nodename '节点名称',
a.nodeoperator '操作人id',
b.lastname '操作人名称',
a.createdate '流程创建日期',
a.receivedate '接受日期',
a.receivetime '接受时间',
a.flowtime/3600'耗时',
DATEADD(
ss,
a.flowtime,CONVERT(DATETIME,CONVERT(VARCHAR, a.receivedate )+' '+CONVERT(VARCHAR, a.receivetime )))'操作日期时间'-- a.isremark,-- a.viewdate,-- a.viewtime,-- a.preisremarkFROM
workflow_node_flowtime a
LEFTJOIN hrmresource b ON a.nodeoperator = b.id
LEFTJOIN workflow_nodebase c ON a.nodeid = c.id --去除申请节点、抛单节点、归档节点--where a.workflowid = '1504' and a.nodeid not in ('14300','14302') and a.createdate >= '2024-01-01'where a.workflowid ='1881'and a.nodeid notin('17364','17368','18357')and a.createdate >='2024-01-01'and a.isremark !=0UNIONALL--归档流程节点耗时SELECT
a.requestid '请求id',
a.workflowid '流程id',
a.nodeid '节点id',
c.nodename '节点名称',
a.nodeoperator '操作人id',
b.lastname '操作人名称',
a.createdate '流程创建日期',
a.receivedate '接受日期',
a.receivetime '接受时间',
a.flowtime/3600'耗时',
DATEADD(
ss,
a.flowtime,CONVERT(DATETIME,CONVERT(VARCHAR, a.receivedate )+' '+CONVERT(VARCHAR, a.receivetime )))'操作日期时间'-- a.isremark,-- a.viewdate,-- a.viewtime,-- a.preisremarkFROM
workflow_node_fix_flowtime a
LEFTJOIN hrmresource b ON a.nodeoperator = b.id
LEFTJOIN workflow_nodebase c ON a.nodeid = c.id --去除申请节点、抛单节点、归档节点--where a.workflowid = '1504' and a.nodeid not in ('14300','14302') and a.createdate >= '2024-01-01'--and a.requestid = '2021473'where a.workflowid ='1881'and a.nodeid notin('17364','17368','18357')and a.createdate >='2024-01-01'and a.isremark !=0) aa where aa.操作人id in(271,272,631,44,6593,631,611,631,631,631)GROUPBY 操作人id,操作人名称
ORDERBY--aa.请求id,aa.节点id,
平均耗时 DESC
查询OA流程所有路径类型下的流程
表:
workflow_base
workflow_type
sql语句
select a.id,a.typename ,b.id,b.workflowname,b.activeversionid from workflow_type a leftjoin workflow_base b on a.id = b.workflowtype
where b.isvalid ='1'--and b.activeversionid = b.id and a.id !='39'orderby b.workflowname
--order by a.id --and b.workflowname not like ''