fix: 交易记录问题修复。

This commit is contained in:
tianyongbao
2024-05-13 11:46:00 +08:00
parent af2d44a517
commit ba154d8e32
5 changed files with 215 additions and 36 deletions

View File

@@ -165,4 +165,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</update>
<update id="batchPlusCurrentBalance" >
update accounts_deal_record
<trim prefix="SET" suffixOverrides=",">
<if test="currentBalance != null ">current_balance = current_balance+#{currentBalance},</if>
</trim>
where account_id = #{accountId}
<if test="startDateTime!=null">
and create_time>=#{startDateTime}
</if>
</update>
<update id="batchMinusCurrentBalance" >
update accounts_deal_record
<trim prefix="SET" suffixOverrides=",">
<if test="currentBalance != null ">current_balance = current_balance-#{currentBalance},</if>
</trim>
where account_id = #{accountId}
<if test="startDateTime!=null">
and create_time>=#{startDateTime}
</if>
</update>
<select id="getLastOneAccountsDealRecordByMap" resultMap="AccountsDealRecordResult">
<include refid="selectAccountsDealRecordVo"/>
where a.account_id = #{accountId}
and a.del_flag='0'
<if test="startDateTime!=null">
and #{startDateTime}>=a.create_time
</if>
order by a.create_time desc
limit 1
</select>
</mapper>