From db7fa6a91b9534ac90e219b6f554c54c43c83a5a Mon Sep 17 00:00:00 2001
From: liujie <liujie>
Date: 星期三, 16 八月 2023 09:28:15 +0800
Subject: [PATCH] update

---
 user/guns-admin/src/main/java/com/supersavedriving/user/modular/system/dao/mapping/AccountChangeDetailMapper.xml |   27 +++++++++++++++++++++++++--
 1 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/user/guns-admin/src/main/java/com/supersavedriving/user/modular/system/dao/mapping/AccountChangeDetailMapper.xml b/user/guns-admin/src/main/java/com/supersavedriving/user/modular/system/dao/mapping/AccountChangeDetailMapper.xml
index bb32c45..c487e27 100644
--- a/user/guns-admin/src/main/java/com/supersavedriving/user/modular/system/dao/mapping/AccountChangeDetailMapper.xml
+++ b/user/guns-admin/src/main/java/com/supersavedriving/user/modular/system/dao/mapping/AccountChangeDetailMapper.xml
@@ -1,16 +1,39 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace=" com.supersavedriving.user.modular.system.dao.AccountChangeDetailMapper">
+<mapper namespace="com.supersavedriving.user.modular.system.dao.AccountChangeDetailMapper">
 
     <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type=" com.supersavedriving.user.modular.system.model.AccountChangeDetail">
+    <resultMap id="BaseResultMap" type="com.supersavedriving.user.modular.system.model.AccountChangeDetail">
         <id column="id" property="id"/>
+        <result column="code" property="code"/>
         <result column="userType" property="userType"/>
         <result column="userId" property="userId"/>
         <result column="type" property="type"/>
+        <result column="changeType" property="changeType"/>
         <result column="oldData" property="oldData"/>
         <result column="newData" property="newData"/>
+        <result column="orderId" property="orderId"/>
         <result column="explain" property="explain"/>
         <result column="createTime" property="createTime"/>
     </resultMap>
+
+
+
+    <select id="queryBalanceDetails" resultType="com.supersavedriving.user.modular.system.warpper.BalanceDetailsWarpper">
+        select
+        a.changeType as type,
+        a.`explain`,
+        b.startAddress,
+        b.endAddress,
+        UNIX_TIMESTAMP(a.createTime) * 1000 as createTime,
+        (a.newData - a.oldData) as amount,
+        a.newData as balance
+        from t_account_change_detail a
+        left join t_order b on (a.orderId = b.id)
+        where a.userType = 1 and a.userId = #{uid}
+        <if test="null != time and '' != time">
+            and DATE_FORMAT(a.createTime, '%Y年%m月') = #{time}
+        </if>
+        order by a.createTime desc limit #{pageNum}, #{pageSize}
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.7.1