{"sql":"select bwt.activityCode                  as 节点编码,\n       item.activityName                 as 节点名称,\n       bwt.instanceId                    as 流程实例id,\n       bwt.startTime                     as 开始时间,\n       bwt.finishTime                    as 结束时间,\n       bwt.usedtime                      as 耗时,\n       round(bwt.usedtime / 1000, 2)     as \"耗时（秒）\",\n       round(bwt.usedtime / 60000, 2)    as \"耗时（分）\",\n       round(bwt.usedtime / 3600000, 2)  as \"耗时（小时）\",\n       round(bwt.usedtime / 86400000, 2) as \"耗时（天）\",\n       case bwt.state\n           when 'CANCELLED' then '被取消'\n           when 'EXCEPTION' then '异常'\n           when 'FINISHED' then '已完成'\n           when 'REVOKE' then '被撤回'\n           else '进行中' end                as 节点状态,\n       bwi.workflowCode                  as 流程模板编码,\n       hwh.workflowName                  as 流程模板名称,\n       bwi.schemaCode                    as 所属模型编码,\n       haf.name                          as 所属模型名称,\n       bwi.appCode                       as 所属应用编码,\n       hap.name                          as 所属应用名称,\n       bwi.originatorDeptQueryCode       as 部门查询字段\nfrom biz_workflow_token bwt\n         left join biz_workflow_instance bwi on bwt.instanceId = bwi.id\n         left join h_workflow_header hwh on bwi.workflowCode = hwh.workflowCode\n         left join h_app_function haf on bwi.schemaCode = haf.code\n         left join h_app_package hap on bwi.appCode = hap.code\n         left join (select instanceId, activityCode, activityName\n                    from (select instanceId, activityCode, activityName\n                          from biz_workitem_finished\n                          union all\n                          select instanceId, activityCode, activityName\n                          from biz_workitem) all_item\n                    group by instanceId, activityCode, activityName) item\n                   on bwt.instanceId = item.instanceId and bwt.activityCode = item.activityCode","title":"节点数据","dbConfig":null,"encrypted":true,"dynamicParams":null}