package com.fjhx.purchase.mapper.pay;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.purchase.entity.pay.po.Pay;
import com.fjhx.purchase.entity.pay.po.PayDetail;
import com.fjhx.purchase.entity.pay.vo.PayDetailVo;
import com.ruoyi.common.utils.wrapper.IWrapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * <p>
 * 采购付款明细 Mapper 接口
 * </p>
 *
 * @author 
 * @since 2023-04-13
 */
public interface PayDetailMapper extends BaseMapper<PayDetail> {

    /**
     * 发票明细分页
     */
    Page<PayDetailVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<PayDetail> wrapper);

    /**
     * 根据采购单ids查询已付款总额
     *
     * @param purchaseIds
     * @return
     */
    List<PayDetailVo> getSumMoneyByPurchaseIds(@Param("purchaseIds") List<Long> purchaseIds);

    List<PayDetail> getPayMoneyCountByPurchaseId(@Param("ew") QueryWrapper<Object> queryWrapper);

    List<Pay> getPayDetailList(@Param("purchaseIds") List<Long> purchaseIds);

    /**
     * 根据合同ID查询采购付款
     * @param contractIds
     * @return
     */
    List<Pay> getPayDetailListByContractIds(@Param("contractIds") List<Long> contractIds);

}
