package cn.cecep.talroad.vo.query.analysis;

import cn.cecep.talroad.common.core.domain.query.PageQuery;
import cn.cecep.talroad.common.core.utils.StringUtils;
import cn.cecep.talroad.domain.analysis.SRaOnlineEmissionsGas;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;


/**
 * 在线监测排放监控-气污染要素对象 s_ra_online_emissions_gas
 *
 * @author szhpt
 * @date 2023-03-24
 */
@ApiModel(value = "在线监测排放监控-气污染要素")
@EqualsAndHashCode(callSuper = false)
@Data
public class SRaOnlineEmissionsGasQuery extends PageQuery {

    @ApiModelProperty(value = "主键")
    private String id;
    @ApiModelProperty(value = "企业id")
    private String factoryId;
    @ApiModelProperty(value = "监测点位名称")
    private String pointName;
    @ApiModelProperty(value = "排口编号")
    private String outletCode;
    @ApiModelProperty(value = "排口类型")
    private String outletType;
    @ApiModelProperty(value = "污染物种类")
    private String pollutantName;
    @ApiModelProperty(value = "监测时间")
    private String monitorTime;
    @ApiModelProperty(value = "是否有效")
    private String isValid;
    @ApiModelProperty(value = "修约说明")
    private String xyDesc;

    public static QueryWrapper<SRaOnlineEmissionsGas> createLambdaQueryWrapper(SRaOnlineEmissionsGasQuery query) {
        QueryWrapper<SRaOnlineEmissionsGas> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotNull(query.getId()), "id", query.getId());
        wrapper.eq(StringUtils.isNotNull(query.getFactoryId()), "factory_id", query.getFactoryId());
        wrapper.eq(StringUtils.isNotNull(query.getPointName()), "point_name", query.getPointName());
        wrapper.eq(StringUtils.isNotNull(query.getOutletCode()), "outlet_code", query.getOutletCode());
        wrapper.eq(StringUtils.isNotNull(query.getOutletType()), "outlet_type", query.getOutletType());
        wrapper.eq(StringUtils.isNotNull(query.getPollutantName()), "pollutant_name", query.getPollutantName());
        wrapper.eq(StringUtils.isNotNull(query.getMonitorTime()), "monitor_time", query.getMonitorTime());
        wrapper.eq(StringUtils.isNotNull(query.getIsValid()), "is_valid", query.getIsValid());
        wrapper.eq(StringUtils.isNotNull(query.getXyDesc()), "xy_desc", query.getXyDesc());
        return wrapper;
    }

    @Data
    @ApiModel("图表查询条件vo")
    public static class CharDataSearchVo {
        private String factoryId; // 企业id
        private String startTime; // 开始时间
        private String endTime; // 结束时间
        private String pollutantCode; // 污染物编码
        private String allowableValue; // 限值

        public CharDataSearchVo(String factoryId, String startTime, String endTime, String pollutantCode, String allowableValue) {
            this.factoryId = factoryId;
            this.startTime = startTime;
            this.endTime = endTime;
            this.pollutantCode = pollutantCode;
            this.allowableValue = allowableValue;
        }
    }

}
