<?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.gree.mall.miniapp.commonmapper.SoldNumMapper">


    <update id="updateGoods">
        update goods
        set sold_num = sold_num + ${num}
        where goods_id = #{goodsId}
    </update>


    <update id="updateGoodsSpec">
        update goods_spec
        set sold_num = sold_num + ${orderDetail.num}
        where goods_spec_id = #{orderDetail.goodsSpecId}
    </update>

    <update id="updateSecGoodsSpec">
        update sec_kill_activity_spec
        set sec_stock_num = sec_stock_num + ${orderDetail.num}
        where sec_kill_spec_id = #{orderDetail.secKillSpecId}
    </update>


</mapper>