package cn.cecep.talroad.vo.query;

import cn.cecep.talroad.common.core.domain.query.PageQuery;
import cn.cecep.talroad.common.core.utils.StringUtils;
import cn.cecep.talroad.domain.PcFactory;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;
import java.util.Map;


/**
 * 企业基本信息对象 pc_factory
 *
 * @author szhpt
 * @date 2023-01-11*/
@ApiModel(value = "企业基本信息")
@EqualsAndHashCode(callSuper = false)
@Data
public class PcFactoryQuery extends PageQuery
{

    @ApiModelProperty(value = "主键id")
    private String id;

    private List<String> ids;

    @ApiModelProperty(value = "排污单位名称")
    private String factoryName;
    @ApiModelProperty(value = "市编码")
    private String cityCode;
    @ApiModelProperty(value = "市名称")
    private String cityName;
    @ApiModelProperty(value = "县编码")
    private String countryCode;
    @ApiModelProperty(value = "县名称")
    private String countryName;
    @ApiModelProperty(value = "是否重点排污单位")
    private String wipollunit;
    @ApiModelProperty(value = "许可管理类别")
    private String licenseManType;
    @ApiModelProperty(value = "许可是否整改")
    private String licenseWabarbeitung;
    @ApiModelProperty(value = "绩效管控级别")
    private String preConLevel;
    @ApiModelProperty(value = "排污许可证编码")
    private String pollDisLicenseCode;
    @ApiModelProperty(value = "排污许可证有效期限")
    private String pollDisLicenseDeadline;
    @ApiModelProperty(value = "排污许可证发证机关")
    private String pollDisLicenseIssuing;
    @ApiModelProperty(value = "统一社会信用代码")
    private String uscCode;
    @ApiModelProperty(value = "组织机构代码")
    private String insFramCode;
    @ApiModelProperty(value = "注册地址")
    private String address;
    @ApiModelProperty(value = "生产经营场所地址")
    private String prodBusiOperation;
    @ApiModelProperty(value = "邮政编码")
    private String postalCode;
    @ApiModelProperty(value = "行业类别")
    private String industryCategory;
    @ApiModelProperty(value = "其他行业类别")
    private String industryCategoryOther;
    @ApiModelProperty(value = "是否投产")
    private String whetherProduction;
    @ApiModelProperty(value = "投产日期")
    private String productionDate;
    @ApiModelProperty(value = "生产经营场所中心经度")
    private String productionLon;
    @ApiModelProperty(value = "生产经营场所中心纬度")
    private String productionLat;
    @ApiModelProperty(value = "法定代表人（主要负责人）")
    private String principalMan;
    @ApiModelProperty(value = "技术负责人")
    private String technicalMan;
    @ApiModelProperty(value = "固定电话")
    private String tel;
    @ApiModelProperty(value = "移动电话")
    private String mobileTelephone;
    @ApiModelProperty(value = "所在地是否属于大气重点控制区")
    private String whetherLocalKeyAri;
    @ApiModelProperty(value = "所在地是否属于总磷控制区")
    private String whetherLocalKeyPho;
    @ApiModelProperty(value = "所在地是否属于总氮控制区")
    private String whetherLocalKeyNitrogen;
    @ApiModelProperty(value = "所在地是否属于重金属污染物特别排放限值实施区域")
    private String whetherLocalKeyPollArea;
    @ApiModelProperty(value = "是否位于工业园区")
    private String whetherLocalPark;
    @ApiModelProperty(value = "是否有环评审批文件")
    private String whetherReviewFile;
    @ApiModelProperty(value = "是否有地方政府对违规项目的认定或备案文件")
    private String whetherGovProFile;
    @ApiModelProperty(value = "环境影响评价审批文件文号或备案编号")
    private String environmentalCode;
    @ApiModelProperty(value = "地方政府对违规项目的认定或备案文件文号")
    private String govProIdentFile;
    @ApiModelProperty(value = "主要污染物总量分配计划文件文号")
    private String majorPollutantsCode;
    @ApiModelProperty(value = "主要污染物类别")
    private String majorPollutantCategories;
    @ApiModelProperty(value = "大气主要污染物种类")
    private String airMainPollutants;
    @ApiModelProperty(value = "大气污染物排放规律")
    private String airEmissionPollutants;
    @ApiModelProperty(value = "大气污染物排放执行标准")
    private String airDischargePollutants;
    @ApiModelProperty(value = "废水主要污染物种类")
    private String waterMainPollutants;
    @ApiModelProperty(value = "废水污染物排放规律")
    private String waterEmissionPollutants;
    @ApiModelProperty(value = "废水污染物排放执行标准")
    private String waterDischargePollutants;
    @ApiModelProperty(value = "排污权使用和交易信息")
    private String useTradingEmission;
    @ApiModelProperty(value = "委托贮存/利用/处置环节污染防控技术要求")
    private String sudLinksPollutionPrevention;

    @ApiModelProperty(value = "工业园区名称")
    private String industrialParkName;
    @ApiModelProperty(value = "工业园区编码")
    private String industrialParkCode;
    @ApiModelProperty(value = "是否有主要污染物总量分配计划文件")
    private String pollutantTotalFileWhere;

    @ApiModelProperty(value = "生态环境信用类别")
    private String ecoEnvCreditLevel;

    @ApiModelProperty(value = "根据该参数，返回结果中增加企业是否包含指定标签值。数组中第一个值为标签id,第二个值为标签值编码")
    private List<String> labelAndValue;

    @ApiModel(value = "高级搜索查询条件vo")
    @Data
    public static class SearchVo extends PageQuery {
        @ApiModelProperty(value = "企业名称")
        private String factoryName;

        @ApiModelProperty(value = "标签")
        private Map<String, Object> labelMap;

        @ApiModelProperty(value = "是否展示企业重点标签")
        private Boolean showMainLable;

        @ApiModelProperty(value = "根据该参数，返回结果中增加企业是否包含指定标签值。数组中第一个值为标签id,第二个值为标签值编码")
        private List<String> labelAndValue;
    }

    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<PcFactory> createLambdaQueryWrapper(PcFactoryQuery query) {
        QueryWrapper<PcFactory> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotEmpty(query.getId()), "id", query.getId());
        wrapper.like(StringUtils.isNotEmpty(query.getFactoryName()), "factory_name", query.getFactoryName());
        wrapper.eq(ObjectUtil.isNotNull(query.getCityCode()), "city_code", query.getCityCode());
        wrapper.eq(ObjectUtil.isNotNull(query.getCityName()), "city_name", query.getCityName());
        wrapper.eq(ObjectUtil.isNotNull(query.getCountryCode()), "country_code", query.getCountryCode());
        wrapper.eq(ObjectUtil.isNotNull(query.getCountryName()), "country_name", query.getCountryName());
        wrapper.eq(ObjectUtil.isNotNull(query.getWipollunit()), "wipollunit", query.getWipollunit());
        wrapper.eq(ObjectUtil.isNotNull(query.getLicenseManType()), "license_man_type", query.getLicenseManType());
        wrapper.eq(ObjectUtil.isNotNull(query.getLicenseWabarbeitung()), "license_wabarbeitung", query.getLicenseWabarbeitung());
        wrapper.eq(ObjectUtil.isNotNull(query.getPreConLevel()), "pre_con_level", query.getPreConLevel());
        wrapper.eq(ObjectUtil.isNotNull(query.getPollDisLicenseCode()), "poll_dis_license_code", query.getPollDisLicenseCode());
        wrapper.eq(ObjectUtil.isNotNull(query.getPollDisLicenseDeadline()), "poll_dis_license_deadline", query.getPollDisLicenseDeadline());
        wrapper.eq(ObjectUtil.isNotNull(query.getPollDisLicenseIssuing()), "poll_dis_license_issuing", query.getPollDisLicenseIssuing());
        wrapper.eq(ObjectUtil.isNotNull(query.getUscCode()), "usc_code", query.getUscCode());
        wrapper.eq(ObjectUtil.isNotNull(query.getInsFramCode()), "ins_fram_code", query.getInsFramCode());
        wrapper.eq(ObjectUtil.isNotNull(query.getAddress()), "address", query.getAddress());
        wrapper.eq(ObjectUtil.isNotNull(query.getProdBusiOperation()), "prod_busi_operation", query.getProdBusiOperation());
        wrapper.eq(ObjectUtil.isNotNull(query.getPostalCode()), "postal_code", query.getPostalCode());
        wrapper.eq(ObjectUtil.isNotNull(query.getIndustryCategory()), "industry_category", query.getIndustryCategory());
        wrapper.eq(ObjectUtil.isNotNull(query.getIndustryCategoryOther()), "industry_category_other", query.getIndustryCategoryOther());
        wrapper.eq(ObjectUtil.isNotNull(query.getWhetherProduction()), "whether_production", query.getWhetherProduction());
        wrapper.eq(ObjectUtil.isNotNull(query.getProductionDate()), "production_date", query.getProductionDate());
        wrapper.eq(ObjectUtil.isNotNull(query.getProductionLon()), "production_lon", query.getProductionLon());
        wrapper.eq(ObjectUtil.isNotNull(query.getProductionLat()), "production_lat", query.getProductionLat());
        wrapper.eq(ObjectUtil.isNotNull(query.getPrincipalMan()), "principal_man", query.getPrincipalMan());
        wrapper.eq(ObjectUtil.isNotNull(query.getTechnicalMan()), "technical_man", query.getTechnicalMan());
        wrapper.eq(ObjectUtil.isNotNull(query.getTel()), "tel", query.getTel());
        wrapper.eq(ObjectUtil.isNotNull(query.getMobileTelephone()), "mobile_telephone", query.getMobileTelephone());
        wrapper.eq(ObjectUtil.isNotNull(query.getWhetherLocalKeyAri()), "whether_local_key_ari", query.getWhetherLocalKeyAri());
        wrapper.eq(ObjectUtil.isNotNull(query.getWhetherLocalKeyPho()), "whether_local_key_pho", query.getWhetherLocalKeyPho());
        wrapper.eq(ObjectUtil.isNotNull(query.getWhetherLocalKeyNitrogen()), "whether_local_key_nitrogen", query.getWhetherLocalKeyNitrogen());
        wrapper.eq(ObjectUtil.isNotNull(query.getWhetherLocalKeyPollArea()), "whether_local_key_poll_area", query.getWhetherLocalKeyPollArea());
        wrapper.eq(ObjectUtil.isNotNull(query.getWhetherLocalPark()), "whether_local_park", query.getWhetherLocalPark());
        wrapper.eq(ObjectUtil.isNotNull(query.getWhetherReviewFile()), "whether_review_file", query.getWhetherReviewFile());
        wrapper.eq(ObjectUtil.isNotNull(query.getWhetherGovProFile()), "whether_gov_pro_file", query.getWhetherGovProFile());
        wrapper.eq(ObjectUtil.isNotNull(query.getEnvironmentalCode()), "environmental_code", query.getEnvironmentalCode());
        wrapper.eq(ObjectUtil.isNotNull(query.getGovProIdentFile()), "gov_pro_ident_file", query.getGovProIdentFile());
        wrapper.eq(ObjectUtil.isNotNull(query.getMajorPollutantsCode()), "major_pollutants_code", query.getMajorPollutantsCode());
        wrapper.eq(ObjectUtil.isNotNull(query.getMajorPollutantCategories()), "major_pollutant_categories", query.getMajorPollutantCategories());
        wrapper.eq(ObjectUtil.isNotNull(query.getAirMainPollutants()), "air_main_pollutants", query.getAirMainPollutants());
        wrapper.eq(ObjectUtil.isNotNull(query.getAirEmissionPollutants()), "air_emission_pollutants", query.getAirEmissionPollutants());
        wrapper.eq(ObjectUtil.isNotNull(query.getAirDischargePollutants()), "air_discharge_pollutants", query.getAirDischargePollutants());
        wrapper.eq(ObjectUtil.isNotNull(query.getWaterMainPollutants()), "water_main_pollutants", query.getWaterMainPollutants());
        wrapper.eq(ObjectUtil.isNotNull(query.getWaterEmissionPollutants()), "water_emission_pollutants", query.getWaterEmissionPollutants());
        wrapper.eq(ObjectUtil.isNotNull(query.getWaterDischargePollutants()), "water_discharge_pollutants", query.getWaterDischargePollutants());
        wrapper.eq(ObjectUtil.isNotNull(query.getUseTradingEmission()), "use_trading_emission", query.getUseTradingEmission());
        wrapper.eq(ObjectUtil.isNotNull(query.getSudLinksPollutionPrevention()), "sud_links_pollution_prevention", query.getSudLinksPollutionPrevention());
        wrapper.eq(ObjectUtil.isNotNull(query.getEcoEnvCreditLevel()), "eco_env_credit_level", query.getEcoEnvCreditLevel());
        return wrapper;
        }
}
