package com.ruoyi.adjust.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.adjust.domain.DPatentDataCollationLog;
import com.ruoyi.adjust.mapper.DPatentDataCollationLogMapper;
import com.ruoyi.adjust.service.IDPatentDataCollationLogService;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 专利数据整理历史Service业务层处理
 *
 * @author ruoyi
 * @date 2023-04-19
 */
@Service
public class DPatentDataCollationLogServiceImpl extends ServiceImpl<DPatentDataCollationLogMapper, DPatentDataCollationLog> implements IDPatentDataCollationLogService {

    /**
     * 查询专利数据整理历史列表
     *
     * @param dPatentDataCollationLog 专利数据整理历史
     * @return 专利数据整理历史集合
     * @date 2023-04-19
     */
    @Override
    public List<DPatentDataCollationLog> queryList(DPatentDataCollationLog dPatentDataCollationLog) {
        QueryWrapper<DPatentDataCollationLog> queryWrapper = Wrappers.query();
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getAdjustType())) {
            queryWrapper.eq("adjust_type", dPatentDataCollationLog.getAdjustType());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getDataType())) {
            queryWrapper.eq("data_type", dPatentDataCollationLog.getDataType());
        }
        if (StringUtils.isNotNull(dPatentDataCollationLog.getAdjustDataId())) {
            queryWrapper.eq("adjust_data_id", dPatentDataCollationLog.getAdjustDataId());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getAppNumber())) {
            queryWrapper.eq("app_number", dPatentDataCollationLog.getAppNumber());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getAppDate())) {
            queryWrapper.eq("app_date", dPatentDataCollationLog.getAppDate());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getAppli())) {
            queryWrapper.eq("appli", dPatentDataCollationLog.getAppli());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getAppliTypeSrc())) {
            queryWrapper.eq("appli_type_src", dPatentDataCollationLog.getAppliTypeSrc());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getAppliType())) {
            queryWrapper.eq("appli_type", dPatentDataCollationLog.getAppliType());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getAppliAddress())) {
            queryWrapper.eq("appli_address", dPatentDataCollationLog.getAppliAddress());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getAppliProvinceCode())) {
            queryWrapper.eq("appli_province_code", dPatentDataCollationLog.getAppliProvinceCode());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getAppliProvince())) {
            queryWrapper.eq("appli_province", dPatentDataCollationLog.getAppliProvince());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getAppliCityCode())) {
            queryWrapper.eq("appli_city_code", dPatentDataCollationLog.getAppliCityCode());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getAppliCity())) {
            queryWrapper.eq("appli_city", dPatentDataCollationLog.getAppliCity());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getAppliCountyCode())) {
            queryWrapper.eq("appli_county_code", dPatentDataCollationLog.getAppliCountyCode());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getAppliCounty())) {
            queryWrapper.eq("appli_county", dPatentDataCollationLog.getAppliCounty());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getModifyAppliProvinceCode())) {
            queryWrapper.eq("modify_appli_province_code", dPatentDataCollationLog.getModifyAppliProvinceCode());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getModifyAppliProvince())) {
            queryWrapper.eq("modify_appli_province", dPatentDataCollationLog.getModifyAppliProvince());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getModifyAppliCityCode())) {
            queryWrapper.eq("modify_appli_city_code", dPatentDataCollationLog.getModifyAppliCityCode());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getModifyAppliCity())) {
            queryWrapper.eq("modify_appli_city", dPatentDataCollationLog.getModifyAppliCity());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getModifyAppliCountyCode())) {
            queryWrapper.eq("modify_appli_county_code", dPatentDataCollationLog.getModifyAppliCountyCode());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getModifyAppliCounty())) {
            queryWrapper.eq("modify_appli_county", dPatentDataCollationLog.getModifyAppliCounty());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getHighValue())) {
            queryWrapper.eq("high_value", dPatentDataCollationLog.getHighValue());
        }
        if (StringUtils.isNotNull(dPatentDataCollationLog.getInboundDate())) {
            queryWrapper.eq("inbound_date", dPatentDataCollationLog.getInboundDate());
        }
        if (StringUtils.isNotNull(dPatentDataCollationLog.getAddressAdjustmentTime())) {
            queryWrapper.eq("address_adjustment_time", dPatentDataCollationLog.getAddressAdjustmentTime());
        }
        if (StringUtils.isNotNull(dPatentDataCollationLog.getApplyAdjustmentTime())) {
            queryWrapper.eq("apply_adjustment_time", dPatentDataCollationLog.getApplyAdjustmentTime());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getTitle())) {
            queryWrapper.eq("title", dPatentDataCollationLog.getTitle());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getSyncStatus())) {
            queryWrapper.eq("sync_status", dPatentDataCollationLog.getSyncStatus());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getPubNumber())) {
            queryWrapper.eq("pub_number", dPatentDataCollationLog.getPubNumber());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getCurrPatentStatus())) {
            queryWrapper.eq("curr_patent_status", dPatentDataCollationLog.getCurrPatentStatus());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getCurrPatentHolder())) {
            queryWrapper.eq("curr_patent_holder", dPatentDataCollationLog.getCurrPatentHolder());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getPatentType())) {
            queryWrapper.eq("patent_type", dPatentDataCollationLog.getPatentType());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getIpcMain())) {
            queryWrapper.eq("ipc_main", dPatentDataCollationLog.getIpcMain());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getLocStr())) {
            queryWrapper.eq("loc_str", dPatentDataCollationLog.getLocStr());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getNationalEcoStr())) {
            queryWrapper.eq("national_eco_str", dPatentDataCollationLog.getNationalEcoStr());
        }
        if (StringUtils.isNotNull(dPatentDataCollationLog.getPatTranCounts())) {
            queryWrapper.eq("pat_tran_counts", dPatentDataCollationLog.getPatTranCounts());
        }
        if (StringUtils.isNotNull(dPatentDataCollationLog.getAppTranCounts())) {
            queryWrapper.eq("app_tran_counts", dPatentDataCollationLog.getAppTranCounts());
        }
        if (StringUtils.isNotNull(dPatentDataCollationLog.getLicCounts())) {
            queryWrapper.eq("lic_counts", dPatentDataCollationLog.getLicCounts());
        }
        if (StringUtils.isNotNull(dPatentDataCollationLog.getPleCounts())) {
            queryWrapper.eq("ple_counts", dPatentDataCollationLog.getPleCounts());
        }
        if (StringUtils.isNotNull(dPatentDataCollationLog.getPreCounts())) {
            queryWrapper.eq("pre_counts", dPatentDataCollationLog.getPreCounts());
        }
        if (StringUtils.isNotNull(dPatentDataCollationLog.getCurtCounts())) {
            queryWrapper.eq("curt_counts", dPatentDataCollationLog.getCurtCounts());
        }
        if (StringUtils.isNotEmpty(dPatentDataCollationLog.getAgencyName())) {
            queryWrapper.like("agency_name", dPatentDataCollationLog.getAgencyName());
        }
        if (StringUtils.isNotNull(dPatentDataCollationLog.getStatus())) {
            queryWrapper.eq("status", dPatentDataCollationLog.getStatus());
        }
        queryWrapper.orderByDesc("id");
        return this.list(queryWrapper);
    }
}
