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.EEnterpriseBasicInfo;
import com.zksy.info.mapper.EEnterpriseBasicInfoMapper;
import com.zksy.info.service.EEnterpriseBasicInfoService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Administrator
* @description 针对表【e_enterprise_basic_info(企业信息表)】的数据库操作Service实现
* @createDate 2025-07-15 13:51:48
*/
@Service
public class EEnterpriseBasicInfoServiceImpl extends ServiceImpl<EEnterpriseBasicInfoMapper, EEnterpriseBasicInfo>
    implements EEnterpriseBasicInfoService{

    @Override
    public Page<EEnterpriseBasicInfo> findByPage(long pageNum, long pageSize, String enterpriseName, String unifiedSocialCreditCode, String isAboveDesignatedSize, String isHighTech) {
        Page<EEnterpriseBasicInfo> page = new Page<>(pageNum,pageSize);
        LambdaQueryWrapper<EEnterpriseBasicInfo> queryWrapper = new LambdaQueryWrapper();
        queryWrapper.like(enterpriseName != null,EEnterpriseBasicInfo::getEnterpriseName,enterpriseName);
        queryWrapper.like(unifiedSocialCreditCode != null,EEnterpriseBasicInfo::getUnifiedSocialCreditCode,unifiedSocialCreditCode);
        queryWrapper.like(isAboveDesignatedSize != null,EEnterpriseBasicInfo::getIsAboveDesignatedSize,isAboveDesignatedSize);
        queryWrapper.like(isHighTech != null,EEnterpriseBasicInfo::getIsHighTech,isHighTech);
        Page<EEnterpriseBasicInfo> page1 = this.page(page, queryWrapper);
        return page1;
    }

    @Override
    public List<EEnterpriseBasicInfo> getEEnterpriseBasicInfoList(String enterpriseName, String unifiedSocialCreditCode, String isAboveDesignatedSize, String isHighTech) {
        LambdaQueryWrapper<EEnterpriseBasicInfo> queryWrapper = new LambdaQueryWrapper();
        queryWrapper.like(enterpriseName != null,EEnterpriseBasicInfo::getEnterpriseName,enterpriseName);
        queryWrapper.like(unifiedSocialCreditCode != null,EEnterpriseBasicInfo::getUnifiedSocialCreditCode,unifiedSocialCreditCode);
        queryWrapper.like(isAboveDesignatedSize != null,EEnterpriseBasicInfo::getIsAboveDesignatedSize,isAboveDesignatedSize);
        queryWrapper.like(isHighTech != null,EEnterpriseBasicInfo::getIsHighTech,isHighTech);
        List<EEnterpriseBasicInfo> list = this.list(queryWrapper);
        return list;
    }
}




