From c6e6ca1d8c04209de59db851ed34636aab179971 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期一, 15 十二月 2025 15:58:41 +0800
Subject: [PATCH] 质量管理列表按照检测日期倒序排序

---
 src/main/resources/mapper/production/SalesLedgerSchedulingMapper.xml |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/main/resources/mapper/production/SalesLedgerSchedulingMapper.xml b/src/main/resources/mapper/production/SalesLedgerSchedulingMapper.xml
index 6009d15..f0e3fc1 100644
--- a/src/main/resources/mapper/production/SalesLedgerSchedulingMapper.xml
+++ b/src/main/resources/mapper/production/SalesLedgerSchedulingMapper.xml
@@ -43,6 +43,10 @@
             </if>
         </where>
         GROUP BY T2.id
+        <if test="salesLedgerDto.status != null and salesLedgerDto.status.equals('true')">
+            HAVING quantity - schedulingNum > 0
+        </if>
+        order by T1.entry_date desc
     </select>
     <select id="list" resultType="com.ruoyi.production.dto.SalesLedgerSchedulingDto">
         SELECT
@@ -111,6 +115,6 @@
                 AND  T2.scheduling_date &lt;= DATE_FORMAT(#{salesLedgerDto.entryDateEnd},'%Y-%m-%d')
             </if>
         </where>
-        order by T2.status asc
+        order by T2.scheduling_date desc
     </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3