xuhy
2023-03-23 ed79668a9a0d49f0f532c6e603a821eb508085bf
driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/dao/mapping/AccountChangeDetailMapper.xml
@@ -5,6 +5,7 @@
    <!-- 通用查询映射结果 -->
    <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"/>
@@ -61,4 +62,22 @@
            </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 money,
        newData as balance
        from t_account_change_detail where userType = 2 and userId = #{driverId} and changeType in (1, 3, 4, 7, 8)
        <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>