From 620bb4712a31791231c4381581f0f60088f079fe Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期三, 27 五月 2026 14:03:45 +0800
Subject: [PATCH] Merge branch 'refs/heads/dev_New_pro' into dev_宁夏_英泽防锈

---
 src/main/resources/mapper/production/ProductionOperationTaskMapper.xml |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/resources/mapper/production/ProductionOperationTaskMapper.xml b/src/main/resources/mapper/production/ProductionOperationTaskMapper.xml
index 199eb21..5847f5f 100644
--- a/src/main/resources/mapper/production/ProductionOperationTaskMapper.xml
+++ b/src/main/resources/mapper/production/ProductionOperationTaskMapper.xml
@@ -71,7 +71,7 @@
                 and pot.work_order_no like concat('%', #{c.workOrderNo}, '%')
             </if>
         </where>
-        order by pot.id desc
+        order by pot.production_order_id desc, poro.drag_sort
     </select>
 
     <select id="selectTaskStatisticsByDate" resultType="com.ruoyi.home.dto.ProductionTaskStatisticsDto">
@@ -110,7 +110,7 @@
         select poro.operation_name as processName,
                sum(ifnull(ppi.input_quantity, 0)) as totalInput,
                sum(ifnull(ppo.scrap_qty, 0)) as totalScrap,
-               sum(ifnull(ppo.quantity, 0) - ifnull(ppo.scrap_qty, 0)) as totalOutput
+               sum(greatest(ifnull(ppo.quantity, 0) - ifnull(ppo.scrap_qty, 0), 0)) as totalOutput
         from production_product_output ppo
                  inner join production_product_main ppm on ppo.production_product_main_id = ppm.id
                  inner join production_operation_task pot on ppm.production_operation_task_id = pot.id

--
Gitblit v1.9.3