package com.jwipc.finance.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jwipc.finance.entity.CompanyInvoicedApply;
import com.jwipc.finance.entity.CompanyInvoicedApply;
import com.jwipc.finance.mapper.CompanyInvoicedApplyMapper;
import com.jwipc.finance.model.po.CompanyInvoicedApplyPO;
import com.jwipc.finance.model.po.CreatePcaDetailPO;
import com.jwipc.finance.model.po.InvoicedApplyPrintPO;
import com.jwipc.finance.model.query.CompanyInvoicedApplyQuery;
import com.jwipc.finance.service.ICompanyInvoicedApplyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 对账模块-公司间销售开票申请 服务实现类
 * </p>
 *
 * @author shenyang.ou
 * @since 2025-11-18
 */
@Service
public class CompanyInvoicedApplyServiceImpl extends ServiceImpl<CompanyInvoicedApplyMapper, CompanyInvoicedApply> implements ICompanyInvoicedApplyService {
    @Override
    public String findInvoiceVoucher(Long id) {
        return baseMapper.findInvoiceVoucher(id);
    }

    @Override
    public InvoicedApplyPrintPO selectPrintDataById(Long id) {
        return baseMapper.selectPrintDataById(id);
    }

    @Override
    public List<CompanyInvoicedApplyPO> selectDataByQuery(Page<CompanyInvoicedApply> dbPage, CompanyInvoicedApplyQuery query) {
        if (dbPage==null){
            return baseMapper.findPageByQuery(query);
        }
        return baseMapper.findPageByQuery(dbPage,query);
    }

    @Override
    public List<CreatePcaDetailPO> queryCodApplyInvoiceById(Long id) {
        return baseMapper.queryCodApplyInvoiceById(id);
    }
}
