package com.ga.core.mapper.commission;

import com.ga.core.vo.commission.AwardRuleResp;
import com.ga.core.vo.commission.AwardRuleSearchParam;
import com.ga.core.vo.commission.AwardRuleVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;

/**
 * award_rule Mapper — 시상 룰 마스터 (V92)
 */
@Mapper
public interface AwardRuleMapper {

    AwardRuleResp selectById(@Param("ruleId") Long ruleId);

    List<AwardRuleResp> selectList(AwardRuleSearchParam param);

    /**
     * 시상 유형 + 기준일 유효 룰 1건 조회.
     * 시상 계산 Service에서 호출.
     */
    AwardRuleVO selectActiveRule(@Param("awardType") String awardType,
                                @Param("baseDate") LocalDate baseDate);

    int insert(AwardRuleVO vo);

    int update(AwardRuleVO vo);

    int delete(@Param("ruleId") Long ruleId);
}
