package com.ga.core.mapper.training;

import com.ga.core.vo.training.AgentTrainingResp;
import com.ga.core.vo.training.AgentTrainingSearchParam;
import com.ga.core.vo.training.AgentTrainingVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * agent_training Mapper.
 */
@Mapper
public interface AgentTrainingMapper {

    AgentTrainingResp selectById(@Param("trainingId") Long trainingId);

    List<AgentTrainingResp> selectList(AgentTrainingSearchParam param);

    /**
     * 설계사 + 연도 기준 연간 이수 시간 합계.
     * 의무 12시간 충족 여부 검사 시 호출.
     */
    BigDecimal selectAnnualHoursByAgent(@Param("agentId") Long agentId,
                                        @Param("year") int year);

    int insert(AgentTrainingVO vo);

    int update(AgentTrainingVO vo);

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