From d709e8a7117704ac4717db5201e40964b90d4791 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期四, 28 五月 2026 16:17:03 +0800
Subject: [PATCH] Merge dev_pro_河南鹤壁 into dev_山西_晋和园_pro

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

diff --git a/src/main/resources/mapper/production/ProductionOperationTaskMapper.xml b/src/main/resources/mapper/production/ProductionOperationTaskMapper.xml
index f029ef7..973e44e 100644
--- a/src/main/resources/mapper/production/ProductionOperationTaskMapper.xml
+++ b/src/main/resources/mapper/production/ProductionOperationTaskMapper.xml
@@ -64,6 +64,9 @@
             <if test="c != null and c.status != null">
                 and pot.status = #{c.status}
             </if>
+            <if test="c != null and c.isProduction != null">
+                and poro.is_production = #{c.isProduction}
+            </if>
             <if test="c != null and c.workOrderNo != null and c.workOrderNo != ''">
                 and pot.work_order_no like concat('%', #{c.workOrderNo}, '%')
             </if>
@@ -107,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
@@ -120,9 +123,9 @@
             <if test="endDateTime != null">
                 and ppo.create_time &lt;= #{endDateTime}
             </if>
-            <if test="userId != null">
-                and ppm.create_user = #{userId}
-            </if>
+<!--            <if test="userId != null">-->
+<!--                and ppm.create_user = #{userId}-->
+<!--            </if>-->
             <if test="processIds != null and processIds.size() > 0">
                 and poro.technology_operation_id in
                 <foreach collection="processIds" item="id" open="(" separator="," close=")">

--
Gitblit v1.9.3