From f4ef309891c458b09e6d157f4ec57c32c695d199 Mon Sep 17 00:00:00 2001
From: buhuazhen <hua100783@gmail.com>
Date: 星期二, 24 三月 2026 10:26:32 +0800
Subject: [PATCH] feat(stock): 新增入库单创建人名称字段

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

diff --git a/src/main/resources/mapper/stock/StockInventoryMapper.xml b/src/main/resources/mapper/stock/StockInventoryMapper.xml
index 7fe1f4f..90fa756 100644
--- a/src/main/resources/mapper/stock/StockInventoryMapper.xml
+++ b/src/main/resources/mapper/stock/StockInventoryMapper.xml
@@ -64,13 +64,21 @@
         pm.model,
         si.remark,
         pm.unit,
-        p.product_name
+        p.product_name,
+        pm.url,
+        pm.height,
+        pm.box_num,
+        pm. dollar_price,
+        pm.tax_inclusive_unit_price
         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
         <if test="ew.productName != null and ew.productName !=''">
             and p.product_name like concat('%',#{ew.productName},'%')
+        </if>
+        <if test="ew.parentId != null">
+            and p.parent_id = #{ew.parentId}
         </if>
     </select>
     <select id="listStockInventoryExportData" resultType="com.ruoyi.stock.execl.StockInventoryExportData">
@@ -234,5 +242,33 @@
         GROUP BY DATE(sor.create_time)
         ORDER BY DATE(sor.create_time) ASC
     </select>
+    <select id="getStcokById" resultType="com.ruoyi.stock.dto.StockInventoryDto">
+        select si.id,
+               si.qualitity,
+               COALESCE(si.locked_quantity, 0) as locked_quantity,
+               si.product_model_id,
+               si.create_time,
+               si.update_time,
+               COALESCE(si.warn_num, 0) as warn_num,
+               si.version,
+               (si.qualitity - COALESCE(si.locked_quantity, 0)) as un_locked_quantity,
+               pm.model,
+               si.remark,
+               pm.unit,
+               p.product_name,
+               pm.url,
+               pm.height,
+               pm.box_num,
+               pm. dollar_price,
+               pm.tax_inclusive_unit_price,
+<!--               si.create_by-->
+               t2.nick_name as create_user_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
+                left join stock_in_record t1 on t1.product_model_id = si.product_model_id
+                left join sys_user t2 on t1.create_user = t2.user_id
+        where si.id = #{id}
+    </select>
 
 </mapper>

--
Gitblit v1.9.3