package com.fzm.mall.server.front.order.mapper;

import com.fzm.mall.server.front.order.model.OrderSku;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 * 订单快照 sku 表 Mapper 接口
 * </p>
 *
 * @author fzm
 * @since 2021-03-03
 */
public interface OrderSkuMapper extends BaseMapper<OrderSku> {
    /**
     * 恢复商品库存
     */
    @Update("update goods_sku set stock = stock + #{number} where goods_id = #{gid} and coin_name = #{coin} and status = 1")
    Integer goodRestore(@Param("gid") String gid, @Param("coin") String coin, @Param("number") String number);
}
