package com.oqpo.api.mapper.sttlmng;


import com.oqpo.api.entity.inoutmng.ShmtOdrBaseEntity;
import com.oqpo.api.entity.inoutmng.ShmtOdrDtlEntity;
import com.oqpo.api.entity.loanmng.LoanMgntBaseInfoEntity;
import com.oqpo.api.entity.rtnmng.RtnProcInfoPtclEntity;
import com.oqpo.api.entity.settmng.StlMgntBaseInfoEntity;
import com.oqpo.api.entity.settmng.StlMgntDtlPtclEntity;
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 SttlReqMapper {

    List<StlMgntDtlPtclEntity> selectSttlReqGridList(@Param("sBrandId") String sBrandId, @Param("sStoreId") String sStoreId, @Param("sSpplyId") String sSpplyId,
                                                     @Param("sItemNm") String sItemNm, @Param("fromDt") String fromDt, @Param("toDt") String toDt,
                                                     GridRequest gridRequest) throws Exception;

    int selectSttlReqGridCnt(@Param("sBrandId") String sBrandId, @Param("sStoreId") String sStoreId, @Param("sSpplyId") String sSpplyId,
                             @Param("sItemNm") String sItemNm, @Param("fromDt") String fromDt, @Param("toDt") String toDt) throws Exception;

    StlMgntBaseInfoEntity selectStlMgntBaseInfo(@Param("sttlMgntUnqNo") String sttlMgntUnqNo) throws Exception;

    List<StlMgntDtlPtclEntity> selectStlMgntDtlPtclList(@Param("sttlMgntUnqNo") String sttlMgntUnqNo) throws Exception;

    StlMgntDtlPtclEntity selectStlMgntDtlPtcl(@Param("sttlMgntUnqNo") String sttlMgntUnqNo, @Param("sttlMgntDtlNo") String sttlMgntDtlNo) throws Exception;

    int insertStlMgntBaseInfo(@Param("userId") String userId, StlMgntBaseInfoEntity entity) throws Exception;

    int insertStlMgntDtlPtcl(@Param("userId") String userId, StlMgntDtlPtclEntity entity) throws Exception;

    int updateStlMgntBaseInfo(@Param("userId") String userId, StlMgntBaseInfoEntity entity) throws Exception;

    int updateStlMgntDtlPtcl(@Param("userId") String userId, StlMgntDtlPtclEntity entity) throws Exception;

    int deleteStlMgntBaseInfo(@Param("userId") String userId, StlMgntBaseInfoEntity entity) throws Exception;

    int deleteStlMgntDtlPtcl(@Param("userId") String userId, StlMgntDtlPtclEntity entity) throws Exception;

    WhsProcInfoPtclEntity selectWhsProcInfoPtcl(@Param("whsMgntUnqNo") String whsMgntUnqNo) throws Exception;

    RtnProcInfoPtclEntity selectRtnProcInfoPtcl(@Param("rtnMgntUnqNo") String rtnMgntUnqNo) throws Exception;

    int updateWhsProcInfoPtcl4SttlReq(@Param("userId") String userId, WhsProcInfoPtclEntity entity) throws Exception;

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

    int updateLoanMgntBaseInfo4SttlReqProc(@Param("userId") String userId, LoanMgntBaseInfoEntity entity) throws Exception;

    int updateWhsProcInfoPtcl4SttlReqProc(@Param("userId") String userId, StlMgntDtlPtclEntity entity) throws Exception;

    int updateRtnProcInfoPtcl4SttlReqProc(@Param("userId") String userId, StlMgntDtlPtclEntity entity) throws Exception;

    int updateStlMgntBaseInfo4SttlReqProc(@Param("userId") String userId, StlMgntBaseInfoEntity entity) throws Exception;

    int updateStlMgntBaseInfo4SttlConfirm(@Param("userId") String userId, StlMgntBaseInfoEntity entity) throws Exception;

    int updateStlMgntBaseInfo4Rcpt(@Param("userId") String userId, StlMgntBaseInfoEntity entity) throws Exception;

    int updateStlMgntBaseInfo4SttlReject(@Param("userId") String userId, StlMgntBaseInfoEntity entity) throws Exception;


    List<StlMgntDtlPtclEntity> selectSttlWhsPtclList(@Param("brandId") String brandId, List<WhsProcInfoPtclEntity> gridUpdateData )throws Exception;
    StlMgntBaseInfoEntity selectSttlWhsBaseInfo(@Param("brandId") String brandId, List<WhsProcInfoPtclEntity> gridUpdateData )throws Exception;

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

}
