package cn.cecep.talroad.vo.query;

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


/**
 * 监测参数汇总(有组织)对象 bas_param
 *
 * @author szhpt
 * @date 2023-01-10*/
@ApiModel(value = "监测参数汇总(有组织)")
@EqualsAndHashCode(callSuper = false)
@Data
public class BasParamQuery extends PageQuery
{

    @ApiModelProperty(value = "参数ID 212协议编码")
    private String paramId;
    @ApiModelProperty(value = "参数ID 212协议编码（新）")
    private String paramIdNew;
    @ApiModelProperty(value = "接口中的参数名 不同参数可能有同名")
    private String paramCodeSvc;
    @ApiModelProperty(value = "名称")
    private String name;
    @ApiModelProperty(value = "参数类型")
    private String paramType;
    @ApiModelProperty(value = "Java数据类型 Double,String...")
    private String dataTypeJava;
    @ApiModelProperty(value = "所属行业 枚举。钢铁/焦化/水泥...")
    private String industry;
    @ApiModelProperty(value = "所属设备类别 枚举。焦炉/烧结机...")
    private String deviceType;
    @ApiModelProperty(value = "所属设施类别 枚举。生产/CEMS...")
    private String facilityType;
    @ApiModelProperty(value = "所属设施名称")
    private String facilityName;
    @ApiModelProperty(value = "实时值的单位")
    private String unitReal;
    @ApiModelProperty(value = "统计值的单位")
    private String unitStat;
    @ApiModelProperty(value = "小数点后保留的位数")
    private Long scale;
    @ApiModelProperty(value = "参与统计的最小值 小于此值则不参与统计(对所有值有效)")
    private String statMinValue;
    @ApiModelProperty(value = "参与统计的最大值 大于此值则不参与统计(只对实时值有效)")
    private String statMaxValue;
    @ApiModelProperty(value = "超标阈值 超过此值则认为超标")
    private String overMaxVal;
    @ApiModelProperty(value = "停产判断阈值 不同参数含义不同，可能为比例值或阈值等")
    private String stopValue;
    @ApiModelProperty(value = "停产判断阈值备注")
    private String stopValueMemo;
    @ApiModelProperty(value = "是否检查恒定值报警 0=否，1=是")
    private Long isChkSame;
    @ApiModelProperty(value = "是否检查异常值报警 0=否，1=是")
    private Long isChkAbnormal;
    @ApiModelProperty(value = "显示顺序 同一类别下的显示顺序")
    private Long showOrder;
    @ApiModelProperty(value = "创建时间")
    private String createTime;
    @ApiModelProperty(value = "状态 0=停用，1=启用")
    private Long status;
    @ApiModelProperty(value = "最小宽度(用与前端表头渲染)")
    private Long minWidth;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<BasParam> createLambdaQueryWrapper(BasParamQuery query) {
        QueryWrapper<BasParam> wrapper = new QueryWrapper<>();
        wrapper.eq(ObjectUtil.isNotNull(query.getParamId()), "param_id", query.getParamId());
        wrapper.eq(ObjectUtil.isNotNull(query.getParamIdNew()), "param_id_new", query.getParamIdNew());
        wrapper.eq(ObjectUtil.isNotNull(query.getParamCodeSvc()), "param_code_svc", query.getParamCodeSvc());
        wrapper.eq(ObjectUtil.isNotNull(query.getName()), "name", query.getName());
        wrapper.eq(ObjectUtil.isNotNull(query.getParamType()), "param_type", query.getParamType());
        wrapper.eq(ObjectUtil.isNotNull(query.getDataTypeJava()), "data_type_java", query.getDataTypeJava());
        wrapper.eq(ObjectUtil.isNotNull(query.getIndustry()), "industry", query.getIndustry());
        wrapper.eq(ObjectUtil.isNotNull(query.getDeviceType()), "device_type", query.getDeviceType());
        wrapper.eq(ObjectUtil.isNotNull(query.getFacilityType()), "facility_type", query.getFacilityType());
        wrapper.eq(ObjectUtil.isNotNull(query.getFacilityName()), "facility_name", query.getFacilityName());
        wrapper.eq(ObjectUtil.isNotNull(query.getUnitReal()), "unit_real", query.getUnitReal());
        wrapper.eq(ObjectUtil.isNotNull(query.getUnitStat()), "unit_stat", query.getUnitStat());
        wrapper.eq(ObjectUtil.isNotNull(query.getScale()), "scale", query.getScale());
        wrapper.eq(ObjectUtil.isNotNull(query.getStatMinValue()), "stat_min_value", query.getStatMinValue());
        wrapper.eq(ObjectUtil.isNotNull(query.getStatMaxValue()), "stat_max_value", query.getStatMaxValue());
        wrapper.eq(ObjectUtil.isNotNull(query.getOverMaxVal()), "over_max_val", query.getOverMaxVal());
        wrapper.eq(ObjectUtil.isNotNull(query.getStopValue()), "stop_value", query.getStopValue());
        wrapper.eq(ObjectUtil.isNotNull(query.getStopValueMemo()), "stop_value_memo", query.getStopValueMemo());
        wrapper.eq(ObjectUtil.isNotNull(query.getIsChkSame()), "is_chk_same", query.getIsChkSame());
        wrapper.eq(ObjectUtil.isNotNull(query.getIsChkAbnormal()), "is_chk_abnormal", query.getIsChkAbnormal());
        wrapper.eq(ObjectUtil.isNotNull(query.getShowOrder()), "show_order", query.getShowOrder());
        wrapper.eq(ObjectUtil.isNotNull(query.getCreateTime()), "create_time", query.getCreateTime());
        wrapper.eq(ObjectUtil.isNotNull(query.getStatus()), "status", query.getStatus());
        wrapper.eq(ObjectUtil.isNotNull(query.getMinWidth()), "min_width", query.getMinWidth());
        return wrapper;
        }
}
