zhang_nuo
2 天以前 f3d0cf42321bb6f0f3c03a66c3d33c260f5d593e
src/main/resources/mapper/production/ProductionOperationTaskMapper.xml
@@ -31,6 +31,7 @@
               poro.operation_name as operationName,
               poro.type as type,
               IFNULL(scrapStat.scrapQty, 0) AS scrapQty,
               CASE WHEN pickStat.pickCount > 0 THEN 1 ELSE 0 END AS picked,
        ROUND(IFNULL(pot.complete_quantity, 0) / NULLIF(pot.plan_quantity, 0) * 100, 2) AS completionStatus,
        CASE
            WHEN pot.work_order_no LIKE 'FG%' THEN '返工返修'
@@ -42,6 +43,12 @@
                 left join product_model pm on pm.id = ifnull(poro.product_model_id, po.product_model_id)
                 left join product p on pm.product_id = p.id
                 left join (
            select count(1) as pickCount, pop.production_order_id, pop.technology_operation_id
            from production_order_pick pop
            group by pop.production_order_id, pop.technology_operation_id
        ) pickStat on pickStat.production_order_id = pot.production_order_id
                  and pickStat.technology_operation_id = poro.technology_operation_id
                 left join (
            select ppm.production_operation_task_id as taskId,
                   sum(ifnull(ppo.scrap_qty, 0)) as scrapQty
            from production_product_main ppm