|
@@ -168,6 +168,7 @@ def supply_workflow_dashboard_stat(ts: int) -> List[Dict[str, Any]]:
|
|
|
when sw.status = 1 then '开启中'
|
|
when sw.status = 1 then '开启中'
|
|
|
when sw.status = 0 then '已关闭'
|
|
when sw.status = 0 then '已关闭'
|
|
|
else '未知' end AS 状态,
|
|
else '未知' end AS 状态,
|
|
|
|
|
+ swt.total_cnt AS '任务数',
|
|
|
swt.init_cnt AS '待处理',
|
|
swt.init_cnt AS '待处理',
|
|
|
swt.running_cnt AS '运行中',
|
|
swt.running_cnt AS '运行中',
|
|
|
swt.success_cnt AS '成功',
|
|
swt.success_cnt AS '成功',
|
|
@@ -175,6 +176,7 @@ def supply_workflow_dashboard_stat(ts: int) -> List[Dict[str, Any]]:
|
|
|
FROM supply_workflow sw
|
|
FROM supply_workflow sw
|
|
|
LEFT JOIN (
|
|
LEFT JOIN (
|
|
|
SELECT workflow_id,
|
|
SELECT workflow_id,
|
|
|
|
|
+ COUNT(task_id) AS total_cnt,
|
|
|
COUNT(DISTINCT IF(task_status = 0, task_id, NULL)) AS init_cnt,
|
|
COUNT(DISTINCT IF(task_status = 0, task_id, NULL)) AS init_cnt,
|
|
|
COUNT(DISTINCT IF(task_status = 1, task_id, NULL)) AS running_cnt,
|
|
COUNT(DISTINCT IF(task_status = 1, task_id, NULL)) AS running_cnt,
|
|
|
COUNT(DISTINCT IF(task_status = 2, task_id, NULL)) AS success_cnt,
|
|
COUNT(DISTINCT IF(task_status = 2, task_id, NULL)) AS success_cnt,
|