From e5c29d6ac2b210a9385723598d79a42ae5a9679e Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期三, 23 四月 2025 15:20:13 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeReversalMapper.xml |   78 ++++++++++++++++----------------------
 1 files changed, 33 insertions(+), 45 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeReversalMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeReversalMapper.xml
index 0f5d2e2..9e39644 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeReversalMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeReversalMapper.xml
@@ -30,28 +30,15 @@
     where id = #{id,jdbcType=BIGINT}
   </delete>
 
-  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeReversal">
+  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeReversal">
     <!--@mbg.generated-->
-    insert into se_reversal (id, cardId, clientId, cardBalance, systemBalance, remarks, `operator`, operateDt)
-    values (#{id,jdbcType=BIGINT},
-            #{cardid,jdbcType=BIGINT},
-            #{clientid,jdbcType=BIGINT},
-            #{cardbalance,jdbcType=FLOAT},
-            #{systembalance,jdbcType=FLOAT},
-            #{remarks,jdbcType=VARCHAR},
-            #{operator,jdbcType=BIGINT},
-            #{operatedt,jdbcType=TIMESTAMP})
+    insert into se_reversal (id, cardId, clientId, cardBalance,
+      systemBalance, remarks, `operator`, 
+      operateDt)
+    values (#{id,jdbcType=BIGINT}, #{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{cardbalance,jdbcType=FLOAT},
+      #{systembalance,jdbcType=FLOAT}, #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, 
+      #{operatedt,jdbcType=TIMESTAMP})
   </insert>
-
-<!--  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeReversal" useGeneratedKeys="true">-->
-<!--    &lt;!&ndash;@mbg.generated&ndash;&gt;-->
-<!--    insert into se_reversal (cardId, clientId, cardBalance, -->
-<!--      systemBalance, remarks, `operator`, -->
-<!--      operateDt)-->
-<!--    values (#{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{cardbalance,jdbcType=FLOAT}, -->
-<!--      #{systembalance,jdbcType=FLOAT}, #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, -->
-<!--      #{operatedt,jdbcType=TIMESTAMP})-->
-<!--  </insert>-->
 
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeReversal" useGeneratedKeys="true">
     <!--@mbg.generated-->
@@ -143,26 +130,25 @@
       operateDt = #{operatedt,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=BIGINT}
   </update>
-
   <!--鏍规嵁鎸囧畾鐨勬潯浠惰幏鍙栧啿姝h褰曟暟-->
   <select id="getRecordCount" parameterType="java.util.Map" resultType="java.lang.Long">
     SELECT
-    COUNT(*) AS recordCount
-    FROM se_client_card card
-    INNER JOIN se_reversal rev ON rev.cardId = card.id
-    INNER JOIN ba_client cli ON	 card.clientId = cli.id
+        COUNT(*) AS recordCount
+    FROM se_reversal rev
+    INNER JOIN se_client_card card ON rev.cardId = card.id
+    INNER JOIN se_client cli ON rev.clientId = cli.id
     , (SELECT @i:=0) AS itable
     <where>
       <if test = "clientName != null and clientName !=''">
         AND cli.name like CONCAT('%',#{clientName},'%')
       </if>
 
-      <if test = "cardAddr != null and cardAddr !=''">
-        AND card.cardAddr like CONCAT('%',#{cardAddr},'%')
+      <if test = "cardNum != null and cardNum !=''">
+        AND card.cardNum like CONCAT('%',#{cardNum},'%')
       </if>
 
-      <if test = "reversallTimeStart != null and reversalTimeStop != null">
-        AND card.unlockDt BETWEEN #{reversallTimeStart} AND #{reversalTimeStop}
+      <if test = "reversalTimeStart != null and reversalTimeStop != null">
+        AND rev.operateDt BETWEEN #{reversalTimeStart} AND #{reversalTimeStop}
       </if>
     </where>
   </select>
@@ -170,33 +156,35 @@
   <!--鏍规嵁鎸囧畾鐨勬潯浠惰幏鍙栧啿姝h褰�-->
   <select id="getReversals" resultType="com.dy.pipIrrGlobal.voSe.VoReversal">
     SELECT
-        (@i:=@i+1) AS id,
-        cli.`name` AS clientName,
-        cli.id AS clientId,
-        card.cardAddr,
-        rev.cardBalance,
-        (SELECT `name` FROM ba_user WHERE id =  rev.operator) AS operator,
-        rev.operateDt
+      (@i:=@i+1) AS id,
+      cli.`name` AS clientName,
+      cli.clientNum,
+      card.cardNum,
+      rev.cardBalance,
+      (SELECT `name` FROM ba_user WHERE id =  rev.operator) AS operator,
+      rev.operateDt
     FROM se_reversal rev
-        INNER JOIN se_client_card card ON rev.cardId = card.id
-        INNER JOIN ba_client cli ON rev.clientId = cli.id
-        , (SELECT @i:=0) AS itable
+      INNER JOIN se_client_card card ON rev.cardId = card.id
+      INNER JOIN se_client cli ON rev.clientId = cli.id
+      , (SELECT @i:=0) AS itable
     <where>
       <if test = "clientName != null and clientName !=''">
         AND cli.name like CONCAT('%',#{clientName},'%')
       </if>
 
-      <if test = "cardAddr != null and cardAddr !=''">
-        AND card.cardAddr like CONCAT('%',#{cardAddr},'%')
+      <if test = "cardNum != null and cardNum !=''">
+        AND card.cardNum like CONCAT('%',#{cardNum},'%')
       </if>
 
       <if test = "reversalTimeStart != null and reversalTimeStop != null">
         AND rev.operateDt BETWEEN #{reversalTimeStart} AND #{reversalTimeStop}
       </if>
     </where>
-
-    <if test="pageCurr != null and pageSize != null">
-      LIMIT ${pageCurr}, ${pageSize}
-    </if>
+    ORDER BY rev.operateDt DESC
+    <trim prefix="limit " >
+      <if test="start != null and count != null">
+        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+      </if>
+    </trim>
   </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0