From 4e7cc75a569c4e3ec31343fc5cec9db48b7acb0b Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期三, 15 四月 2026 16:02:57 +0800
Subject: [PATCH] refactor(ProductModelService): 优化部门ID查询条件判断逻辑

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

diff --git a/src/main/resources/mapper/stock/StockInventoryMapper.xml b/src/main/resources/mapper/stock/StockInventoryMapper.xml
index fd44dcd..5be7130 100644
--- a/src/main/resources/mapper/stock/StockInventoryMapper.xml
+++ b/src/main/resources/mapper/stock/StockInventoryMapper.xml
@@ -19,6 +19,9 @@
             <if test="ew.qualitity != null">
                 qualitity = qualitity + #{ew.qualitity},
             </if>
+            <if test="ew.subQualitity != null">
+                sub_qualitity = sub_qualitity + #{ew.subQualitity},
+            </if>
             <if test="ew.version != null">
                 version = version + 1,
             </if>
@@ -30,6 +33,15 @@
             </if>
             <if test="ew.lockedQuantity != null and ew.lockedQuantity !=''">
                 locked_quantity = locked_quantity + #{ew.lockedQuantity},
+            </if>
+            <if test="ew.warehouseCode != null and ew.warehouseCode !=''">
+                warehouse_code = #{ew.warehouseCode},
+            </if>
+            <if test="ew.warehouseName != null and ew.warehouseName !=''">
+                warehouse_name = #{ew.warehouseName},
+            </if>
+            <if test="ew.productCode != null and ew.productCode !=''">
+                product_code = #{ew.productCode},
             </if>
             update_time = now()
         </set>
@@ -73,6 +85,7 @@
         )
         select si.id,
         si.qualitity,
+        si.sub_qualitity,
         COALESCE(si.locked_quantity, 0) as locked_quantity,
         si.product_model_id,
         si.create_time,
@@ -82,7 +95,11 @@
         (si.qualitity - COALESCE(si.locked_quantity, 0)) as un_locked_quantity,
         pm.model,
         si.remark,
+        si.warehouse_code,
+        si.warehouse_name,
+        si.product_code,
         pm.unit,
+        pm.sub_unit,
         p.product_name
         from stock_inventory si
         left join product_model pm on si.product_model_id = pm.id

--
Gitblit v1.9.3