From db7fa6a91b9534ac90e219b6f554c54c43c83a5a Mon Sep 17 00:00:00 2001 From: liujie <liujie> Date: 星期三, 16 八月 2023 09:28:15 +0800 Subject: [PATCH] update --- driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/dao/mapping/AccountChangeDetailMapper.xml | 26 +++++++++++++++++++++++--- 1 files changed, 23 insertions(+), 3 deletions(-) diff --git a/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/dao/mapping/AccountChangeDetailMapper.xml b/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/dao/mapping/AccountChangeDetailMapper.xml index 80b1519..def4fea 100644 --- a/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/dao/mapping/AccountChangeDetailMapper.xml +++ b/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/dao/mapping/AccountChangeDetailMapper.xml @@ -5,12 +5,14 @@ <!-- 通用查询映射结果 --> <resultMap id="BaseResultMap" type="com.supersavedriving.driver.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> @@ -20,7 +22,7 @@ <select id="queryDriverIntegralIncomeAndExpenses" resultType="com.supersavedriving.driver.modular.system.warpper.IntegralIncomeAndExpensesWarpper"> select * from ( select - explain as description, + `explain` as description, UNIX_TIMESTAMP(createTime) * 1000 as createTime, (newData - oldData) as integral from t_account_change_detail where `type` = 2 and userType = 2 and userId = #{driverId} @@ -41,7 +43,7 @@ UNIX_TIMESTAMP(createTime) * 1000 as createTime, (newData - oldData) as money, newData as balance - from t_account_change_detail where userType = 2 and userId = #{driverId} + from t_account_change_detail where changeType not in (3, 4, 8, 9) and userType = 2 and `type` = 1 and userId = #{driverId} <if test="null != time and '' != time"> and DATE_FORMAT(createTime, '%Y年%m月') = #{time} </if> @@ -55,10 +57,28 @@ from ( select (newData - oldData) as money - from t_account_change_detail where userType = 2 and userId = #{driverId} + from t_account_change_detail where changeType not in (3, 4, 8, 9) and userType = 2 and `type` = 1 and userId = #{driverId} <if test="null != time and '' != time"> and DATE_FORMAT(createTime, '%Y年%m月') = #{time} </if> ) as aa where aa.money > 0 </select> + + + <select id="queryBalanceDetail" resultType="com.supersavedriving.driver.modular.system.warpper.BalanceDetailWarpper"> + select + code, + changeType as `type`, + UNIX_TIMESTAMP(createTime) * 1000 as createTime, + (newData - oldData) as amount, + newData as balance + from t_account_change_detail where userType = 2 and userId = #{driverId} and changeType in (3, 8, 9) + <if test="null != time and '' != time"> + and DATE_FORMAT(createTime, '%Y年%m月') = #{time} + </if> + <if test="null != type"> + and changeType = #{type} + </if> + order by createTime desc limit #{pageNum}, #{pageSize} + </select> </mapper> \ No newline at end of file -- Gitblit v1.7.1