From 6b90436a61338d46282bf724e445e90af80461e1 Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期三, 27 十二月 2023 10:34:25 +0800
Subject: [PATCH] 2023-12-27 朱宝民 增加了交易记录查询 使分页具有兼容性

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientCardMapper.xml |   58 ++++++++++++++++++++++++++++++++--------------------------
 1 files changed, 32 insertions(+), 26 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientCardMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientCardMapper.xml
index 0b3cbec..4bf5062 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientCardMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientCardMapper.xml
@@ -6,8 +6,8 @@
     <!--@Table se_client_card-->
     <id column="id" jdbcType="BIGINT" property="id" />
     <result column="cardAddr" jdbcType="VARCHAR" property="cardaddr" />
-    <result column="cardNum" jdbcType="VARCHAR" property="cardnum" />
-    <result column="clientNum" jdbcType="VARCHAR" property="clientnum" />
+    <result column="cardNum" jdbcType="BIGINT" property="cardnum" />
+    <result column="clientId" jdbcType="BIGINT" property="clientid" />
     <result column="money" jdbcType="FLOAT" property="money" />
     <result column="state" jdbcType="TINYINT" property="state" />
     <result column="createDt" jdbcType="TIMESTAMP" property="createdt" />
@@ -23,7 +23,7 @@
   </resultMap>
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
-    id, cardAddr, cardNum, clientNum, money, `state`, createDt, replaceDt, rechargeDt, 
+    id, cardAddr, cardNum, clientId, money, `state`, createDt, replaceDt, rechargeDt, 
     lossDtDt, cancelDt, unlockDt, reversalDt, consumeDt, lastOper, remarks
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@@ -51,11 +51,18 @@
 
   <!--鏍规嵁姘村崱缂栧彿鑾峰彇姘村崱琛ㄤ富閿強鍐滄埛缂栧彿-->
   <select id="getCardIdAndClientNum" resultType="java.util.Map">
-    SELECT id AS cardId, clientNum FROM se_client_card WHERE cardNum = #{cardNum}
+<!--    SELECT id AS cardId, clientNum FROM se_client_card WHERE cardNum = #{cardNum}-->
+    SELECT
+        card.id AS cardId,
+        cli.clientNum,
+        cli.id AS clientId
+    FROM se_client_card card
+        INNER JOIN se_client cli ON card.clientId = cli.id
+    WHERE card.cardNum = #{cardNum}
   </select>
 
 
-  <!--鏍规嵁琛屾斂鍖哄垝涓叉ā鍧楁煡璇㈡按鍗$紪鍙�-->
+  <!--鏍规嵁琛屾斂鍖哄垝涓叉ā绯婃煡璇㈡按鍗$紪鍙�-->
   <select id="getCardNumOfMax"  resultType="java.lang.String">
     SELECT cardNum
     FROM se_client_card
@@ -64,23 +71,22 @@
     LIMIT 0,1
   </select>
 
-  <!--娣诲姞姘村崱璁板綍-->
-  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard" useGeneratedKeys="true">
+  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard">
     <!--@mbg.generated-->
-    insert into se_client_card (id, cardAddr, cardNum, clientNum,
-      money, `state`, createDt,
-      replaceDt, rechargeDt, lossDtDt,
-      cancelDt, unlockDt, reversalDt,
+    insert into se_client_card (id, cardAddr, cardNum, clientId,
+      money, `state`, createDt, 
+      replaceDt, rechargeDt, lossDtDt, 
+      cancelDt, unlockDt, reversalDt, 
       consumeDt, lastOper, remarks
       )
-    values (#{id,jdbcType=BIGINT}, #{cardaddr,jdbcType=VARCHAR}, #{cardnum,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR},
-      #{money,jdbcType=FLOAT}, #{state,jdbcType=TINYINT}, #{createdt,jdbcType=TIMESTAMP},
-      #{replacedt,jdbcType=TIMESTAMP}, #{rechargedt,jdbcType=TIMESTAMP}, #{lossdtdt,jdbcType=TIMESTAMP},
-      #{canceldt,jdbcType=TIMESTAMP}, #{unlockdt,jdbcType=TIMESTAMP}, #{reversaldt,jdbcType=TIMESTAMP},
+    values (#{id,jdbcType=BIGINT}, #{cardaddr,jdbcType=VARCHAR}, #{cardnum,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT},
+      #{money,jdbcType=FLOAT}, #{state,jdbcType=TINYINT}, #{createdt,jdbcType=TIMESTAMP}, 
+      #{replacedt,jdbcType=TIMESTAMP}, #{rechargedt,jdbcType=TIMESTAMP}, #{lossdtdt,jdbcType=TIMESTAMP}, 
+      #{canceldt,jdbcType=TIMESTAMP}, #{unlockdt,jdbcType=TIMESTAMP}, #{reversaldt,jdbcType=TIMESTAMP}, 
       #{consumedt,jdbcType=TIMESTAMP}, #{lastoper,jdbcType=TINYINT}, #{remarks,jdbcType=VARCHAR}
       )
-  </insert>
 
+  </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard" useGeneratedKeys="true">
     <!--@mbg.generated-->
     insert into se_client_card
@@ -91,8 +97,8 @@
       <if test="cardnum != null">
         cardNum,
       </if>
-      <if test="clientnum != null">
-        clientNum,
+      <if test="clientid != null">
+        clientId,
       </if>
       <if test="money != null">
         money,
@@ -136,10 +142,10 @@
         #{cardaddr,jdbcType=VARCHAR},
       </if>
       <if test="cardnum != null">
-        #{cardnum,jdbcType=VARCHAR},
+        #{cardnum,jdbcType=BIGINT},
       </if>
-      <if test="clientnum != null">
-        #{clientnum,jdbcType=VARCHAR},
+      <if test="clientid != null">
+        #{clientid,jdbcType=BIGINT},
       </if>
       <if test="money != null">
         #{money,jdbcType=FLOAT},
@@ -187,10 +193,10 @@
         cardAddr = #{cardaddr,jdbcType=VARCHAR},
       </if>
       <if test="cardnum != null">
-        cardNum = #{cardnum,jdbcType=VARCHAR},
+        cardNum = #{cardnum,jdbcType=BIGINT},
       </if>
-      <if test="clientnum != null">
-        clientNum = #{clientnum,jdbcType=VARCHAR},
+      <if test="clientid != null">
+        clientId = #{clientid,jdbcType=BIGINT},
       </if>
       <if test="money != null">
         money = #{money,jdbcType=FLOAT},
@@ -235,8 +241,8 @@
     <!--@mbg.generated-->
     update se_client_card
     set cardAddr = #{cardaddr,jdbcType=VARCHAR},
-      cardNum = #{cardnum,jdbcType=VARCHAR},
-      clientNum = #{clientnum,jdbcType=VARCHAR},
+      cardNum = #{cardnum,jdbcType=BIGINT},
+      clientId = #{clientid,jdbcType=BIGINT},
       money = #{money,jdbcType=FLOAT},
       `state` = #{state,jdbcType=TINYINT},
       createDt = #{createdt,jdbcType=TIMESTAMP},

--
Gitblit v1.8.0