package com.oqpo.api.mapper.stockmng;


import com.oqpo.api.entity.stinfo.BrandEntity;
import com.oqpo.api.entity.stockmng.StckMgntBaseInfoEntity;
import com.oqpo.api.entity.stockmng.StckMgntDtlHistEntity;
import com.oqpo.api.web.dto.request.GridRequest;
import io.swagger.annotations.ApiModelProperty;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface StockMngMapper {

    List<StckMgntBaseInfoEntity> selectStockMngGridList(@Param("sBrandId") String sBrandId, @Param("sStoreId") String sStoreId, @Param("sWhsId") String sWhsId, @Param("sLocation") String sLocation,
                                                        @Param("sItemClass1") String sItemClass1, @Param("sItemClass2") String sItemClass2, @Param("sItemClass3") String sItemClass3,
                                                        @Param("sItemClass4") String sItemClass4, @Param("sItemId") String sItemId, @Param("sItemNm") String sItemNm,
                                                        GridRequest gridRequest) throws Exception;

    int selectStockMngGridCnt(@Param("sBrandId") String sBrandId, @Param("sStoreId") String sStoreId, @Param("sWhsId") String sWhsId, @Param("sLocation") String sLocation,
                              @Param("sItemClass1") String sItemClass1, @Param("sItemClass2") String sItemClass2, @Param("sItemClass3") String sItemClass3,
                              @Param("sItemClass4") String sItemClass4, @Param("sItemId") String sItemId, @Param("sItemNm") String sItemNm) throws Exception;

    List<StckMgntDtlHistEntity> selectStockHistGridList(@Param("sBrandId") String sBrandId, @Param("sWhsId") String sWhsId, @Param("sLocation") String sLocation,
                                                        @Param("sItemId") String sItemId, @Param("sInoutCd") String sInoutCd,
                                                        @Param("fromDt") String fromDt, @Param("toDt") String toDt,
                                                        GridRequest gridRequest) throws Exception;

    int selectStockHistGridCnt(@Param("sBrandId") String sBrandId, @Param("sWhsId") String sWhsId, @Param("sLocation") String sLocation,
                               @Param("sItemId") String sItemId, @Param("sInoutCd") String sInoutCd,
                               @Param("fromDt") String fromDt, @Param("toDt") String toDt) throws Exception;

    StckMgntBaseInfoEntity selectStckMgntBaseInfo(@Param("brandId") String brandId, @Param("whsId") String whsId,
                                                  @Param("location") String location, @Param("itemId") String itemId) throws Exception;

    int insertStckMgntBaseInfo(@Param("userId") String userId, StckMgntBaseInfoEntity entity) throws Exception;

    int updateStckMgntBaseInfo4StckProc(@Param("userId") String userId, StckMgntBaseInfoEntity entity) throws Exception;

    int updateStckMgntBaseInfo4BaseChg(@Param("userId") String userId, StckMgntBaseInfoEntity entity) throws Exception;

    int insertStckMgntDtlHist(@Param("userId") String userId, StckMgntDtlHistEntity entity) throws Exception;

}
