From 2d5d8691bdfcfadcc37240c0224e242fe32dc738 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期一, 15 六月 2026 13:20:22 +0800
Subject: [PATCH] fix: 客户往来明细根据签订日期排序

---
 src/main/resources/mapper/basic/CustomerMapper.xml |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/main/resources/mapper/basic/CustomerMapper.xml b/src/main/resources/mapper/basic/CustomerMapper.xml
index 99a5a28..ed0e3c8 100644
--- a/src/main/resources/mapper/basic/CustomerMapper.xml
+++ b/src/main/resources/mapper/basic/CustomerMapper.xml
@@ -33,11 +33,11 @@
                 and customer_type = #{c.customerType}
             </if>
             <!-- 鍏捣鏌ヨ锛歵ype = 1锛堝叕娴峰鎴凤級-->
-            <if test="c.type != null and c.type == 1">
+            <!--<if test="c.type != null and c.type == 1">
                 and type = #{c.type}
-            </if>
+            </if>-->
             <!-- 绉佹捣鏌ヨ锛歵ype = 0锛堢娴峰鎴凤級鎴栬�� type = 1锛堝叕娴峰鎴凤級涓斿凡琚垎閰嶏紝骞朵笖鏄嚜宸遍鐢ㄣ�佽嚜宸卞垱寤烘垨鑰呭叡浜粰鑷繁鐨勫鎴� -->
-            <if test="c.type != null and c.type == 0">
+            <!--<if test="c.type != null and c.type == 0">
                 and (
                     (type = #{c.type} or (type = 1 and is_assigned = 1))
                     and (
@@ -50,8 +50,9 @@
                         )
                     )
                 )
-            </if>
+            </if>-->
         </where>
+        order by create_time desc
     </select>
 
     <select id="list" resultType="com.ruoyi.basic.vo.CustomerVo">
@@ -87,11 +88,11 @@
                 and customer_type = #{c.customerType}
             </if>
             <!-- 鍏捣鏌ヨ锛歵ype = 1锛堝叕娴峰鎴凤級-->
-            <if test="c.type != null and c.type == 1">
+            <!--<if test="c.type != null and c.type == 1">
                 and type = #{c.type}
-            </if>
+            </if>-->
             <!-- 绉佹捣鏌ヨ锛歵ype = 0锛堢娴峰鎴凤級鎴栬�� type = 1锛堝叕娴峰鎴凤級涓斿凡琚垎閰嶏紝骞朵笖鏄嚜宸遍鐢ㄣ�佽嚜宸卞垱寤烘垨鑰呭叡浜粰鑷繁鐨勫鎴� -->
-            <if test="c.type != null and c.type == 0">
+            <!--<if test="c.type != null and c.type == 0">
                 and (
                     (type = #{c.type} or (type = 1 and is_assigned = 1))
                     and (
@@ -104,7 +105,7 @@
                         )
                     )
                 )
-            </if>
+            </if>-->
         </where>
     </select>
 
@@ -159,5 +160,6 @@
             group by  sl.id
         )T2 on T2.id = sl.id
         where sl.customer_id = #{customerId}
+        order by sl.execution_date
     </select>
 </mapper>

--
Gitblit v1.9.3