puzhibing
2023-08-31 ef04ce57881e6a338b10d596c5eb76b2220598bf
driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/dao/mapping/AccountChangeDetailMapper.xml
@@ -12,6 +12,7 @@
        <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>
@@ -21,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}
@@ -42,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>
@@ -56,7 +57,7 @@
        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>
@@ -69,9 +70,9 @@
        code,
        changeType as `type`,
        UNIX_TIMESTAMP(createTime) * 1000 as createTime,
        (newData - oldData) as money,
        (newData - oldData) as amount,
        newData as balance
        from t_account_change_detail where userType = 2 and userId = #{driverId} and changeType in (1, 3, 4, 7, 8)
        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>