From bf84fec7d8dd5e7fbcc93030b8d83da7ec0ece91 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期五, 03 四月 2026 15:39:36 +0800
Subject: [PATCH] yys

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

diff --git a/src/main/resources/mapper/stock/StockInventoryMapper.xml b/src/main/resources/mapper/stock/StockInventoryMapper.xml
index 79b08cd..44d0941 100644
--- a/src/main/resources/mapper/stock/StockInventoryMapper.xml
+++ b/src/main/resources/mapper/stock/StockInventoryMapper.xml
@@ -63,14 +63,18 @@
         (si.qualitity - COALESCE(si.locked_quantity, 0)) as un_locked_quantity,
         pm.model,
         si.remark,
+        si.stock_location,
         pm.unit,
         p.product_name
         from stock_inventory si
         left join product_model pm on si.product_model_id = pm.id
         left join product p on pm.product_id = p.id
-        where 1 = 1
+        where pm.product_type = #{ew.productType}
         <if test="ew.productName != null and ew.productName !=''">
             and p.product_name like concat('%',#{ew.productName},'%')
+        </if>
+        <if test="ew.productModelId != null">
+            and pm.id = #{ew.productModelId}
         </if>
     </select>
     <select id="listStockInventoryExportData" resultType="com.ruoyi.stock.execl.StockInventoryExportData">
@@ -91,15 +95,17 @@
         </if>
     </select>
     <select id="stockInventoryPage" resultType="com.ruoyi.stock.dto.StockInRecordDto">
-        select sir.*,si.qualitity,
+        select sir.*,si.qualitity as current_stock,
         pm.model,
         pm.unit,
-        p.product_name
+        p.product_name,
+        su.nick_name as create_by
         from
         stock_in_record sir
         left join stock_inventory si on sir.product_model_id = si.product_model_id
         left join product_model pm on sir.product_model_id = pm.id
         left join product p on pm.product_id = p.id
+        left join sys_user su on sir.create_user = su.user_id
         <where>
             <if test="ew.reportDate != null">
                 and sir.create_time >= #{ew.reportDate}

--
Gitblit v1.9.3