package com.jwipc.finance.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jwipc.finance.entity.CostInvoicedApply;
import com.jwipc.finance.mapper.CostInvoicedApplyMapper;
import com.jwipc.finance.model.po.CostInvoicedApplyPO;
import com.jwipc.finance.model.po.InvoicedApplyPrintPO;
import com.jwipc.finance.model.query.CostInvoicedApplyQuery;
import com.jwipc.finance.service.ICostInvoicedApplyService;
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-05
 */
@Service
public class CostInvoicedApplyServiceImpl extends ServiceImpl<CostInvoicedApplyMapper, CostInvoicedApply> implements ICostInvoicedApplyService {

    @Override
    public String findInvoiceVoucher(Long id) {
        return baseMapper.findInvoiceVoucher(id);
    }

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

    @Override
    public List<CostInvoicedApplyPO> selectDataByQuery(Page<CostInvoicedApply> dbPage, CostInvoicedApplyQuery query) {
        if (dbPage==null){
            return baseMapper.findPageByQuery(query);
        }
        return baseMapper.findPageByQuery(dbPage,query);
    }
}
