DemoProductMapper.xml 421 Bytes
Newer Older
1 2
<?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">
3
<mapper namespace="cn.iocoder.mall.demo.business.dao.mysql.DemoProductMapper">
4 5 6 7 8 9 10 11 12

    <update id="updateQuantityReduce">
        UPDATE product
        SET quantity = quantity - #{quantity}
        WHERE id = #{id}
        AND quantity >= #{quantity}
    </update>

</mapper>