package com.muyu.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.muyu.common.core.web.domain.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
 * 预警规则对象 warn_rule
 * @author muyu
 * @date 2024-09-20
 */

@EqualsAndHashCode(callSuper = true)
@Data

@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@TableName("warn_rule")
@Tag(name = "预警规则管理")
public class WarnRule extends BaseEntity{
    private static final Long serialVersionUID = 1L;

    /** 规则id */
    @TableId( type = IdType.AUTO)
    @Schema(name = "规则id")
    private Long id;

    /** 规则名称 */
    @Schema(name = "规则名称")
    private String ruleName;

    /** 策略id */
    @Schema(name = "策略id")
    private Long strategyId;

    /** 报文数据类型id */
    @Schema(name = "报文数据类型id")
    private String msgTypeId;

    /** 滑窗时间 */
    @Schema(name = "滑窗时间")
    private Long slideTime;

    /** 滑窗频率 */
    @Schema(name = "滑窗频率")
    private String slideFrequency;

    /** 数据频率名称 */
    @Schema(name = "数据频率名称")
    private String slideData;

    /** 最大值 */
    @Schema(name = "数据频率最大值")
    private Long slideMaxNum;
    /** 最小值 */
    @Schema(name = "数据频率最小值")
    private Long slideMinNum;



    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("ruleName", getRuleName())
            .append("strategyId", getStrategyId())
            .append("msgTypeId", getMsgTypeId())
            .append("slideTime", getSlideTime())
            .append("slideFrequency", getSlideFrequency())
            .append("maxValue", getSlideData())
            .append("minValue", getSlideMaxNum())
            .append("slideMinNum", getSlideMinNum())
            .toString();
    }
}
