12345678910111213141516171819202122 |
- <?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.sf.dao.AccountDao">
- <resultMap id="BaseResultMap" type="com.sf.domain.Account">
- <id column="id" property="id" jdbcType="BIGINT"/>
- <result column="user_id" property="userId" jdbcType="BIGINT"/>
- <result column="total" property="total" jdbcType="DECIMAL"/>
- <result column="used" property="used" jdbcType="DECIMAL"/>
- <result column="residue" property="residue" jdbcType="DECIMAL"/>
- </resultMap>
- <update id="decrease">
- UPDATE t_account
- SET
- residue = residue - #{money},used = used + #{money}
- WHERE
- user_id = #{userId};
- </update>
- </mapper>
|