package com.gree.mall.manager.commonmapper;

import com.gree.mall.manager.bean.material.stock.WebsitStockDTO;
import com.gree.mall.manager.bean.material.stock.WorkerStockDTO;
import com.gree.mall.manager.plus.entity.WebsitPartsSalesItem;
import com.gree.mall.manager.plus.entity.WebsitStock;
import com.gree.mall.manager.plus.entity.WorkerStock;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MaterialGoodsStockCMapper {
    /**
     * 带锁查询
     *
     * @param companyWechatId
     * @param websitId
     * @param storageId
     * @param stockList
     * @return
     */
    List<WebsitStock> queryExistWebsitStockList(@Param("companyWechatId") String companyWechatId,
                                                @Param("websitId") String websitId,
                                                @Param("storageId") String storageId,
                                                @Param("stockList") List<WebsitStockDTO> stockList);

    List<WorkerStock> queryExistWorkerStockList(@Param("companyWechatId") String companyWechatId,
                                                @Param("workerId") String workerId,
                                                @Param("stockList") List<WorkerStockDTO> stockList);

    /**
     * 带锁的查询
     * @return
     */
    List<WebsitPartsSalesItem> querySalesItemByItemId(@Param("companyWechatId") String companyWechatId,
                                                      @Param("websitId") String websitId,
                                                      @Param("partsWebsitId") String partsWebsitId,
                                                      @Param("identity") String identity,
                                                      @Param("records") List<String> records);

}
