package com.gree.mall.miniapp.commonmapper.stock;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gree.mall.miniapp.bean.material.stock.WebsitStockDTO;
import com.gree.mall.miniapp.bean.material.stock.WorkerStockBean;
import com.gree.mall.miniapp.bean.material.stock.WorkerStockDTO;
import com.gree.mall.miniapp.plus.entity.WebsitGoodsCategory;
import com.gree.mall.miniapp.plus.entity.WebsitStock;
import com.gree.mall.miniapp.plus.entity.WorkerStock;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MaterialGoodsStockCMapper {


    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    List<WebsitGoodsCategory> queryWebsitGoodsCategoryList(
            @Param("websitId") String websitId,
            @Param("userId") String userId,
            @Param("goodsType") String goodsType
    );

    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    IPage<WorkerStockBean> queryWorkerStockList(
            IPage page,
            @Param("websitId") String websitId,
            @Param("userId") String userId,
            @Param("goodsType") String goodsType,
            @Param("categoryId") String categoryId
    );

    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    List<WebsitStock> queryExistWebsitStockList(@Param("companyWechatId") String companyWechatId,
                                                @Param("websitId") String websitId,
                                                @Param("storageId") String storageId,
                                                @Param("stockList") List<WebsitStockDTO> stockList);

    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    List<WorkerStock> queryExistWorkerStockList(@Param("companyWechatId") String companyWechatId,
                                                @Param("workerId") String workerId,
                                                @Param("stockList") List<WorkerStockDTO> stockList);

}
