sadjv3_java/src/main/resources/mapper/app/UserMoneyDao.xml

40 lines
1.0 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sqx.modules.app.dao.UserMoneyDao">
<update id="updateMayMoney">
update user_money set
<if test="type==1">
money=money+#{money}
</if>
<if test="type==2">
money=money-#{money}
</if>
where user_id=#{userId}
</update>
<update id="updateMaySad">
update user_money
set sad=#{money}
where user_id=#{userId}
</update>
<update id="updateCashDeposit">
update user_money set
<if test="type==1">
cash_deposit=cash_deposit+#{cashDeposit}
</if>
<if test="type==2">
cash_deposit=cash_deposit-#{cashDeposit}
</if>
where user_id=#{userId}
</update>
<update id="updateMoney">
update user_money
set money=#{money}
where user_id=#{userId}
</update>
</mapper>