package cn.cecep.talroad.vo.query;

import cn.cecep.talroad.common.core.domain.query.PageQuery;
import cn.cecep.talroad.domain.BMainPollDisGasSout;
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 javax.validation.constraints.NotBlank;


/**
 * 排污许可大气特殊情况对象 b_main_poll_dis_gas_sout
 *
 * @author szhpt
 * @date 2023-01-18*/
@ApiModel(value = "排污许可大气特殊情况")
@EqualsAndHashCode(callSuper = false)
@Data
public class BMainPollDisGasSoutQuery extends PageQuery
{

    @ApiModelProperty(value = "主键id")
    private Long soutId;
    @ApiModelProperty(value = "企业id")
    private String factoryId;
    @ApiModelProperty(value = "排污许可表id")
    private String pollDisId;
    @ApiModelProperty(value = "污染物类型(0-主要排放口,1-一般排放口,2-无组织排放口,3-全厂合计)")
    private String pollutantType;
    @ApiModelProperty(value = "污染物种类")
    private String pollutantsType;
    @ApiModelProperty(value = "许可排放时段")
    private String pollutantsTimeFrame;
    @ApiModelProperty(value = "许可排放浓度限值")
    private String pollutantsConcentration;
    @ApiModelProperty(value = "许可日排放量限值")
    private String pollutantsDisDay;
    @ApiModelProperty(value = "许可月排放量限值")
    private String pollutantsDisMonth;
    @ApiModelProperty(value = "要求(1-环境质量限期达标规划要求, 2-重污染天气应对要求)")
    @NotBlank(message = "请指定[1-环境质量限期达标规划要求, 2-重污染天气应对要求]")
    private String ask;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<BMainPollDisGasSout> createLambdaQueryWrapper(BMainPollDisGasSoutQuery query) {
        QueryWrapper<BMainPollDisGasSout> wrapper = new QueryWrapper<>();
        wrapper.eq(ObjectUtil.isNotNull(query.getSoutId()), "sout_id", query.getSoutId());
        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.getPollutantType()), "pollutant_type", query.getPollutantType());
        wrapper.eq(ObjectUtil.isNotNull(query.getPollutantsType()), "pollutants_type", query.getPollutantsType());
        wrapper.eq(ObjectUtil.isNotNull(query.getPollutantsTimeFrame()), "pollutants_time_frame", query.getPollutantsTimeFrame());
        wrapper.eq(ObjectUtil.isNotNull(query.getPollutantsConcentration()), "pollutants_concentration", query.getPollutantsConcentration());
        wrapper.eq(ObjectUtil.isNotNull(query.getPollutantsDisDay()), "pollutants_dis_day", query.getPollutantsDisDay());
        wrapper.eq(ObjectUtil.isNotNull(query.getPollutantsDisMonth()), "pollutants_dis_month", query.getPollutantsDisMonth());
        wrapper.eq(ObjectUtil.isNotNull(query.getAsk()), "ask", query.getAsk());
        wrapper.orderByAsc("pollutant_type");
        return wrapper;
        }
}
