package com.ruoyi.report.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.report.mapper.RzlLocarnoStatisticsInfoMapper;
import com.ruoyi.report.domain.RzlLocarnoStatisticsInfo;
import com.ruoyi.report.service.IRzlLocarnoStatisticsInfoService;

/**
 * 专利有效-洛迦诺统计Service业务层处理
 *
 * @author ruoyi
 * @date 2023-03-26
 */
@Service
public class RzlLocarnoStatisticsInfoServiceImpl extends ServiceImpl<RzlLocarnoStatisticsInfoMapper, RzlLocarnoStatisticsInfo> implements IRzlLocarnoStatisticsInfoService {

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