From 47806d9e390ee00e1d29ad1da8c1aa908882a758 Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期二, 11 八月 2026 14:43:59 +0800
Subject: [PATCH] 用河南鹤壁代码覆盖山西长治

---
 src/main/resources/mapper/stock/StockInRecordMapper.xml |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/main/resources/mapper/stock/StockInRecordMapper.xml b/src/main/resources/mapper/stock/StockInRecordMapper.xml
index 3e10e2b..55c589b 100644
--- a/src/main/resources/mapper/stock/StockInRecordMapper.xml
+++ b/src/main/resources/mapper/stock/StockInRecordMapper.xml
@@ -21,11 +21,11 @@
         pm.unit,
         u.nick_name as createBy,
         CASE
-            WHEN TRIM(sir.record_type) = '7' THEN
+            WHEN #{params.topParentProductId} = 3 AND TRIM(sir.record_type) = '7' THEN
                 COALESCE(pl_by_product.purchase_contract_number, pl_direct.purchase_contract_number)
-            WHEN TRIM(sir.record_type) = '10' THEN
+            WHEN #{params.topParentProductId} = 3 AND TRIM(sir.record_type) = '10' THEN
                 pl_by_quality.purchase_contract_number
-            WHEN #{params.topParentProductId} = 276 THEN
+            WHEN #{params.topParentProductId} = 1 THEN
                 CASE
                     WHEN TRIM(sir.record_type) IN ('14', '15') THEN
                         sl_return.sales_contract_no
@@ -132,7 +132,7 @@
                 and p.id in (select id from product_tree)
             </if>
         </where>
-        order by sir.id desc
+        order by sir.create_time desc
     </select>
     <select id="listStockInRecordExportData" resultType="com.ruoyi.stock.execl.StockInRecordExportData">
         SELECT
@@ -159,7 +159,7 @@
                 and sir.record_type = #{params.recordType}
             </if>
         </where>
-        order by sir.id desc
+        order by sir.create_time desc
     </select>
     <select id="listPageAccountPurchase" resultType="com.ruoyi.account.bean.vo.purchase.PurchaseInboundVo">
         SELECT

--
Gitblit v1.9.3