package com.oqpo.api.mapper.oper;


import com.oqpo.api.entity.oper.NticeEntity;
import com.oqpo.api.entity.oper.NticeTargetEntity;
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 NticeMapper {
    List<NticeEntity> selectNticeGridList(@Param("afflShopId") String afflShopId, @Param("brandId") String brandId, @Param("authTpCd") String authTpCd,
                                          @Param("sAfflShopId") String sAfflShopId, @Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt,
                                          @Param("sNticeTitl") String sNticeTitl, GridRequest gridRequest)throws Exception;

    int selectNticeGridCnt(@Param("afflShopId") String afflShopId, @Param("brandId") String brandId, @Param("authTpCd") String authTpCd,
                           @Param("sAfflShopId") String sAfflShopId, @Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt,
                           @Param("sNticeTitl") String sNticeTitl) throws Exception;

    List<NticeTargetEntity> selectNticeTargetGridList(@Param("nticeNo") String nticeNo, GridRequest gridRequest)throws Exception;
    int selectNticeTargetGridCnt(@Param("nticeNo") String nticeNo) throws Exception;
    NticeEntity selectNticeInfo(@Param("nticeNo") String nticeNo) throws Exception;

    int insertNticeInfo(@Param("userId") String userId, NticeEntity entity) throws Exception;
    int updateNticeInfo(@Param("userId") String userId, NticeEntity entity) throws Exception;

    int insertNticeTarget(@Param("userId") String userId, @Param("nticeNo") String nticeNo, List<NticeTargetEntity> gridInsertData) throws Exception;

    int deleteNticeTarget(@Param("nticeNo") String nticeNo, List<NticeTargetEntity> gridDeleteData) throws Exception;
    int updateNticeViewCnt(@Param("nticeNo") String nticeNo) throws Exception;

    List<NticeEntity> selectMNticeList(@Param("userId") String userId)throws Exception;
}
