package com.jwipc.contract.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jwipc.contract.entity.ContractPayDetail;
import com.jwipc.contract.mapper.ContractPayDetailMapper;
import com.jwipc.contract.model.po.AmountSumVO;
import com.jwipc.contract.model.po.ContractPayDetailsVo;
import com.jwipc.contract.model.query.ContractPayDetailsQuery;
import com.jwipc.contract.service.IContractPayDetailService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zx
 * @since 2024-03-12
 */
@Service
public class ContractPayDetailServiceImpl extends ServiceImpl<ContractPayDetailMapper, ContractPayDetail> implements IContractPayDetailService {

    @Resource
    ContractPayDetailMapper contractPayDetailMapper;

    @Override
    public List<ContractPayDetailsVo> detailLists(Page<ContractPayDetailsVo> page, ContractPayDetailsQuery payDetailsQuery) {
        return contractPayDetailMapper.detailLists(page,payDetailsQuery);
    }

    @Override
    public List<AmountSumVO> amountSum(String payStageIds,String contractIds ,String payId) {
        List<AmountSumVO> list = contractPayDetailMapper.amountSum(payStageIds,contractIds,payId);
        return list;
    }

    @Override
    public String getAmountPaid(Long contractId, Long payStageId){
        return contractPayDetailMapper.getAmountPaid(contractId,payStageId);
    }
}
