package com.oqpo.api.mapper.stockmng;


import com.oqpo.api.entity.stockmng.WhsMgntBaseInfoEntity;
import com.oqpo.api.entity.stockmng.WhsMgntBaseLocEntity;
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 WhsMngMapper {

    List<WhsMgntBaseInfoEntity> selectWhsMngGridList(@Param("sBrandId") String sBrandId, @Param("sStoreId") String sStoreId, @Param("sWhsDvsn") String sWhsDvsn, @Param("sWhsStCd") String sWhsStCd,
                                                     @Param("sWhsNm") String sWhsNm, GridRequest gridRequest) throws Exception;

    int selectWhsMngGridCnt(@Param("sBrandId") String sBrandId, @Param("sStoreId") String sStoreId, @Param("sWhsDvsn") String sWhsDvsn, @Param("sWhsStCd") String sWhsStCd,
                            @Param("sWhsNm") String sWhsNm) throws Exception;

    WhsMgntBaseInfoEntity selectWhsMgntBaseInfo(@Param("brandId") String brandId, @Param("storeId") String storeId, @Param("whsId") String whsId) throws Exception;

    List<WhsMgntBaseLocEntity> selectWhsLocGridList(@Param("brandId") String brandId, @Param("whsId") String whsId, GridRequest gridRequest) throws Exception;

    int selectWhsLocGridCnt(@Param("brandId") String brandId, @Param("whsId") String whsId) throws Exception;

    int insertWhsMgntBaseInfo(@Param("userId") String userId, WhsMgntBaseInfoEntity entity) throws Exception;

    int updateWhsMgntBaseInfo(@Param("userId") String userId, WhsMgntBaseInfoEntity entity) throws Exception;

    int deleteWhsMgntBaseInfo(@Param("userId") String userId, WhsMgntBaseInfoEntity entity) throws Exception;

    int deleteWhsMgntBaseLoc4Info(@Param("userId") String userId, WhsMgntBaseInfoEntity entity) throws Exception;

    String selectNextLocation4Whs(@Param("brandId") String brandId, @Param("whsId") String whsId) throws Exception;

    int insertWhsMgntBaseLoc(@Param("userId") String userId, WhsMgntBaseLocEntity entity) throws Exception;

    int updateWhsMgntBaseLoc(@Param("userId") String userId, WhsMgntBaseLocEntity entity) throws Exception;

    int deleteWhsMgntBaseLoc(@Param("userId") String userId, WhsMgntBaseLocEntity entity) throws Exception;

    int updateStoreWhsStatus(@Param("userId") String userId, @Param("brandId") String brandId, @Param("storeId") String storeId, @Param("whsStCd") String whsStCd) throws Exception;
    int updateWhsLocStatus(@Param("userId") String userId, @Param("brandId") String brandId, @Param("storeId") String storeId, @Param("locStCd") String locStCd) throws Exception;

    int updateCloseWhs(@Param("userId") String userId, @Param("brandId") String brandId, @Param("afflShopId") String afflShopId) throws Exception;
    int updateCloseWhsLoc(@Param("userId") String userId, @Param("brandId") String brandId, @Param("afflShopId") String afflShopId) throws Exception;

    List<WhsMgntBaseInfoEntity>  selectPopWhsLocList(@Param("sBrandId") String sBrandId, @Param("sWhsDvsn") String sWhsDvsn, @Param("sStoreId") String sStoreId, @Param("sWhsNm") String sWhsNm) throws Exception;
}
