package com.ga.core.mapper.commission;

import com.ga.core.vo.commission.RecognizedPerformanceLedgerResp;
import com.ga.core.vo.commission.RecognizedPerformanceLedgerSearchParam;
import com.ga.core.vo.commission.RecognizedPerformanceLedgerVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

/**
 * recognized_performance_ledger Mapper — 인정실적 원장 (V91)
 */
@Mapper
public interface RecognizedPerformanceLedgerMapper {

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

    List<RecognizedPerformanceLedgerResp> selectList(RecognizedPerformanceLedgerSearchParam param);

    /** 설계사 + 정산월 인정실적 합계 — 시상 기준 실적 산출 용도 */
    BigDecimal sumRecognizedByAgentAndMonth(@Param("agentId") Long agentId,
                                           @Param("settleMonth") String settleMonth);

    int insert(RecognizedPerformanceLedgerVO vo);

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

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