package cn.cecep.talroad.vo.query;

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


/**
 * 污染排放跟踪(实际排放/许可排放)对象 pc_factory_pollutant_emissions_rank
 *
 * @author szhpt
 * @date 2023-02-10*/
@ApiModel(value = "污染排放跟踪(实际排放/许可排放)")
@EqualsAndHashCode(callSuper = false)
@Data
public class PcFactoryPollutantEmissionsRankQuery extends PageQuery
{

    @ApiModelProperty(value = "主键ID")
    private String id;
    @ApiModelProperty(value = "企业id")
    private String factoryId;
    @ApiModelProperty(value = "污染物类别")
    private String pollCategory;
    @ApiModelProperty(value = "污染物名称")
    private String pollName;
    @ApiModelProperty(value = "排放量排名")
    private String emissionsRank;
    @ApiModelProperty(value = "实际排放量")
    private String emissionsActual;
    @ApiModelProperty(value = "许可排放量")
    private String emissionsPermit;
    @ApiModelProperty(value = "占比")
    private String emissionsRatio;
    @ApiModelProperty(value = "0-系统, 1-执行报告")
    private String dataSource;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<PcFactoryPollutantEmissionsRank> createLambdaQueryWrapper(PcFactoryPollutantEmissionsRankQuery query) {
        QueryWrapper<PcFactoryPollutantEmissionsRank> 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.getPollCategory()), "poll_category", query.getPollCategory());
        wrapper.eq(ObjectUtil.isNotNull(query.getPollName()), "poll_name", query.getPollName());
        wrapper.eq(ObjectUtil.isNotNull(query.getEmissionsRank()), "emissions_rank", query.getEmissionsRank());
        wrapper.eq(ObjectUtil.isNotNull(query.getEmissionsActual()), "emissions_actual", query.getEmissionsActual());
        wrapper.eq(ObjectUtil.isNotNull(query.getEmissionsPermit()), "emissions_permit", query.getEmissionsPermit());
        wrapper.eq(ObjectUtil.isNotNull(query.getEmissionsRatio()), "emissions_ratio", query.getEmissionsRatio());
        wrapper.eq(ObjectUtil.isNotNull(query.getDataSource()), "data_source", query.getDataSource());
        wrapper.orderByDesc("emissions_rank");
        return wrapper;
        }
}
