统计指标

二开工单报工记录5分钟-工单维度

SELECT
    line_id AS line_id
    , relation_number AS work_order_number
    , now() AS report_time
    , COUNT(*) AS total_row
    , SUM(CASE WHEN is_report = 1 THEN 1 ELSE 0 END) AS total_completed
    , SUM(CASE WHEN is_input = 1 THEN 1 ELSE 0 END) AS total_input
    , SUM(CASE WHEN is_unqualified = 1 THEN 1 ELSE 0 END) AS total_defects
FROM
    dfs.dfs_code_report
WHERE
    is_report = 1
    AND report_time >= NOW() - INTERVAL 10 MINUTE
GROUP BY
    line_id
    , relation_number ;
作者:Nicemorning  创建时间:2026-01-21 14:37
最后编辑:Nicemorning  更新时间:2026-01-21 14:38