package com.ruoyi.reportpub.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
        import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.reportpub.mapper.RzgLocarnoStatisticsInfoMapper;
import com.ruoyi.reportpub.domain.RzgLocarnoStatisticsInfo;
import com.ruoyi.reportpub.service.IRzgLocarnoStatisticsInfoService;

/**
 * 专利公开-洛迦诺统计Service业务层处理
 *
 * @author ruoyi
 * @date 2023-03-27
 */
@Service
public class RzgLocarnoStatisticsInfoServiceImpl extends ServiceImpl<RzgLocarnoStatisticsInfoMapper, RzgLocarnoStatisticsInfo> implements IRzgLocarnoStatisticsInfoService {

    /**
     * 查询专利公开-洛迦诺统计列表
     *
     * @param rzgLocarnoStatisticsInfo 专利公开-洛迦诺统计
     * @return 专利公开-洛迦诺统计集合
     * @date 2023-03-27
     */
    @Override
    public List<RzgLocarnoStatisticsInfo> queryList(RzgLocarnoStatisticsInfo rzgLocarnoStatisticsInfo) {
        QueryWrapper<RzgLocarnoStatisticsInfo> queryWrapper = Wrappers.query();
                if (  StringUtils.isNotNull(rzgLocarnoStatisticsInfo.getCityCode())){
                    queryWrapper.eq("city_code", rzgLocarnoStatisticsInfo.getCityCode());
                }
                if ( StringUtils.isNotEmpty(rzgLocarnoStatisticsInfo.getCityName())  ){
                    queryWrapper.like("city_name", rzgLocarnoStatisticsInfo.getCityName());
                }
                if ( StringUtils.isNotEmpty(rzgLocarnoStatisticsInfo.getYear())  ){
                    queryWrapper.eq("year", rzgLocarnoStatisticsInfo.getYear());
                }
                if ( StringUtils.isNotEmpty(rzgLocarnoStatisticsInfo.getMonth())  ){
                    queryWrapper.eq("month", rzgLocarnoStatisticsInfo.getMonth());
                }
                if ( StringUtils.isNotEmpty(rzgLocarnoStatisticsInfo.getClassificationNumber())  ){
                    queryWrapper.eq("classification_number", rzgLocarnoStatisticsInfo.getClassificationNumber());
                }
                if ( StringUtils.isNotEmpty(rzgLocarnoStatisticsInfo.getPatentType())  ){
                    queryWrapper.eq("patent_type", rzgLocarnoStatisticsInfo.getPatentType());
                }
                if ( StringUtils.isNotEmpty(rzgLocarnoStatisticsInfo.getApplicantType())  ){
                    queryWrapper.eq("applicant_type", rzgLocarnoStatisticsInfo.getApplicantType());
                }
                if ( StringUtils.isNotEmpty(rzgLocarnoStatisticsInfo.getHigherSchool())  ){
                    queryWrapper.eq("higher_school", rzgLocarnoStatisticsInfo.getHigherSchool());
                }
                if ( StringUtils.isNotEmpty(rzgLocarnoStatisticsInfo.getResearchInstitute())  ){
                    queryWrapper.eq("research_institute", rzgLocarnoStatisticsInfo.getResearchInstitute());
                }
                if ( StringUtils.isNotEmpty(rzgLocarnoStatisticsInfo.getEnterprise())  ){
                    queryWrapper.eq("enterprise", rzgLocarnoStatisticsInfo.getEnterprise());
                }
                if ( StringUtils.isNotEmpty(rzgLocarnoStatisticsInfo.getInstitutions())  ){
                    queryWrapper.eq("institutions", rzgLocarnoStatisticsInfo.getInstitutions());
                }
                if ( StringUtils.isNotEmpty(rzgLocarnoStatisticsInfo.getIndividual())  ){
                    queryWrapper.eq("individual", rzgLocarnoStatisticsInfo.getIndividual());
                }
                if ( StringUtils.isNotEmpty(rzgLocarnoStatisticsInfo.getNumber())  ){
                    queryWrapper.eq("number", rzgLocarnoStatisticsInfo.getNumber());
                }
                if ( StringUtils.isNotEmpty(rzgLocarnoStatisticsInfo.getProportion())  ){
                    queryWrapper.eq("proportion", rzgLocarnoStatisticsInfo.getProportion());
                }
                if ( StringUtils.isNotEmpty(rzgLocarnoStatisticsInfo.getCategoryNumber())  ){
                    queryWrapper.eq("category_number", rzgLocarnoStatisticsInfo.getCategoryNumber());
                }
                if ( StringUtils.isNotEmpty(rzgLocarnoStatisticsInfo.getCategoryName())  ){
                    queryWrapper.like("category_name", rzgLocarnoStatisticsInfo.getCategoryName());
                }
                if (  StringUtils.isNotNull(rzgLocarnoStatisticsInfo.getStatus())){
                    queryWrapper.eq("status", rzgLocarnoStatisticsInfo.getStatus());
                }
        queryWrapper.orderByDesc("id");
        return this.list(queryWrapper);
    }
}
