StorageMapper.xml 835 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.StorageDao">
  4. <resultMap id="BaseResultMap" type="com.sf.domain.Storage">
  5. <id column="id" property="id" jdbcType="BIGINT"/>
  6. <result column="product_id" property="productId" jdbcType="BIGINT"/>
  7. <result column="total" property="total" jdbcType="INTEGER"/>
  8. <result column="used" property="used" jdbcType="INTEGER"/>
  9. <result column="residue" property="residue" jdbcType="INTEGER"/>
  10. </resultMap>
  11. <update id="decrease">
  12. UPDATE
  13. t_storage
  14. SET
  15. used = used + #{count},residue = residue - #{count}
  16. WHERE
  17. product_id = #{productId}
  18. </update>
  19. </mapper>