package cn.cecep.talroad.vo.query;

import cn.cecep.talroad.common.core.domain.query.PageQuery;
import cn.cecep.talroad.domain.BMainAllowablePollutionAir;
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;


/**
 * 总许可量-大气排放总许可量要求对象 b_main_allowable_pollution_air
 *
 * @author szhpt
 * @date 2023-01-31*/
@ApiModel(value = "总许可量-大气排放总许可量要求")
@EqualsAndHashCode(callSuper = false)
@Data
public class BMainAllowablePollutionAirQuery extends PageQuery
{

    @ApiModelProperty(value = "主键id")
    private String id;
    @ApiModelProperty(value = "企业id")
    private String factoryId;
    @ApiModelProperty(value = "许可证id")
    private String pollDisId;
    @ApiModelProperty(value = "污染物类别")
    private String pollutionCategory;
    @ApiModelProperty(value = "全厂有组织排放总计-第一年")
    private String organizedFrist;
    @ApiModelProperty(value = "全厂有组织排放总计-第二年")
    private String organizedSecond;
    @ApiModelProperty(value = "全厂有组织排放总计-第三年")
    private String organizedThird;
    @ApiModelProperty(value = "全厂有组织排放总计-第四年")
    private String organizedFourth;
    @ApiModelProperty(value = "全厂有组织排放总计-第五年")
    private String organizedFifth;
    @ApiModelProperty(value = "全厂无组织排放总计-第一年")
    private String inorganizationFrist;
    @ApiModelProperty(value = "全厂无组织排放总计-第二年")
    private String inorganizationSecond;
    @ApiModelProperty(value = "全厂无组织排放总计-第三年")
    private String inorganizationThird;
    @ApiModelProperty(value = "全厂无组织排放总计-第四年")
    private String inorganizationFourth;
    @ApiModelProperty(value = "全厂无组织排放总计-第五年")
    private String inorganizationFifth;
    @ApiModelProperty(value = "全厂合计-第一年")
    private String totalFrist;
    @ApiModelProperty(value = "全厂合计-第二年")
    private String totalSecond;
    @ApiModelProperty(value = "全厂合计-第三年")
    private String totalThird;
    @ApiModelProperty(value = "全厂合计-第四年")
    private String totalFourth;
    @ApiModelProperty(value = "全厂合计-第五年")
    private String totalFifth;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<BMainAllowablePollutionAir> createLambdaQueryWrapper(BMainAllowablePollutionAirQuery query) {
        QueryWrapper<BMainAllowablePollutionAir> wrapper = new QueryWrapper<>();
        wrapper.eq(ObjectUtil.isNotNull(query.getId()), "id", query.getId());
        wrapper.eq(ObjectUtil.isNotNull(query.getFactoryId()), "factory_id", query.getFactoryId());
        wrapper.eq(ObjectUtil.isNotNull(query.getPollDisId()), "poll_dis_id", query.getPollDisId());
        wrapper.eq(ObjectUtil.isNotNull(query.getPollutionCategory()), "pollution_category", query.getPollutionCategory());
        wrapper.eq(ObjectUtil.isNotNull(query.getOrganizedFrist()), "organized_frist", query.getOrganizedFrist());
        wrapper.eq(ObjectUtil.isNotNull(query.getOrganizedSecond()), "organized_second", query.getOrganizedSecond());
        wrapper.eq(ObjectUtil.isNotNull(query.getOrganizedThird()), "organized_third", query.getOrganizedThird());
        wrapper.eq(ObjectUtil.isNotNull(query.getOrganizedFourth()), "organized_fourth", query.getOrganizedFourth());
        wrapper.eq(ObjectUtil.isNotNull(query.getOrganizedFifth()), "organized_fifth", query.getOrganizedFifth());
        wrapper.eq(ObjectUtil.isNotNull(query.getInorganizationFrist()), "inorganization_frist", query.getInorganizationFrist());
        wrapper.eq(ObjectUtil.isNotNull(query.getInorganizationSecond()), "inorganization_second", query.getInorganizationSecond());
        wrapper.eq(ObjectUtil.isNotNull(query.getInorganizationThird()), "inorganization_third", query.getInorganizationThird());
        wrapper.eq(ObjectUtil.isNotNull(query.getInorganizationFourth()), "inorganization_fourth", query.getInorganizationFourth());
        wrapper.eq(ObjectUtil.isNotNull(query.getInorganizationFifth()), "inorganization_fifth", query.getInorganizationFifth());
        wrapper.eq(ObjectUtil.isNotNull(query.getTotalFrist()), "total_frist", query.getTotalFrist());
        wrapper.eq(ObjectUtil.isNotNull(query.getTotalSecond()), "total_second", query.getTotalSecond());
        wrapper.eq(ObjectUtil.isNotNull(query.getTotalThird()), "total_third", query.getTotalThird());
        wrapper.eq(ObjectUtil.isNotNull(query.getTotalFourth()), "total_fourth", query.getTotalFourth());
        wrapper.eq(ObjectUtil.isNotNull(query.getTotalFifth()), "total_fifth", query.getTotalFifth());

        wrapper.orderByAsc("pollution_category", "id");
        return wrapper;
    }
}
