AccountMapper.xml 813 B

12345678910111213141516171819202122
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.sf.dao.AccountDao">
  4. <resultMap id="BaseResultMap" type="com.sf.domain.Account">
  5. <id column="id" property="id" jdbcType="BIGINT"/>
  6. <result column="user_id" property="userId" jdbcType="BIGINT"/>
  7. <result column="total" property="total" jdbcType="DECIMAL"/>
  8. <result column="used" property="used" jdbcType="DECIMAL"/>
  9. <result column="residue" property="residue" jdbcType="DECIMAL"/>
  10. </resultMap>
  11. <update id="decrease">
  12. UPDATE t_account
  13. SET
  14. residue = residue - #{money},used = used + #{money}
  15. WHERE
  16. user_id = #{userId};
  17. </update>
  18. </mapper>