From 022c6d77a5c49aacd85f32cfb7af25417b82dafa Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期五, 24 四月 2026 15:29:14 +0800
Subject: [PATCH] feat(stock): 增加库存批号字段支持

---
 src/main/resources/mapper/stock/StockUninventoryMapper.xml |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/src/main/resources/mapper/stock/StockUninventoryMapper.xml b/src/main/resources/mapper/stock/StockUninventoryMapper.xml
index 58f30bd..70943e7 100644
--- a/src/main/resources/mapper/stock/StockUninventoryMapper.xml
+++ b/src/main/resources/mapper/stock/StockUninventoryMapper.xml
@@ -25,7 +25,15 @@
             </if>
             update_time = now()
         </set>
-        where product_model_id = #{ew.productModelId} and qualitity >= #{ew.qualitity}
+        where
+        product_model_id = #{ew.productModelId} and qualitity >= #{ew.qualitity}
+        <if test="ew.batchNo == null">
+            and batch_no is null
+        </if>
+        <if test="ew.batchNo != null">
+            and batch_no = #{ew.batchNo}
+        </if>
+
     </update>
     <update id="updateAddStockUnInventory">
         update stock_uninventory
@@ -45,6 +53,12 @@
             update_time = now()
         </set>
         where product_model_id = #{ew.productModelId}
+        <if test="ew.batchNo == null">
+            and batch_no is null
+        </if>
+        <if test="ew.batchNo != null">
+            and batch_no = #{ew.batchNo}
+        </if>
     </update>
     <select id="pageStockUninventory" resultType="com.ruoyi.stock.dto.StockUninventoryDto">
         select su.id,

--
Gitblit v1.9.3