package com.shkj.wms.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shkj.common.core.domain.Result;
import com.shkj.wms.bo.BaseContainerCallBo;
import com.shkj.wms.bo.SysStockDetailQueryBo;
import com.shkj.wms.domain.BaseLocation;
import com.shkj.wms.domain.SysStockDetail;
import com.shkj.wms.vo.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 库存明细Mapper接口
 *
 * @author lch
 * @date 2023-05-05
 */
public interface SysStockDetailMapper extends BaseMapper<SysStockDetail> {

     List<SysStockDetailConVo> StockInquiry(SysStockDetailQueryBo bo);

     List<SysStockDetailConVo> StockInquiryPda(SysStockDetailQueryBo bo);


     /**
      * 根据产品编码获取对应的货位id
      * @param goodsnoList
      * @return
      */
     List<SysStockDetailVo> getLocation(List<String> goodsnoList);

     /**
      * 获取物料在库库存情况
      * @param goodsNo
      * @return
      */
     List<SysStockDetailVo> getInventoryInStockByGoods(String goodsNo);

     /**
      * 找到位置
      *
      * @param branchId    分支id
      * @return {@code List<StockDetailLocationVo>}
      */
     List<StockDetailLocationVo> findLocation(@Param("branchId") Long branchId);

     StockDetailMoldVo findLocationByModqty(BaseContainerCallBo bo );

     StockDetailLocationVo findLocationByContainer(@Param("branchId") Long branchId,@Param("containerCode") String containerCode);

     /**
      * 找到位置
      *
      * @param moldBarcode 模具条形码
      * @return {@code List<SysStockDetailVo>}
      */
     List<SysStockDetailVo> findOutLocation(@Param("moldBarcode") String moldBarcode);

     /**
      * 找空位置
      *
      * @param branchId 分支id
      * @return {@code Result<List<BaseLocation>>}
      */
     List<BaseLocation> getEmptyLocation(@Param("branchId") Long branchId);

     List<SysStockAndInOutVo> getPutInOutStockQty();

     List<SysStockByAreaVo> getInventoryManagement();

     List<SysStockWeightByAreaVo> getInvWeightManagement();

     List<SysStockByReteVo> getLocationUsageRate();

     Integer getLocationMoldQty(Long locationId);

     /**
      *
      * @param locationCode
      * @return
      */
     List<BaseMoldVo> getLocationMoldByLocationCode(String locationCode);

}
