package cn.cecep.talroad.vo.query;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.cecep.talroad.domain.BasThresholdConfig;
import cn.cecep.talroad.common.core.domain.query.PageQuery;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;


/**
 * 关联分析-阈值设置对象 bas_threshold_config
 *
 * @author szhpt
 * @date 2023-05-18*/
@ApiModel(value = "关联分析-阈值设置")
@EqualsAndHashCode(callSuper = false)
@Data
public class BasThresholdConfigQuery extends PageQuery
{

    @ApiModelProperty(value = "主键")
    private Long dataId;
    @ApiModelProperty(value = "分析任务名称")
    private String taskName;
    @ApiModelProperty(value = "参数编码")
    private String paramCode;
    @ApiModelProperty(value = "参数名称")
    private String paramName;
    @ApiModelProperty(value = "阈值频次：D:日 H：小时")
    private String frequency;
    @ApiModelProperty(value = "阈值")
    private String thresholdValue;
    @ApiModelProperty(value = "单位")
    private String unit;
    @ApiModelProperty(value = "备注")
    private String remark;
    @ApiModelProperty(value = "创建人")
    private String createBy;
    @ApiModelProperty(value = "创建时间")
    private String createTime;
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    @ApiModelProperty(value = "更新时间")
    private String updateTime;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<BasThresholdConfig> createLambdaQueryWrapper(BasThresholdConfigQuery query) {
        QueryWrapper<BasThresholdConfig> wrapper = new QueryWrapper<>();
        wrapper.eq(ObjectUtil.isNotNull(query.getDataId()), "data_id", query.getDataId());
        wrapper.eq(ObjectUtil.isNotNull(query.getTaskName()), "task_name", query.getTaskName());
        wrapper.eq(ObjectUtil.isNotNull(query.getParamCode()), "param_code", query.getParamCode());
        wrapper.eq(ObjectUtil.isNotNull(query.getParamName()), "param_name", query.getParamName());
        wrapper.eq(ObjectUtil.isNotNull(query.getFrequency()), "frequency", query.getFrequency());
        wrapper.eq(ObjectUtil.isNotNull(query.getThresholdValue()), "threshold_value", query.getThresholdValue());
        wrapper.eq(ObjectUtil.isNotNull(query.getUnit()), "unit", query.getUnit());
        wrapper.eq(ObjectUtil.isNotNull(query.getRemark()), "remark", query.getRemark());
        wrapper.eq(ObjectUtil.isNotNull(query.getCreateBy()), "create_by", query.getCreateBy());
        wrapper.eq(ObjectUtil.isNotNull(query.getCreateTime()), "create_time", query.getCreateTime());
        wrapper.eq(ObjectUtil.isNotNull(query.getUpdateBy()), "update_by", query.getUpdateBy());
        wrapper.eq(ObjectUtil.isNotNull(query.getUpdateTime()), "update_time", query.getUpdateTime());
        return wrapper;
        }
}
