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.SEnvWaterMonReal;
import cn.cecep.talroad.vo.AmProblemFiVo;
import cn.hutool.core.util.ArrayUtil;
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 java.util.List;


/**
 * 废水监测数据对象 s_env_water_mon_real
 *
 * @author szhpt
 * @date 2023-04-06*/
@ApiModel(value = "废水监测数据")
@EqualsAndHashCode(callSuper = false)
@Data
public class SEnvWaterMonRealQuery extends PageQuery
{

    @ApiModelProperty(value = "主键id")
    private String id;
    @ApiModelProperty(value = "企业id")
    private String factoryId;
    @ApiModelProperty(value = "排口id")
    private String outletId;
    @ApiModelProperty(value = "数据类型（日：d；小时：h；分钟：m）")
    private String dataType;

    @ApiModelProperty(value = "开始日期")
    private String monitoringStartTime;
    @ApiModelProperty(value = "结束日期")
    private String monitoringEndTime;

    @ApiModelProperty(value = "污水")
    private String sewage;
    @ApiModelProperty(value = "污水排放量")
    private String sewageEmission;
    @ApiModelProperty(value = "化学需氧量")
    private String cod;
    @ApiModelProperty(value = "cod浓度")
    private String codConcentration;
    @ApiModelProperty(value = "化学需氧量排放量")
    private String codEmission;
    @ApiModelProperty(value = "氨氮")
    private String ammoniaNitrogen;
    @ApiModelProperty(value = "氨氮排放量")
    private String ammoniaNitrogenEmission;
    @ApiModelProperty(value = "总氮浓度")
    private String nitrogenConcentration;
    @ApiModelProperty(value = "总氮排放量")
    private String nitrogenConcentrationEmission;
    @ApiModelProperty(value = "总磷浓度")
    private String phosphorusConcentration;
    @ApiModelProperty(value = "总磷排放量")
    private String phosphorusConcentrationEmission;
    @ApiModelProperty(value = "ph值")
    private String phValue;
    @ApiModelProperty(value = "废水流量")
    private String wastewaterFlow;

    @ApiModelProperty(value = "标记")
    private String mark;
    @ApiModelProperty(value = "排口id数组")
    private String[] outletIdArr;
    @ApiModelProperty(value = "检测点位名称")
    private String monitoringPointName;

    @ApiModelProperty(value = "曲线图返回指定的污染物")
    private List<AmProblemFiVo.PollutantVo> pollutantVos;

    public SEnvWaterMonRealQuery() {
    }

    public SEnvWaterMonRealQuery(String factoryId, String dataType, String monitoringStartTime, String monitoringEndTime) {
        this.factoryId = factoryId;
        this.dataType = dataType;
        this.monitoringStartTime = monitoringStartTime;
        this.monitoringEndTime = monitoringEndTime;
    }

    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<SEnvWaterMonReal> createLambdaQueryWrapper(SEnvWaterMonRealQuery query) {
        QueryWrapper<SEnvWaterMonReal> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotEmpty(query.getId()), "id", query.getId());
        wrapper.eq(StringUtils.isNotEmpty(query.getFactoryId()), "factory_id", query.getFactoryId());
        wrapper.eq(StringUtils.isNotEmpty(query.getOutletId()), "outlet_id", query.getOutletId());
        wrapper.eq(StringUtils.isNotEmpty(query.getDataType()), "data_type", query.getDataType());
        wrapper.ge(StringUtils.isNotEmpty(query.getMonitoringStartTime()) && StringUtils.isNotEmpty(query.getMonitoringEndTime()), "monitoring_time", query.getMonitoringStartTime());
        wrapper.le(StringUtils.isNotEmpty(query.getMonitoringStartTime()) && StringUtils.isNotEmpty(query.getMonitoringEndTime()), "monitoring_time", query.getMonitoringEndTime());
        wrapper.in(ArrayUtil.isNotEmpty(query.getOutletIdArr()), "outlet_id", query.getOutletIdArr());
        wrapper.isNotNull("monitoring_time");
        return wrapper;
    }
}
