package cn.cecep.talroad.vo.query;

import cn.cecep.talroad.common.core.domain.query.PageQuery;
import cn.cecep.talroad.domain.BMainAllowablePollutionWater;
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_water
 *
 * @author szhpt
 * @date 2023-01-31*/
@ApiModel(value = "总许可量- 废水排放总许可量要求")
@EqualsAndHashCode(callSuper = false)
@Data
public class BMainAllowablePollutionWaterQuery 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 applyFrist;
    @ApiModelProperty(value = "申请年排放量限值-第二年")
    private String applySecond;
    @ApiModelProperty(value = "申请年排放量限值-第三年")
    private String applyThird;
    @ApiModelProperty(value = "申请年排放量限值-第四年")
    private String applyFourth;
    @ApiModelProperty(value = "申请年排放量限值-第五年")
    private String applyFifth;
    @ApiModelProperty(value = "申请特殊时段排放量限值")
    private String applyDischargeLimitingValue;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<BMainAllowablePollutionWater> createLambdaQueryWrapper(BMainAllowablePollutionWaterQuery query) {
        QueryWrapper<BMainAllowablePollutionWater> 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.getApplyFrist()), "apply_frist", query.getApplyFrist());
        wrapper.eq(ObjectUtil.isNotNull(query.getApplySecond()), "apply_second", query.getApplySecond());
        wrapper.eq(ObjectUtil.isNotNull(query.getApplyThird()), "apply_third", query.getApplyThird());
        wrapper.eq(ObjectUtil.isNotNull(query.getApplyFourth()), "apply_fourth", query.getApplyFourth());
        wrapper.eq(ObjectUtil.isNotNull(query.getApplyFifth()), "apply_fifth", query.getApplyFifth());
        wrapper.eq(ObjectUtil.isNotNull(query.getApplyDischargeLimitingValue()), "apply_discharge_limiting_value", query.getApplyDischargeLimitingValue());
        wrapper.orderByAsc("pollution_category", "id");
        return wrapper;
    }
}
