From ae3dd677f3bbbc26d7c41aebc0e6048e2d20593c Mon Sep 17 00:00:00 2001
From: 陶杰 <1378534974@qq.com>
Date: 星期六, 21 十二月 2024 14:58:43 +0800
Subject: [PATCH] 1.花材统计报表:增加父类名称

---
 src/main/resources/mapper/payment/OrderSettlementMapper.xml |   36 +++++++++++++++++++++++++++++++++++-
 1 files changed, 35 insertions(+), 1 deletions(-)

diff --git a/src/main/resources/mapper/payment/OrderSettlementMapper.xml b/src/main/resources/mapper/payment/OrderSettlementMapper.xml
index a318b4b..0be30c2 100644
--- a/src/main/resources/mapper/payment/OrderSettlementMapper.xml
+++ b/src/main/resources/mapper/payment/OrderSettlementMapper.xml
@@ -23,8 +23,42 @@
         <if test="condition.endDate != null">
             AND s.create_time &lt;= #{condition.endDate}
         </if>
+        <if test="condition.userName != null and condition.userName != ''">
+            AND (si.name LIKE CONCAT('%', #{condition.userName}, '%') OR pi.name LIKE CONCAT('%', #{condition.userName}, '%'))
+        </if>
+        ORDER BY s.create_time desc, userName
+    </select>
 
-        ORDER BY s.create_time desc
+
+    <select id="selectSettlementListInfo" resultType="com.mzl.flower.dto.response.payment.OrderSettlementListDTO">
+        SELECT s.*, ifnull(si.name, pi.name) userName,
+        code.label as statusStr,
+        code2.label as typeStr
+        FROM t_order_settlement s
+        left join t_supplier_info si on s.user_id = si.user_id
+        left join t_partner_info pi on s.user_id = pi.user_id
+        LEFT JOIN (SELECT ct.label, ct.value from t_code_value ct where type_code = 'SETTLEMENT_STATUS') code ON s.status = code.value
+        LEFT JOIN (SELECT ct.label, ct.value from t_code_value ct where type_code = 'SETTLEMENT_TYPE') code2 ON s.type = code2.value
+        WHERE s.deleted = 0
+        <if test="condition.userId != null and condition.userId != ''">
+            AND s.user_id = #{condition.userId}
+        </if>
+        <if test="condition.type != null and condition.type != ''">
+            AND s.type = #{condition.type}
+        </if>
+        <if test="condition.status != null and condition.status != ''">
+            AND s.status = #{condition.status}
+        </if>
+        <if test="condition.startDate != null">
+            AND s.create_time &gt;= #{condition.startDate}
+        </if>
+        <if test="condition.endDate != null">
+            AND s.create_time &lt;= #{condition.endDate}
+        </if>
+        <if test="condition.userName != null and condition.userName != ''">
+            AND (si.name LIKE CONCAT('%', #{condition.userName}, '%') OR pi.name LIKE CONCAT('%', #{condition.userName}, '%'))
+        </if>
+        ORDER BY s.create_time desc, userName
     </select>
 
     <select id="getUserIncome" resultType="java.math.BigDecimal">

--
Gitblit v1.9.3