package com.jwipc.inquiry.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jwipc.inquiry.entity.InquiryTemplate;
import com.jwipc.inquiry.mapper.InquiryTemplateMapper;
import com.jwipc.inquiry.model.po.InquiryTemplatePO;
import com.jwipc.inquiry.model.query.InquiryTemplateQuery;
import com.jwipc.inquiry.service.IInquiryTemplateService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 询价模板表 服务实现类
 * </p>
 *
 * @author shenyang.ou
 * @since 2024-02-04
 */
@Service
public class InquiryTemplateServiceImpl extends ServiceImpl<InquiryTemplateMapper, InquiryTemplate> implements IInquiryTemplateService {

    @Override
    public List<InquiryTemplatePO> findPageByQuery(Page<InquiryTemplate> dbPage, InquiryTemplateQuery query) {
        if (dbPage==null){
            return baseMapper.findPageByQuery(query);
        }
        return baseMapper.findPageByQuery(dbPage,query);
    }

    @Override
    public List<InquiryTemplatePO> getAllListByPurchaseGroupCode(String purchaseGroupCode) {
        return baseMapper.getAllListByPurchaseGroupCode(purchaseGroupCode);
    }
}
