From 2cad0284bd59efd17be1da8b122a983d9cbdbac5 Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期五, 28 六月 2024 17:04:06 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeCardOperateMapper.xml |   84 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 83 insertions(+), 1 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeCardOperateMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeCardOperateMapper.xml
index ce7af1c..d9fa1de 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeCardOperateMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeCardOperateMapper.xml
@@ -387,7 +387,7 @@
   </select>
 
   <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇寮�鍗¤褰�-->
-  <select id="getActiveCards" resultType="com.dy.pipIrrGlobal.voSe.VoActiveCardNew">
+  <select id="getActiveCards" resultType="com.dy.pipIrrGlobal.voSe.VoActiveCard">
     SELECT
     CAST(ope.id AS char) AS id ,
     cli.name AS clientName,
@@ -481,6 +481,76 @@
 
       <if test = "activeTimeStart != null and activeTimeStop != null">
         AND ope.operate_dt BETWEEN #{reissueCardTimeStart} AND #{reissueCardTimeStop}
+      </if>
+    </where>
+    ORDER BY ope.operate_dt 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="getCommonOperationRecordCount" parameterType="java.util.Map" resultType="java.lang.Long">
+    select
+        COUNT(*) AS recordCount
+    FROM se_card_operate ope
+        INNER JOIN se_client cli ON ope.client_id = cli.id
+        INNER JOIN se_client_card card ON ope.card_id = card.id
+        INNER JOIN ba_user us ON ope.operator = us.id
+    <where>
+      <if test = "operateType != null and operateType > 0">
+        AND ope.operate_type = ${operateType}
+      </if>
+
+      <if test = "clientName != null and clientName !=''">
+        AND cli.name like CONCAT('%',#{clientName},'%')
+      </if>
+
+      <if test = "cardNum != null and cardNum !=''">
+        AND card.cardNum like CONCAT('%',#{cardNum},'%')
+      </if>
+
+      <if test = "timeStart != null and timeStop != null">
+        AND ope.operate_dt BETWEEN #{timeStart} AND #{timeStop}
+      </if>
+    </where>
+  </select>
+
+  <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇閫氱敤鎿嶄綔璁板綍-->
+  <select id="getCommonOperations" resultType="com.dy.pipIrrGlobal.voSe.VoOperate">
+    SELECT
+        cli.name AS clientName,
+        cli.clientNum,
+        CAST(card.cardNum AS char) AS cardNum,
+        us.name AS operator,
+        ope.operate_dt AS operateDt,
+        IFNULL(ope.trade_amount,0) AS refund,
+        (CASE
+            WHEN ope.payment_id = 1 THEN "鐜伴噾"
+        END) AS refundTypeName,
+        card.money,
+        IFNULL(ope.system_balance,0) AS systemBalance
+    FROM se_card_operate ope
+        INNER JOIN se_client cli ON ope.client_id = cli.id
+        INNER JOIN se_client_card card ON ope.card_id = card.id
+        INNER JOIN ba_user us ON ope.operator = us.id
+    <where>
+      <if test = "operateType != null and operateType > 0">
+        AND ope.operate_type = ${operateType}
+      </if>
+
+      <if test = "clientName != null and clientName !=''">
+        AND cli.name like CONCAT('%',#{clientName},'%')
+      </if>
+
+      <if test = "cardNum != null and cardNum !=''">
+        AND card.cardNum like CONCAT('%',#{cardNum},'%')
+      </if>
+
+      <if test = "timeStart != null and timeStop != null">
+        AND ope.operate_dt BETWEEN #{timeStart} AND #{timeStop}
       </if>
     </where>
     ORDER BY ope.operate_dt DESC
@@ -595,4 +665,16 @@
       </if>
     </where>
   </select>
+
+  <!--鏍规嵁姘村崱缂栧彿鑾峰彇鍏舵寕澶辨椂閫�娆鹃噾棰濓紙琛ュ崱鏃跺垽鏂娇鐢級-->
+  <select id="getTradeAmountByCardNo" resultType="java.lang.Double">
+    SELECT
+    ope.trade_amount AS tradeAmount
+    FROM se_client_card card
+    INNER JOIN se_card_operate ope ON ope.card_id = card.id
+    <where>
+      AND ope.operate_type = 6
+      AND card.cardNum = #{cardNum}
+    </where>
+  </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0