| | |
| | | <!-- 通用查询映射结果 --> |
| | | <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> |