package com.oqpo.api.mapper.rtnmng;


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.RtnReqBaseInfoEntity;
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 RtnOdrMapper {


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


    List<RtnOdrDtlPtclEntity> selectRecRtnDtlInitInfo(@Param("brandId") String brandId, List<RtnOdrDtlPtclEntity> gridUpdateData)throws Exception;

    RtnOdrBaseInfoEntity selectRtnInitInfo(@Param("brandId") String brandId)throws Exception;

    int insertRtnOdrBaseInfo(@Param("userId") String userId, RtnOdrBaseInfoEntity entity)throws Exception;
    int insertRtnOdrDtlPtcl(@Param("userId") String userId, List<RtnOdrDtlPtclEntity> gridInsertData)throws Exception;
    RtnOdrDtlPtclEntity selectPoRtnDtlSaveInfo(@Param("rtnReqUnqNo") String rtnReqUnqNo, @Param("rtnReqDtlNo") String rtnReqDtlNo)throws Exception;

    RtnOdrDtlPtclEntity selectRtnItemDtlSaveInfo(@Param("brandId") String brandId, @Param("itemId") String itemId, @Param("brandUnitUnqNo") String brandUnitUnqNo)throws Exception;

    List<RtnOdrBaseInfoEntity>  selectRtnOdrGridList(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sRtnOdrStCd") String sRtnOdrStCd, @Param("sRtnWhsId") String sRtnWhsId, @Param("sColDvsn") String sColDvsn, @Param("sWhsId") String sWhsId, @Param("sSpplyId") String sSpplyId, @Param("sItemNm") String sItemNm, GridRequest gridRequest) throws Exception;;
    int selectRtnOdrGridCnt(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sRtnOdrStCd") String sRtnOdrStCd, @Param("sRtnWhsId") String sRtnWhsId, @Param("sColDvsn") String sColDvsn, @Param("sWhsId") String sWhsId, @Param("sSpplyId") String sSpplyId, @Param("sItemNm") String sItemNm) throws Exception;;

    RtnOdrBaseInfoEntity selectRtnOdrInfo(@Param("rtnPodrUnqNo") String rtnPodrUnqNo) throws Exception;;
    List<RtnOdrDtlPtclEntity> selectROdrDtlList(@Param("rtnPodrUnqNo") String rtnPodrUnqNo) throws Exception;;

    int updateChgRodrStCd(@Param("userId") String userId, @Param("rtnPodrUnqNo") String rtnPodrUnqNo, @Param("rtnOdrStCd") String rtnOdrStCd) throws Exception;;
    int updateChangeRodrDtlStCd(@Param("userId") String userId, @Param("rtnPodrUnqNo") String rtnPodrUnqNo, @Param("rodrDtlStCd") String rodrDtlStCd) throws Exception;;
    int updateChangeMultiRodrDtlStCd(@Param("userId") String userId, List<RtnOdrDtlPtclEntity> gridUpdateData) throws Exception;;

    List<RtnOdrDtlPtclEntity> selectRtnOdrDtlStatusList(String rtnPodrUnqNo) throws Exception;;

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

    List<RtnOdrBaseInfoEntity>  selectPchRtnStreamlineList(@Param("brandId") String brandId,@Param("rtnReqUnqNo") String rtnReqUnqNo ) throws Exception;;
    int selectPchRtnStreamlineBrandColChk(@Param("brandId") String brandId, List<RtnReqBaseInfoEntity> gridUpdateData) throws Exception;;

    int insertStreamlineRtnOdrBaseInfo(@Param("userId") String userId, List<RtnOdrBaseInfoEntity> gridInsertData)throws Exception;
    int insertStremalineRtnOdrDtlPtcl(@Param("userId") String userId, List<RtnOdrDtlPtclEntity> gridInsertData)throws Exception;


    /*


    PchOdrBaseInfoEntity selectPoInitInfo(@Param("brandId") String brandId)throws Exception;
    PchOdrDtlPtclEntity selectPoPchDtlSaveInfo(@Param("pchReqUnqNo") String pchReqUnqNo, @Param("pchReqDtlNo") String pchReqDtlNo)throws Exception;


    int insertPchOdrBaseInfo(@Param("userId") String userId, PchOdrBaseInfoEntity entity)throws Exception;
    int insertPchOdrDtlPtcl(@Param("userId") String userId, List<PchOdrDtlPtclEntity> gridInsertData)throws Exception;

    List<PchOdrBaseInfoEntity>  selectPchOdrGridList(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sPchOdrStCd") String sPchOdrStCd, @Param("sSpplyId") String sSpplyId, @Param("sWhsId") String sWhsId, @Param("sItemNm") String sItemNm, GridRequest gridRequest);
    int selectPchOdrGridCnt(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sPchOdrStCd") String sPchOdrStCd, @Param("sSpplyId") String sSpplyId, @Param("sWhsId") String sWhsId, @Param("sItemNm") String sItemNm);

    PchOdrBaseInfoEntity selectPchOdrInfo(@Param("pchPodrUnqNo") String pchPodrUnqNo);
    List<PchOdrDtlPtclEntity> selectOdrDtlList(@Param("pchPodrUnqNo") String pchPodrUnqNo);

    List<PchOdrDtlPtclEntity> selectOdrDtlStatusList(@Param("pchPodrUnqNo") String pchPodrUnqNo);

    int updateCancelPodrDtl(@Param("userId") String userId, List<PchOdrDtlPtclEntity> gridUpdateData) throws Exception;
    int updateChgPodrStCd(@Param("userId") String userId, @Param("pchOdrStCd") String pchOdrStCd, @Param("pchPodrUnqNo") String pchPodrUnqNo) throws Exception;

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

    // 공급사 수주현황
    List<PchOdrBaseInfoEntity> selectSpplyPoGridList(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sSpplyId") String sSpplyId, @Param("sWhsId") String sWhsId, @Param("sPchOdrStCd") String sPchOdrStCd, @Param("sItemNm") String sItemNm, GridRequest gridRequest)throws Exception;
    int selectSpplyPoGridCnt(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sSpplyId") String sSpplyId, @Param("sWhsId") String sWhsId, @Param("sPchOdrStCd") String sPchOdrStCd, @Param("sItemNm") String sItemNm)throws Exception;

    // 공급사 발주 정보
    PchOdrBaseInfoEntity selectSpplyPchOdrInfo(@Param("brandId") String brandId, @Param("pchPodrUnqNo") String pchPodrUnqNo, @Param("spplyId") String spplyId);
    List<PchOdrDtlPtclEntity> selectSpplyOdrDtlList(@Param("brandId") String brandId, @Param("pchPodrUnqNo") String pchPodrUnqNo, @Param("spplyId") String spplyId);

*/

}
