From a64774b3898c4ce8e7d3aa0ccc3c4ee92861d2a6 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期四, 21 五月 2026 15:03:51 +0800
Subject: [PATCH] Merge branch 'dev_New_pro' of http://114.132.189.42:9002/r/product-inventory-management-after into dev_New_pro

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

diff --git a/src/main/resources/mapper/stock/StockInventoryMapper.xml b/src/main/resources/mapper/stock/StockInventoryMapper.xml
index 4820533..428e8da 100644
--- a/src/main/resources/mapper/stock/StockInventoryMapper.xml
+++ b/src/main/resources/mapper/stock/StockInventoryMapper.xml
@@ -209,6 +209,12 @@
             <if test="ew.topParentProductId != null and ew.topParentProductId > 0">
                 and combined.product_id in (select id from product_tree)
             </if>
+            <if test="ew.model != null and ew.model !=''">
+                and combined.model like concat('%',#{ew.model},'%')
+            </if>
+            <if test="ew.batchNo != null and ew.batchNo !=''">
+                and combined.batch_no like concat('%',#{ew.batchNo},'%')
+            </if>
         </where>
         group by
         product_model_id,
@@ -525,6 +531,7 @@
                     group by spd.stock_inventory_id
                  ) as sd on sd.stock_inventory_id = si.id
         where si.product_model_id = #{productModelId}
+        and si.qualitity > IFNULL(sd.qualitity, 0)
     </select>
 
     <select id="getBatchNoQty" resultType="com.ruoyi.stock.dto.StockInventoryDto">

--
Gitblit v1.9.3