package com.oqpo.api.mapper.inoutmng;


import com.oqpo.api.entity.inoutmng.*;
import com.oqpo.api.entity.pomng.PchOdrBaseInfoEntity;
import com.oqpo.api.entity.pomng.PchOdrDtlPtclEntity;
import com.oqpo.api.entity.rtnmng.RtnOdrBaseInfoEntity;
import com.oqpo.api.entity.rtnmng.RtnOdrDtlPtclEntity;
import com.oqpo.api.entity.rtnmng.RtnProcInfoPtclEntity;
import com.oqpo.api.entity.stockmng.StckMgntBaseInfoEntity;
import com.oqpo.api.entity.stockmng.StckMgntDtlHistEntity;
import com.oqpo.api.entity.stockmng.WhsProcInfoPtclEntity;
import com.oqpo.api.web.dto.request.GridRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ColOdrMapper {
    int selectColRtnIngCnt(@Param("brandId") String brandId, @Param("rtnPodrUnqNo") String rtnPodrUnqNo)throws Exception;

    List<RtnOdrBaseInfoEntity> selectColTargetRtnGridList(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sWhsId") String sWhsId, @Param("sRtnWhsId") String sRtnWhsId, @Param("sItemNm") String sItemNm, GridRequest gridRequest)throws Exception;
    int selectColTargetRtnGridCnt(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sWhsId") String sWhsId, @Param("sRtnWhsId") String sRtnWhsId, @Param("sItemNm") String sItemNm )throws Exception;


    List<RtnOdrBaseInfoEntity> selectColInstRtnGridList(@Param("brandId") String brandId, List<RtnOdrDtlPtclEntity> gridUpdateData, GridRequest gridRequest)throws Exception;

    List<RtnOdrBaseInfoEntity> selectPickJobDataList(@Param("brandId") String brandId, List<RtnOdrDtlPtclEntity> gridInsertData)throws Exception;

    int insertColOdrBase(@Param("userId") String userId, ColOdrBaseEntity entity)throws Exception;
    int insertColOdrDtl(@Param("userId") String userId, List<ColOdrDtlPtclEntity> gridInsertData)throws Exception;
    int insertPickMgntBase(@Param("userId") String userId, PickInfoMgntEntity entity)throws Exception;
    int insertPickDtlPtcl(@Param("userId") String userId, List<PickDtlPtclEntity> gridInsertData)throws Exception;

    List<ColOdrBaseEntity> selectColGridList(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sColDvsn") String sColDvsn, @Param("sWhsId") String sWhsId, @Param("sRtnWhsId") String sRtnWhsId, @Param("sColCmdDtlStCd") String sColCmdDtlStCd, @Param("sItemNm") String sItemNm, GridRequest gridRequest)throws Exception;
    int selectColGridCnt(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sColDvsn") String sColDvsn, @Param("sWhsId") String sWhsId, @Param("sRtnWhsId") String sRtnWhsId, @Param("sColCmdDtlStCd") String sColCmdDtlStCd, @Param("sItemNm") String sItemNm)throws Exception;

    PickInfoMgntEntity selectPickInfo(@Param("brandId") String brandId, @Param("colPickUnqNo") String colPickUnqNo)throws Exception;
    List<PickDtlPtclEntity> selectPickDtlPtcl(@Param("brandId") String brandId, @Param("colPickUnqNo") String colPickUnqNo)throws Exception;

    List<RtnOdrBaseInfoEntity> selectColSpplyTargetRtnGridList(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sSpplyId") String sSpplyId, @Param("sRtnWhsId") String sRtnWhsId,  @Param("sItemNm") String sItemNm, GridRequest gridRequest)throws Exception;
    int selectColSpplyTargetRtnGridCnt(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sSpplyId") String sSpplyId,  @Param("sRtnWhsId") String sRtnWhsId, @Param("sItemNm") String sItemNm)throws Exception;


    RtnOdrBaseInfoEntity selectSpplyColOdrInfo(@Param("brandId") String brandId,  @Param("spplyId") String spplyId, @Param("rtnPodrUnqNo") String rtnPodrUnqNo)throws Exception;
    List<RtnOdrDtlPtclEntity> selectSpplyColRtnList(@Param("rtnPodrUnqNo") String rtnPodrUnqNo)throws Exception;

    List<PickInfoMgntEntity> selectColSpplyPickGridList(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sSpplyId") String sSpplyId, @Param("sWhsId") String sWhsId,  @Param("sItemNm") String sItemNm, GridRequest gridRequest)throws Exception;
    int selectColSpplyPickGridCnt(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sSpplyId") String sSpplyId, @Param("sWhsId") String sWhsId,  @Param("sItemNm") String sItemNm)throws Exception;

    List<PickInfoMgntEntity> selectColRtnInstGridList(@Param("sBrandId") String sBrandId, @Param("sStoreId") String sStoreId,  @Param("sColPickUnqNo") String sColPickUnqNo, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sSpplyId") String sSpplyId, @Param("sRtnWhsId") String sRtnWhsId, @Param("sWhsId") String sWhsId,  @Param("sItemNm") String sItemNm, GridRequest gridRequest)throws Exception;
    int selectColRtnInstGridCnt(@Param("sBrandId") String sBrandId, @Param("sStoreId") String sStoreId,  @Param("sColPickUnqNo") String sColPickUnqNo, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sSpplyId") String sSpplyId, @Param("sRtnWhsId") String sRtnWhsId, @Param("sWhsId") String sWhsId,  @Param("sItemNm") String sItemNm) throws Exception;

    int insertRtnProcInfoPtcl(@Param("userId") String userId, List<RtnProcInfoPtclEntity> gridInsertData) throws Exception;

    List<PickInfoMgntEntity> selectColRtnInstResultGridList(@Param("sBrandId") String sBrandId, @Param("sStoreId") String sStoreId, @Param("sColPickUnqNo") String sColPickUnqNo, @Param("sRtnPodrUnqNo") String sRtnPodrUnqNo, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sSpplyId") String sSpplyId, @Param("sRtnWhsId") String sRtnWhsId, @Param("sWhsId") String sWhsId,  @Param("sItemNm") String sItemNm, GridRequest gridRequest)throws Exception;
    int selectColRtnInstResultGridCnt(@Param("sBrandId") String sBrandId, @Param("sStoreId") String sStoreId,  @Param("sColPickUnqNo") String sColPickUnqNo, @Param("sRtnPodrUnqNo") String sRtnPodrUnqNo, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sSpplyId") String sSpplyId, @Param("sRtnWhsId") String sRtnWhsId, @Param("sWhsId") String sWhsId,  @Param("sItemNm") String sItemNm) throws Exception;

    List<PickInfoMgntEntity> selectColRtnInstProcList(@Param("brandId") String brandId, @Param("whsId") String whsId,List<RtnProcInfoPtclEntity> gridUpdateData )throws Exception;

    int updateChgStckQtyStckMgnt(@Param("userId") String userId, List<StckMgntBaseInfoEntity> gridUpdateData) throws Exception;

    int insertChgStckStckMgntDtlHist(@Param("userId") String userId, List<StckMgntDtlHistEntity> gridInsertData) throws Exception;

    int updateChgStckCloDtlStCd(@Param("userId") String userId, List<ColOdrDtlPtclEntity> gridUpdateData) throws Exception;

    int updateChgStckPickDtlStCd(@Param("userId") String userId, List<PickDtlPtclEntity> gridUpdateData) throws Exception;

    List<ColOdrBaseEntity> selectColCmdStDtlList(@Param("userId") String userId, List<ColOdrBaseEntity> gridUpdateData ) throws Exception;

    int updateChgStckColOdrStCd(@Param("userId") String userId, List<ColOdrBaseEntity> gridUpdateData) throws Exception;

    List<PickInfoMgntEntity> selectColPickStList(@Param("userId") String userId, List<PickInfoMgntEntity> gridUpdateData ) throws Exception;

    int updateChgStckPickStCd(@Param("userId") String userId, List<PickInfoMgntEntity> gridUpdateData) throws Exception;

    int insertStreamlineColOdrBase(@Param("userId") String userId, List<ColOdrBaseEntity> gridInsertData)throws Exception;
    int insertStreamlinePickMgntBase(@Param("userId") String userId, List<PickInfoMgntEntity> gridInsertData)throws Exception;

    //int insertRtnProcInfoPtcl(@Param("userId") String userId, RtnProcInfoPtclEntity entity) throws Exception;

    /*
    List<PchOdrBaseInfoEntity> selectShmtTargetOdrGridList(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sShmtWhsId") String sShmtWhsId, @Param("sWhsId") String sWhsId, @Param("sItemNm") String sItemNm, GridRequest gridRequest)throws Exception;
    int selectShmtTargetOdrGridCnt(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sShmtWhsId") String sShmtWhsId, @Param("sWhsId") String sWhsId, @Param("sItemNm") String sItemNm)throws Exception;

    int insertShmtOdrBase(@Param("userId") String userId, ShmtOdrBaseEntity entity)throws Exception;
    int insertShmtOdrDtl(@Param("userId") String userId, List<ShmtOdrDtlEntity> gridInsertData)throws Exception;

    List<PchOdrBaseInfoEntity> selectShmtJobDataList(@Param("brandId") String brandId, List<PchOdrDtlPtclEntity> gridInsertData)throws Exception;

    int insertDeliInfoMngt(@Param("userId") String userId, DeliInfoMgntEntity entity)throws Exception;
    int insertDeliDtlPtcl(@Param("userId") String userId, List<DeliDtlMgntEntity> gridInsertData)throws Exception;

    List<ShmtOdrBaseEntity> selectShmtSearchGridList(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sShmtWhsId") String sShmtWhsId, @Param("sShmtReqStCd") String sShmtReqStCd, @Param("swhsId") String swhsId, @Param("sItemNm") String sItemNm, GridRequest gridRequest)throws Exception;
    int selectShmtSearchGridCnt(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sShmtWhsId") String sShmtWhsId, @Param("sShmtReqStCd") String sShmtReqStCd, @Param("swhsId") String swhsId, @Param("sItemNm") String sItemNm)throws Exception;

    DeliInfoMgntEntity selectInvInfo(@Param("brandId") String brandId, @Param("dlvSttmtUnqNo") String dlvSttmtUnqNo)throws Exception;
    List<DeliDtlMgntEntity> selectInvDtlList(@Param("brandId") String brandId, @Param("dlvSttmtUnqNo") String dlvSttmtUnqNo)throws Exception;

    List<PchOdrBaseInfoEntity> selectSpplyTargetOdrGridList(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sSpplyId") String sSpplyId, @Param("sWhsId") String sWhsId, @Param("sItemNm") String sItemNm, GridRequest gridRequest)throws Exception;
    int selectSpplyTargetOdrGridCnt(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sSpplyId") String sSpplyId, @Param("sWhsId") String sWhsId, @Param("sItemNm") String sItemNm)throws Exception;

    PchOdrBaseInfoEntity selectSpplyShmtOdrInfo(@Param("brandId") String brandId, @Param("spplyId") String spplyId, @Param("pchPodrUnqNo") String pchPodrUnqNo)throws Exception;
    List<PchOdrDtlPtclEntity> selectSpplyShmtOdrList(@Param("pchPodrUnqNo") String pchPodrUnqNo)throws Exception;


    List<DeliInfoMgntEntity> selectDeliGridList(@Param("sBrandId") String sBrandId, @Param("dtGubun") String dtGubun, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sDlvStCd") String sDlvStCd, @Param("sSpplyId") String sSpplyId, @Param("sWhsId") String sWhsId, @Param("sItemNm") String sItemNm, GridRequest gridRequest)throws Exception;
    int selectDeliGridCnt(@Param("sBrandId") String sBrandId, @Param("dtGubun") String dtGubun, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sDlvStCd") String sDlvStCd, @Param("sSpplyId") String sSpplyId, @Param("sWhsId") String sWhsId, @Param("sItemNm") String sItemNm)throws Exception;

    List<DeliInfoMgntEntity> selectSpplyDeliGridList(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sSpplyId") String sSpplyId, @Param("sWhsId") String sWhsId, @Param("sItemNm") String sItemNm, GridRequest gridRequest)throws Exception;
    int selectSpplyDeliGridCnt(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sSpplyId") String sSpplyId, @Param("sWhsId") String sWhsId, @Param("sItemNm") String sItemNm)throws Exception;

    List<DeliInfoMgntEntity> selectWarehouseTargetGridList(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sWhsId") String sWhsId, @Param("sSpplyId") String sSpplyId, @Param("sDlvSttmtUnqNo") String sDlvSttmtUnqNo, @Param("sItemNm") String sItemNm, GridRequest gridRequest)throws Exception;
    int selectWarehouseTargetGridCnt(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sWhsId") String sWhsId, @Param("sSpplyId") String sSpplyId, @Param("sDlvSttmtUnqNo") String sDlvSttmtUnqNo, @Param("sItemNm") String sItemNm)throws Exception;

    int insertWhsProcInfoPtcl(@Param("userId") String userId, List<WhsProcInfoPtclEntity> gridUpdateData)throws Exception;

    List<DeliInfoMgntEntity> selectWarehouseProcList(@Param("brandId") String brandId, @Param("whsId") String whsId, List<DeliDtlMgntEntity> gridUpdateData)throws Exception;


    int updateDeliDtlStCd(@Param("userId") String userId, List<DeliDtlMgntEntity> gridUpdateData)throws Exception;
    List<DeliInfoMgntEntity> selectDeliInfoStList(@Param("userId") String userId, List<DeliDtlMgntEntity> gridUpdateData)throws Exception;
    int updateDeliInfoStCd(@Param("userId") String userId, List<DeliInfoMgntEntity> gridUpdateData)throws Exception;

    int updateShmtDtlStCd(@Param("userId") String userId, List<ShmtOdrDtlEntity> gridUpdateData)throws Exception;
    List<ShmtOdrBaseEntity> selectShmtInfoStList(@Param("userId") String userId, List<ShmtOdrDtlEntity> gridUpdateData)throws Exception;
    int updateShmtInfoStCd(@Param("userId") String userId, List<ShmtOdrBaseEntity> gridUpdateData)throws Exception;

    int updatePchPodrDtlStCd(@Param("userId") String userId, List<PchOdrDtlPtclEntity> gridUpdateData)throws Exception;

    List<WhsProcInfoPtclEntity> selectWarehouseList(@Param("sBrandId") String sBrandId, @Param("sStoreId") String sStoreId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sPchPodrUnqNo") String sPchPodrUnqNo, @Param("sSpplyId") String sSpplyId, @Param("sWhsId") String sWhsId, @Param("sItemNm") String sItemNm, GridRequest gridRequest)throws Exception;
    int selectWarehouseCnt(@Param("sBrandId") String sBrandId, @Param("sStoreId") String sStoreId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sPchPodrUnqNo") String sPchPodrUnqNo, @Param("sSpplyId") String sSpplyId, @Param("sWhsId") String sWhsId, @Param("sItemNm") String sItemNm)throws Exception;
    */
}
