From eb04fd37f070e52920032f850826e0e12fb48c64 Mon Sep 17 00:00:00 2001
From: longz <longzhaoz@qq.com>
Date: 星期二, 21 七月 2026 11:50:39 +0800
Subject: [PATCH] fix: 优化退款订单分页查询

---
 ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml b/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml
index 64cb936..49b469e 100644
--- a/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml
+++ b/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml
@@ -300,6 +300,7 @@
         co.create_time as pay_time,
         co.id as order_id,
         co.app_user_id as user_id,
+        co.site_id as site_id,
         co.pay_method as pay_method,
         1 as type
         FROM t_charging_order_refund re
@@ -324,6 +325,7 @@
         so.create_time as pay_time,
         so.id as order_id,
         so.app_user_id as user_id,
+        null as site_id,
         3 as pay_method,
         2 as type
         FROM t_shopping_order_refund re
@@ -348,6 +350,7 @@
         vo.create_time as pay_time,
         vo.id as order_id,
         vo.app_user_id as user_id,
+        null as site_id,
         3 as pay_method,
         3 as type
         FROM t_vip_order_refund vr
@@ -366,6 +369,13 @@
             <if test="data.specialRefund != null and data.specialRefund">
                 AND o.refund_title = '特殊退款处理'
             </if>
+            <if test="data.siteIds != null and data.siteIds.size() > 0">
+                AND (o.type != 1 OR o.site_id IN
+                <foreach collection="data.siteIds" item="siteId" open="(" separator="," close=")">
+                    #{siteId}
+                </foreach>
+                )
+            </if>
         </where>
         order by o.refund_time desc
 

--
Gitblit v1.7.1