package com.ga.core.mapper.settle;

import com.ga.core.vo.settle.PaymentResp;
import com.ga.core.vo.settle.PaymentVO;
import com.ga.core.vo.settle.SettleSearchParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

@Mapper
public interface PaymentMapper {
    List<PaymentResp> selectList(SettleSearchParam param);
    PaymentVO selectById(@Param("paymentId") Long paymentId);
    int insert(PaymentVO vo);
    int insertBatch(@Param("list") List<PaymentVO> list);
    int updateStatus(@Param("paymentId") Long paymentId,
                     @Param("status") String status,
                     @Param("failReason") String failReason);
    int updateTransferFile(@Param("paymentIds") List<Long> paymentIds,
                           @Param("transferFileId") Long transferFileId);
    int updateTaxes(@Param("paymentId") Long paymentId,
                    @Param("incomeTaxAmount") BigDecimal incomeTaxAmount,
                    @Param("localTaxAmount") BigDecimal localTaxAmount,
                    @Param("vatAmount") BigDecimal vatAmount,
                    @Param("netAmount") BigDecimal netAmount);
    int updateTaxesBatch(@Param("list") List<PaymentVO> list);

    int updateDeduction(@Param("paymentId") Long paymentId,
                        @Param("deductionAmount") BigDecimal deductionAmount,
                        @Param("netAmount") BigDecimal netAmount);

    List<PaymentVO> selectPendingByMonthAndBank(@Param("settleMonth") String settleMonth,
                                                @Param("bankCode") String bankCode);
    List<PaymentVO> selectBySettleMonth(@Param("settleMonth") String settleMonth);
    List<PaymentVO> selectByAgentAndMonth(@Param("agentId") Long agentId,
                                          @Param("settleMonth") String settleMonth);
}
