
package com.tmerclub.cloud.product.mapper;

import com.tmerclub.cloud.common.product.dto.StockPointSkuDTO;
import com.tmerclub.cloud.common.product.vo.StockPointSkuVO;
import com.tmerclub.cloud.product.model.StockPointSku;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 *
 *
 * @author tmerclub
 * @date 2023-11-09 18:00:43
 */
public interface StockPointSkuMapper {

    /**
     * 获取列表
     * @return 列表
     */
    List<StockPointSku> list();

    /**
     * 获取库存点skuVO集合
     * @param stockPointSkuDTO 库存点skuDTO
     * @return 库存点skuVO集合
     */
    List<StockPointSkuVO> listStockPointSku(@Param("stockPointSkuDTO") StockPointSkuDTO stockPointSkuDTO);

    /**
     * 根据id获取
     *
     * @param stockPointSkuId id
     * @return
     */
    StockPointSku getByStockPointSkuId(@Param("stockPointSkuId") Long stockPointSkuId);

    /**
     * 保存
     * @param stockPointSku
     */
    void save(@Param("stockPointSku") StockPointSku stockPointSku);

    /**
     * 更新
     * @param stockPointSku
     */
    void update(@Param("stockPointSku") StockPointSku stockPointSku);

    /**
     * 根据id删除
     * @param stockPointSkuId
     */
    void deleteById(@Param("stockPointSkuId") Long stockPointSkuId);

    /**
     * 根据id集合删除
     * @param stockPointSkuIds 关联id集合
     */
    void deleteByIds(@Param("stockPointSkuIds") List<Long> stockPointSkuIds);

    /**
     * 根据商品id删除
     * @param spuId
     */
    void deleteBySpuId(@Param("spuId") Long spuId);

    /**
     * 批量保存
     * @param stockPointSkuList
     */
    void batchSave(@Param("stockPointSkuList") List<StockPointSkuDTO> stockPointSkuList);

    /**
     * 批量删除
     * @param stockPointSkuIdList
     */
    void batchDeleteByStockPointSkuIdList(@Param("stockPointSkuIdList") List<Long> stockPointSkuIdList);

    /**
     * 根据skuid获取所有的库存点关联仓库信息
     * @param skuIds
     * @return
     */
    List<StockPointSkuVO> listBySkuIds(@Param("skuIds") List<Long> skuIds);

    /**
     * 获取库存关联点数量
     * @param stockPointId
     * @return
     */
    List<StockPointSkuVO> listByPointId(@Param("stockPointId") Long stockPointId);

    /**
     * 根据skuid和库存点id删除数据
     * @param skuId
     * @param stockPointId
     */
    void removeBySkuIdAndPointId(@Param("skuId") Long skuId, @Param("stockPointId") Long stockPointId);

    /**
     * 获取指定sku的仓库列表
     * @param skuIds
     * @return
     */
    List<StockPointSkuVO> listPointBySkuIds(@Param("skuIds") List<Long> skuIds);

    /**
     * 根据库存点id修改库存模式
     * @param stockPointId
     * @param stockMode
     */
    void updateStockMode(@Param("stockPointId")Long stockPointId, @Param("stockMode")Integer stockMode);
}
