From a0400e48a2e8f50c457e1c4d4ba19bab2a0d1301 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期四, 02 四月 2026 08:58:10 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_宁夏_中盛建材' into dev_宁夏_中盛建材

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

diff --git a/src/main/resources/mapper/production/ProductionProductMainMapper.xml b/src/main/resources/mapper/production/ProductionProductMainMapper.xml
index 22d46a8..4096bad 100644
--- a/src/main/resources/mapper/production/ProductionProductMainMapper.xml
+++ b/src/main/resources/mapper/production/ProductionProductMainMapper.xml
@@ -23,13 +23,12 @@
         pms.material_code as materialCode,
         pm.product_name as productName,
         pms.model as productModelName,
-        IFNULL(ppi.quantity, 0) as totalQuantity,
+        IFNULL(ppo.total_quantity, 0) as totalQuantity,
         IFNULL(ppo.scrap_qty, 0) as scrapQty,
         IFNULL(ppo.quantity, 0) as quantity
         from
         production_product_main ppm
         left join production_product_output ppo on ppo.product_main_id = ppm.id
-        left join production_product_input ppi on ppi.product_main_id = ppm.id
         left join product_order po on po.id = ppm.product_order_id
         left join product_order_plan pop on po.id = pop.product_order_id
         left join production_plan pp on pop.production_plan_id = pp.id
@@ -107,6 +106,21 @@
             </if>
         </where>
     </select>
+    <select id="selectProductionProductMainDto"
+            resultType="com.ruoyi.production.dto.ProductionProductMainDto">
+        SELECT ppm.id,
+        ppm.product_no,
+        ppm.post_name,
+        ppm.schedule,
+        ppm.reporting_time,
+        ppo.quantity,
+        ppo.scrap_qty,
+        ppo.total_quantity
+        FROM production_product_main ppm
+        left join production_product_output ppo on ppm.id = ppo.product_main_id
+        WHERE product_order_id=#{productOrderId}
+        order by reporting_time
+    </select>
 
     <delete id="deleteByWorkOrderIds" parameterType="java.util.List">
         DELETE FROM production_product_main

--
Gitblit v1.9.3