From 441dfbd1908affc1accc52006a2fe81a5067052d Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期一, 22 六月 2026 09:28:09 +0800
Subject: [PATCH] 废品库存的批号如果有多个,则需要展示多个

---
 src/main/resources/mapper/stock/StockInventoryMapper.xml |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/main/resources/mapper/stock/StockInventoryMapper.xml b/src/main/resources/mapper/stock/StockInventoryMapper.xml
index 723541b..5d6657f 100644
--- a/src/main/resources/mapper/stock/StockInventoryMapper.xml
+++ b/src/main/resources/mapper/stock/StockInventoryMapper.xml
@@ -31,6 +31,9 @@
             <if test="ew.lockedQuantity != null and ew.lockedQuantity !=''">
                 locked_quantity = locked_quantity + #{ew.lockedQuantity},
             </if>
+            <if test="ew.source != null and ew.source != ''">
+                source = #{ew.source},
+            </if>
             update_time = now()
         </set>
         where product_model_id = #{ew.productModelId}
@@ -195,6 +198,7 @@
         from stock_uninventory su
         left join product_model pm on su.product_model_id = pm.id
         left join product p on pm.product_id = p.id
+        where COALESCE(su.type, 'unqualified') != 'waste'
         ) as combined
         <where>
             <if test="ew.productName != null and ew.productName !=''">
@@ -222,7 +226,7 @@
         unit,
         product_name,
         product_id
-        order by combined.create_time desc
+        order by MAX(create_time) desc
     </select>
 
     <select id="listStockInventoryExportData" resultType="com.ruoyi.stock.execl.StockInventoryExportData">
@@ -328,6 +332,7 @@
             from stock_uninventory su
             left join product_model pm on su.product_model_id = pm.id
             left join product p on pm.product_id = p.id
+            where COALESCE(su.type, 'unqualified') != 'waste'
         ) as combined
         <where>
             <if test="ew.productName != null and ew.productName !=''">

--
Gitblit v1.9.3