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.PcPollutant;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;


/**
 * 污染物对象 pc_pollutant
 *
 * @author szhpt
 * @date 2023-01-10*/
@ApiModel(value = "污染物")
@EqualsAndHashCode(callSuper = false)
@Data
public class PcPollutantQuery extends PageQuery
{

    @ApiModelProperty(value = "主键id")
    private String id;
    @ApiModelProperty(value = "污染物类别")
    private String pollCategory;
    @ApiModelProperty(value = "污染物名称")
    private String pollName;
    @ApiModelProperty(value = "污染物编码")
    private String pollCode;
    @ApiModelProperty(value = "污染物单位")
    private String pollUnit;
    @ApiModelProperty(value = "排放规律")
    private String emissionsLaws;
    @ApiModelProperty(value = "执行标准")
    private String executiveStandard;

    @ApiModelProperty(value = "是否大气管控监管污染物")
    private String gasType;

    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<PcPollutant> createLambdaQueryWrapper(PcPollutantQuery query) {
        QueryWrapper<PcPollutant> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotEmpty(query.getId()), "id", query.getId());
        wrapper.eq(StringUtils.isNotEmpty(query.getPollCategory()), "poll_category", query.getPollCategory());
        wrapper.eq(StringUtils.isNotEmpty(query.getPollName()), "poll_name", query.getPollName());
        wrapper.eq(StringUtils.isNotEmpty(query.getPollCode()), "poll_code", query.getPollCode());
        wrapper.eq(StringUtils.isNotEmpty(query.getPollUnit()), "poll_unit", query.getPollUnit());
        wrapper.eq(StringUtils.isNotEmpty(query.getEmissionsLaws()), "emissions_laws", query.getEmissionsLaws());
        wrapper.eq(StringUtils.isNotEmpty(query.getExecutiveStandard()), "executive_standard", query.getExecutiveStandard());
        wrapper.eq(StringUtils.isNotEmpty(query.getGasType()), "is_gas_type", query.getGasType());
        wrapper.orderByAsc("id");
        return wrapper;
    }
}
