From e93af9a26dfdedfa47c982151e8f8f0b3d65645b Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期五, 22 五月 2026 09:20:06 +0800
Subject: [PATCH] fix(ai): 解决记录类型字符串前后空格导致的数据映射问题

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

diff --git a/src/main/resources/mapper/stock/StockInventoryMapper.xml b/src/main/resources/mapper/stock/StockInventoryMapper.xml
index c71ce31..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,

--
Gitblit v1.9.3