{"sql":"select bwi.id                                                   as 流程实例id,\n       bwi.workflowCode                                         as 流程模板编码,\n       wh.workflowName                                          as 流程名称,\n       bwi.originator                                           as 流程发起人id,\n       bwi.originatorName                                       as 流程发起人姓名,\n       bwi.departmentId                                         as 发起人部门id,\n       bwi.departmentName                                       as 发起人部门名称,\n       bwi.startTime                                            as 流程发起时间,\n       bwi.finishTime                                           as 流程结束时间,\n       round(bwi.usedTime / 1000, 2)                            as \"耗时（秒）\",\n       round(bwi.usedTime / 60000, 2)                           as \"耗时（分）\",\n       round(bwi.usedTime / 3600000, 2)                         as \"耗时（小时）\",\n       round(bwi.usedTime / 86400000, 2)                        as \"耗时（天）\",\n       case\n           when bwi.state = 'DRAFT' then '草稿'\n           when bwi.state = 'PROCESSING' then '进行中'\n           when bwi.state = 'CANCELED' then '已作废'\n           when bwi.state = 'EXCEPTION' then '异常'\n           when bwi.state = 'COMPLETED' and (bwi.endStatus = 'APPROVAL' or bwi.endStatus is null or bwi.endStatus = '')\n               then '流程通过'\n           else '手动结束' end                                      as 流程状态,\n       bwi.schemaCode                                           as 所属模型编码,\n       haf.name                                                 as 所属模型名称,\n       bwi.appCode                                              as 所属应用编码,\n       hap.name                                                 as 所属应用名称,\n       case when hbc.count is not null then '运维' else '非运维' end as 人工运维,\n       bwi.originatorDeptQueryCode                              as 部门查询字段\nfrom biz_workflow_instance bwi\n         left join h_workflow_header wh on bwi.workflowCode = wh.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 workflowInstanceId, count(*) as count\n                    from h_biz_comment\n                    where workItemId = 'ADMIN'\n                    group by workflowInstanceId) hbc on bwi.id = hbc.workflowInstanceId","title":"流程实例","dbConfig":null,"encrypted":true,"dynamicParams":null}