package com.ga.core.mapper.commission;

import com.ga.core.vo.commission.IncomeCommissionLedgerResp;
import com.ga.core.vo.commission.IncomeCommissionLedgerSearchParam;
import com.ga.core.vo.commission.IncomeCommissionLedgerVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

/**
 * income_commission_ledger Mapper — 수입수수료 원장 (V88)
 */
@Mapper
public interface IncomeCommissionLedgerMapper {

    IncomeCommissionLedgerResp selectById(@Param("incomeId") Long incomeId);

    List<IncomeCommissionLedgerResp> selectList(IncomeCommissionLedgerSearchParam param);

    /** 보험사 + 정산월 수입수수료 합계 — margin_summary recalc 배치 용도 */
    BigDecimal sumByCarrierAndMonth(@Param("carrierId") Long carrierId,
                                   @Param("settleMonth") String settleMonth);

    int insert(IncomeCommissionLedgerVO vo);

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

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