From 421baf13d77f06cd4a9df045caff5d63e2c2fd6f Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期一, 14 九月 2026 20:42:27 +0800
Subject: [PATCH] fix: 修改库存查询排序逻辑,确保按最大创建时间和创建时间升序排列
---
src/main/resources/mapper/stock/StockInventoryMapper.xml | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/main/resources/mapper/stock/StockInventoryMapper.xml b/src/main/resources/mapper/stock/StockInventoryMapper.xml
index 3dd2089..2681163 100644
--- a/src/main/resources/mapper/stock/StockInventoryMapper.xml
+++ b/src/main/resources/mapper/stock/StockInventoryMapper.xml
@@ -222,7 +222,7 @@
unit,
product_name,
product_id
- order by combined.id desc
+ order by MAX(combined.create_time) desc
</select>
<select id="listStockInventoryExportData" resultType="com.ruoyi.stock.execl.StockInventoryExportData">
@@ -537,6 +537,7 @@
left join product p on pm.product_id = p.id
where si.product_model_id = #{productModelId}
and si.qualitity > IFNULL(sd.qualitity, 0)
+ order by si.create_time asc
</select>
<select id="getBatchNoQty" resultType="com.ruoyi.stock.dto.StockInventoryDto">
--
Gitblit v1.9.3