package com.hzs.sale.wares.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.sale.wares.BdWaresExtend;
import com.hzs.sale.order.param.WaresNumberParam;
import com.hzs.sale.order.vo.WaresPreSaleVo;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.Date;
import java.util.List;

/**
 * 商品发布扩展表 Mapper 接口
 *
 * @author hzs
 * @since 2022-09-09
 */
public interface BdWaresExtendMapper extends BaseMapper<BdWaresExtend> {

    /**
     * 修改销量
     *
     * @param waresNumberList 销量列表
     */
    void updateWaresSalesAccrual(@Param("waresNumberList") List<WaresNumberParam> waresNumberList);

    /**
     * 设置上下架时间
     *
     * @param waresId
     * @param putOnTime
     * @param putOffTime
     */
    void updatePutOnTimeAndPutOffTimeByWaresId(@Param("waresId") Integer waresId, @Param("putOnTime") Date putOnTime, @Param("putOffTime") Date putOffTime);

    /**
     * 根据商品编号查询 每个商品所剩余的预售数量
     *
     * @param waresCodeList
     * @param specialArea   专区
     * @return
     */
    List<WaresPreSaleVo> selectByWaresCodeList(@Param("waresCodeList") Collection<String> waresCodeList, @Param("specialArea") Integer specialArea);

}
