package com.ga.core.mapper.income;

import com.ga.core.vo.income.AgentAnnualIncomeResp;
import com.ga.core.vo.income.AgentAnnualIncomeSearchParam;
import com.ga.core.vo.income.AgentAnnualIncomeVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AgentAnnualIncomeMapper {

    /** 목록 조회 — settleYear / agentId / orgId 조건 */
    List<AgentAnnualIncomeResp> selectList(AgentAnnualIncomeSearchParam param);

    /** 단건 상세 (복합키: agentId + settleYear) */
    AgentAnnualIncomeResp selectDetailById(@Param("agentId") Long agentId,
                                           @Param("settleYear") int settleYear);

    /**
     * 연도 전체 UPSERT 집계 (전체 설계사).
     */
    int upsertAggregate(@Param("year") int year);
}
