From 8bcb47b7ea268061f4629e0953de4e3597fca690 Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期二, 16 七月 2024 22:16:53 +0800
Subject: [PATCH] 2024-07-16 朱宝民

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRefundMapper.xml |   73 ++++++++++++++++++++++++++++++++++++
 1 files changed, 73 insertions(+), 0 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRefundMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRefundMapper.xml
index d19093c..e928160 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRefundMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRefundMapper.xml
@@ -170,4 +170,77 @@
       remarks = #{remarks,jdbcType=VARCHAR}
     where id = #{id,jdbcType=BIGINT}
   </update>
+
+  <!--鏍规嵁閽卞寘ID鑾峰彇寰呭鏍哥殑閫�娆剧敵璇峰璞�-->
+  <select id="getRefundByWallerId" parameterType="java.lang.Long" resultMap="BaseResultMap">
+    select
+        <include refid="Base_Column_List" />
+    from se_refund
+    where refund_status = 1 AND wallet_id = ${walletId}
+  </select>
+
+  <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鐢靛瓙閽卞寘閫�娆捐褰曟暟-->
+  <select id="getRecordCount" parameterType="java.util.Map" resultType="java.lang.Long">
+    SELECT
+        COUNT(*) AS recordCount
+    FROM se_refund ref
+        INNER JOIN se_client cli ON ref.client_id = cli.id
+    <where>
+      <if test = "refundStatus != null and refundStatus > 0">
+        AND ref.refund_status = ${refundStatus}
+      </if>
+
+      <if test = "clientName != null and clientName !=''">
+        AND cli.name like CONCAT('%',#{clientName},'%')
+      </if>
+    </where>
+  </select>
+
+  <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鐢靛瓙閽卞寘閫�娆捐褰�-->
+  <select id="getWalletRefunds" resultType="com.dy.pipIrrGlobal.voSe.VoWalletRefund">
+    SELECT
+        cli.`name`,
+        cli.clientNum,
+        cli.phone,
+        ref.refund_amount AS refundAmount,
+        ref.application_time AS applicationTime,
+        ref.refund_status AS refundStatus,
+        (CASE
+            WHEN ref.refund_status = 1 THEN '鏈��娆�'
+            WHEN ref.refund_status = 2 THEN '宸查��娆�'
+        End) AS refundStatusName,
+        ref.audit_time AS auditTime,
+        ref.remarks
+    FROM se_refund ref
+        INNER JOIN se_client cli ON ref.client_id = cli.id
+    <where>
+      <if test = "refundStatus != null and refundStatus > 0">
+        AND ref.refund_status = ${refundStatus}
+      </if>
+
+      <if test = "clientName != null and clientName !=''">
+        AND cli.name like CONCAT('%',#{clientName},'%')
+      </if>
+    </where>
+    ORDER BY ref.application_time DESC
+    <trim prefix="limit " >
+      <if test="start != null and count != null">
+        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+      </if>
+    </trim>
+  </select>
+
+  <!--鑾峰彇鎸囧畾鏃ユ湡寰俊閫�娆撅紙鍙绠楀凡閫�鐨勶級鎬婚锛岃储鍔″璐﹀鏍搁〉浣跨敤-->
+  <select id="getRefundSum" resultType="java.lang.Double">
+    SELECT
+        SUM(refund_amount) AS tradeAmount
+    FROM se_refund
+    <where>
+      AND refund_status = 2
+      <if test = "tradeDate != null and tradeDate !=''">
+        AND Date(audit_time) = #{tradeDate}
+      </if>
+    </where>
+    GROUP BY Date(audit_time)
+  </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0