package com.zksy.info.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zksy.info.domain.EQualificationCertificate;
import com.zksy.info.service.EQualificationCertificateService;
import com.zksy.info.mapper.EQualificationCertificateMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Administrator
 * @description 针对表【e_qualification_certificate(资质证书表)】的数据库操作Service实现
 * @createDate 2025-06-30 16:37:01
 */
@Service
public class EQualificationCertificateServiceImpl extends ServiceImpl<EQualificationCertificateMapper, EQualificationCertificate>
        implements EQualificationCertificateService{

    @Override
    public Page<EQualificationCertificate> findByPage(long pageNum, long pageSize, String entName, String certificateType, String certificateNo) {
        Page<EQualificationCertificate> page = new Page<>(pageNum,pageSize);
        LambdaQueryWrapper<EQualificationCertificate> queryWrapper = new LambdaQueryWrapper();
        queryWrapper.like(entName != null,EQualificationCertificate::getEntName,entName);
        queryWrapper.like(certificateType != null,EQualificationCertificate::getCertificateType,certificateType);
        queryWrapper.like(certificateNo != null,EQualificationCertificate::getCertificateNo,certificateNo);
        Page<EQualificationCertificate> page1 = this.page(page, queryWrapper);
        return page1;
    }

    @Override
    public List<EQualificationCertificate> getEQualificationCertificateList(String entName, String certificateType, String certificateNo) {
        LambdaQueryWrapper<EQualificationCertificate> queryWrapper = new LambdaQueryWrapper();
        queryWrapper.like(entName != null,EQualificationCertificate::getEntName,entName);
        queryWrapper.like(certificateType != null,EQualificationCertificate::getCertificateType,certificateType);
        queryWrapper.like(certificateNo != null,EQualificationCertificate::getCertificateNo,certificateNo);
        List<EQualificationCertificate> list = this.list(queryWrapper);
        return list;
    }
}




