package com.ga.core.mapper.settle;

import com.ga.core.vo.settle.CommissionStatementResp;
import com.ga.core.vo.settle.CommissionStatementSearchParam;
import com.ga.core.vo.settle.CommissionStatementVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CommissionStatementMapper {

    List<CommissionStatementResp> selectList(CommissionStatementSearchParam param);

    CommissionStatementResp selectDetailById(@Param("statementId") Long statementId);

    CommissionStatementVO selectById(@Param("statementId") Long statementId);

    /** UNIQUE(agent_id, settle_month, statement_type) 조회 — 재발급 판단용 */
    CommissionStatementVO selectByAgentMonth(@Param("agentId") Long agentId,
                                             @Param("settleMonth") String settleMonth,
                                             @Param("statementType") String statementType);

    int insert(CommissionStatementVO vo);

    int update(CommissionStatementVO vo);

    int updateStatus(@Param("statementId") Long statementId, @Param("issueStatus") String issueStatus);
}
