package com.jwipc.inquiry.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jwipc.inquiry.entity.Inquiry;
import com.jwipc.inquiry.mapper.InquiryMapper;
import com.jwipc.inquiry.model.po.*;
import com.jwipc.inquiry.model.query.InquiryConvertContractQuery;
import com.jwipc.inquiry.model.query.InquiryQuery;
import com.jwipc.inquiry.service.IInquiryService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 询价表 服务实现类
 * </p>
 *
 * @author shenyang.ou
 * @since 2024-02-18
 */
@Service
public class InquiryServiceImpl extends ServiceImpl<InquiryMapper, Inquiry> implements IInquiryService {

    @Override
    public List<InquiryPO> findPageByQuery(Page<Inquiry> dbPage, InquiryQuery query) {
        if (dbPage==null){
            return baseMapper.findPageByQuery(query);
        }
        return baseMapper.findPageByQuery(dbPage,query);
    }

    @Override
    public List<InquiryMaterialQuotePO> materialQuoteList(Long inquiryId) {
        return baseMapper.materialQuoteList(inquiryId);
    }

    @Override
    public List<InquiryEditSupplierPO> supplierListByInquiryId(Long inquiryId) {
        return baseMapper.supplierListByInquiryId(inquiryId);
    }

    @Override
    public InquiryDetailByIdPO formDeatilById(Long xjId) {
        return baseMapper.formDeatilById(xjId);
    }

    @Override
    public Map formSupplierDeatilById(Long xjId) {
        return baseMapper.formSupplierDeatilById(xjId);
    }

    @Override
    public List<InquiryDetailByIdDetailPO> formMaterialDeatilById(Long xjId,String supplierId) {
        return baseMapper.formMaterialDeatilById(xjId,supplierId);
    }

    @Override
    public List<InquiryDetailByIdPO> xjlistFindByList(Long xjId) {
        return baseMapper.xjlistFindByList(xjId);
    }

    @Override
    public List<InquiryPO> inquiryContractList(InquiryConvertContractQuery query) {
        return baseMapper.inquiryContractList(query);
    }

    @Override
    public List<InquiryDetailByIdDetailPO> formDetailByMaterialSupplierId(List<String> inquiryIdList, String supplierId) {
        return baseMapper.formDetailByMaterialSupplierId(inquiryIdList,supplierId);
    }

    @Override
    public List<InquiryDetailByIdPO> getConvertedContractByInquiryId(Long inquiryId) {
        return baseMapper.getConvertedContractByInquiryId(inquiryId);
    }

    @Override
    public List<InquiryCostContractPO> getInquiryCostContractList(InquiryConvertContractQuery query) {
        return baseMapper.getInquiryCostContractList(query);
    }
}
