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.StorageDao">
- <resultMap id="BaseResultMap" type="com.sf.domain.Storage">
- <id column="id" property="id" jdbcType="BIGINT"/>
- <result column="product_id" property="productId" jdbcType="BIGINT"/>
- <result column="total" property="total" jdbcType="INTEGER"/>
- <result column="used" property="used" jdbcType="INTEGER"/>
- <result column="residue" property="residue" jdbcType="INTEGER"/>
- </resultMap>
- <update id="decrease">
- UPDATE
- t_storage
- SET
- used = used + #{count},residue = residue - #{count}
- WHERE
- product_id = #{productId}
- </update>
- </mapper>
|