package com.ga.core.mapper.commission;

import com.ga.core.vo.commission.RecruiterCommissionLedgerResp;
import com.ga.core.vo.commission.RecruiterCommissionLedgerSearchParam;
import com.ga.core.vo.commission.RecruiterCommissionLedgerVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * recruiter_commission_ledger Mapper — 도입수수료 원장 (V116)
 */
@Mapper
public interface RecruiterCommissionLedgerMapper {

    RecruiterCommissionLedgerResp selectById(@Param("ledgerId") Long ledgerId);

    List<RecruiterCommissionLedgerResp> selectList(RecruiterCommissionLedgerSearchParam param);

    int insert(RecruiterCommissionLedgerVO vo);

    int updateStatus(@Param("ledgerId") Long ledgerId, @Param("status") String status);

    int delete(@Param("ledgerId") Long ledgerId);

    /**
     * 정산월 기준 도입자 설계사별 도입수수료 합계 — AggregateStep other_commission_total 가산용.
     * recruiter_agent_id 기준으로 agentId alias, CANCELLED 제외.
     */
    List<Map<String, Object>> aggregateByAgent(@Param("settleMonth") String settleMonth);
}
