package com.jwipc.finance.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jwipc.finance.entity.PaymentCodApply;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jwipc.finance.entity.PaymentCodApplyDetail;
import com.jwipc.finance.model.po.PaymentCodApplyPO;
import com.jwipc.finance.model.query.PaymentApplyHeadQuery;
import org.apache.ibatis.annotations.Param;

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

/**
 * <p>
 * 对账付款申请主表 Mapper 接口
 * </p>
 *
 * @author WT
 * @since 2024-03-08
 */
public interface PaymentCodApplyMapper extends BaseMapper<PaymentCodApply> {

    List<PaymentCodApplyPO> selectListByPage(@Param("query") PaymentApplyHeadQuery query);

    List<PaymentCodApplyPO> selectListByPage(Page<PaymentCodApply> dbPage, @Param("query") PaymentApplyHeadQuery query);

    /**
     * 根据对账付款申请单ID获取当前申请单状态
     *
     * @param applyIdList 到付款申请单ID集合
     * @return 结果
     */
    List<PaymentCodApply> findDataStatusByIdList(@Param("applyIdList") List<Long> applyIdList);

    /**
     * 根据对账单号查询对账单付款情况
     * @param accountStatementNo
     * @return
     */
    List<PaymentCodApply> findAppDetailByAccountStatementNo(@Param("accountStatementNo") String accountStatementNo);

    List<PaymentCodApply> findDataBySupplierAndAmount(@Param("supplierCode") String supplierCode, @Param("oaBorrowMoney") BigDecimal oaBorrowMoney, @Param("monthNum") Integer monthNum,@Param("id") Long id);

    List<PaymentCodApplyDetail> findDataBySupplierAndAccountAndAmount(@Param("supplierCode") String supplierCode, @Param("accountStatementNo") String accountStatementNo, @Param("budOutMoney") BigDecimal budOutMoney,@Param("id") Long id);
}
