From c0f0b2825ed3dbef86b381c2490277164446dc10 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期六, 18 三月 2023 17:28:01 +0800
Subject: [PATCH] 新增加司机端接口

---
 driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/dao/mapping/AccountChangeDetailMapper.xml |   48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 48 insertions(+), 0 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 0a5c190..80b1519 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
@@ -8,9 +8,57 @@
         <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="explain" property="explain"/>
         <result column="createTime" property="createTime"/>
     </resultMap>
+
+
+
+    <select id="queryDriverIntegralIncomeAndExpenses" resultType="com.supersavedriving.driver.modular.system.warpper.IntegralIncomeAndExpensesWarpper">
+        select * from (
+        select
+        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}
+        ) as aa where 1 = 1
+        <if test="null != type and 1 == type">
+            and aa.integral &gt; 0
+        </if>
+        <if test="null != type and 2 == type">
+            and aa.integral &lt; 0
+        </if>
+        order by aa.createTime desc limit #{pageNum}, #{pageSize}
+    </select>
+
+
+    <select id="queryCommissionDetail" resultType="com.supersavedriving.driver.modular.system.warpper.CommissionDetailWarpper">
+        select
+        `explain`,
+        UNIX_TIMESTAMP(createTime) * 1000 as createTime,
+        (newData - oldData) as money,
+        newData as balance
+        from t_account_change_detail where userType = 2 and userId = #{driverId}
+        <if test="null != time and '' != time">
+            and DATE_FORMAT(createTime, '%Y年%m月') = #{time}
+        </if>
+        order by createTime desc limit #{pageNum}, #{pageSize}
+    </select>
+
+
+    <select id="queryCommissionDetailTotal" resultType="double">
+        select
+        sum(money) as money
+        from (
+            select
+            (newData - oldData) as money
+            from t_account_change_detail where userType = 2 and userId = #{driverId}
+            <if test="null != time and '' != time">
+                and DATE_FORMAT(createTime, '%Y年%m月') = #{time}
+            </if>
+        ) as aa where aa.money > 0
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.7.1