package com.oqpo.api.mapper.pomng;


import com.oqpo.api.entity.pomng.PchOdrBaseInfoEntity;
import com.oqpo.api.entity.pomng.PchOdrDtlPtclEntity;
import com.oqpo.api.entity.pomng.PchReqBaseInfoEntity;
import com.oqpo.api.entity.pomng.PchReqDtlPtclEntity;
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 PchOrdMapper {
    List<PchOdrBaseInfoEntity> selectRecPchInitInfo(@Param("brandId") String brandId, List<PchOdrDtlPtclEntity> gridUpdateData)throws Exception;
    List<PchOdrDtlPtclEntity> selectRecPchDtlInitInfo(@Param("brandId") String brandId, List<PchOdrDtlPtclEntity> gridUpdateData)throws Exception;
    PchOdrBaseInfoEntity selectPoInitInfo(@Param("brandId") String brandId)throws Exception;
    PchOdrDtlPtclEntity selectPoPchDtlSaveInfo(@Param("pchReqUnqNo") String pchReqUnqNo, @Param("pchReqDtlNo") String pchReqDtlNo)throws Exception;
    PchOdrDtlPtclEntity selectPoItemDtlSaveInfo(@Param("brandId") String brandId, @Param("itemId") String itemId, @Param("brandUnitUnqNo") String brandUnitUnqNo)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("brandId") String brandId, @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("brandId") String brandId, @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;




}
