package cn.com.ctop.alarm.modules.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

/**
 * 预警事件规则表
 *
 * @author jeecg-boot
 * @version V1.0
 * @date 2020-10-29
 */
@Data
@TableName("ctop_alarm_event_rule")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "ctop_alarm_event_rule对象", description = "预警事件规则表")
public class AlarmEventRule {
    /**
     * 规则id
     */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "规则id")
    private Long eventRuleId;
    /**
     * 账户编号
     */
    @Excel(name = "账户编号", width = 15)
    @ApiModelProperty(value = "账户编号")
    private Long accountId;

    private Long campaignId;

    /**
     * 规则名称
     */
    @Excel(name = "规则名称", width = 15)
    @ApiModelProperty(value = "规则名称")
    private String eventRuleName;
    /**
     * 预警事件规则级别 1-普通预警 2-严重预警
     */
    @Excel(name = "预警事件规则级别 1-普通预警 2-严重预警", width = 15)
    @ApiModelProperty(value = "预警事件规则级别 1-普通预警 2-严重预警")
    private String eventRuleLevel;
    /**
     * 检查频率 1每小时，2每半小时
     */
    @Excel(name = "检查频率 1每小时，2每半小时", width = 15)
    @ApiModelProperty(value = "检查频率 1每小时，2每半小时")
    private String checkFrequency;
    /**
     * 预警达标处理方式1发送，2关停并发送
     */
    @Excel(name = "预警达标处理方式1发送，2关停并发送", width = 15)
    @ApiModelProperty(value = "预警达标处理方式1发送，2关停并发送")
    private String processMethod;
    /**
     * 规则状态
     */
    @Excel(name = "规则状态", width = 15)
    @ApiModelProperty(value = "规则状态")
    private String eventRuleStatus;

    private String appStatus;

    private String createrId;

    private String metricValueCode;

    private String metricValueName;
    /**
     * createTime
     */
    @Excel(name = "createTime", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "createTime")
    private Date createTime;
    /**
     * updateTime
     */
    @Excel(name = "updateTime", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "updateTime")
    private Date updateTime;

    @TableField(exist = false)
    private String createrName;

    @TableField(exist = false)
    private String userId;

    @TableField(exist = false)
    private String accountName;

    @TableField(exist = false)
    private String UserName;

    @TableField(exist = false)
    private Date runningTime;

    @TableField(exist = false)
    private String alarmCondition;

    @TableField(exist = false)
    private String campaignName;

    @TableField(exist = false)
    private Long unitId;

    @TableField(exist = false)
    private String unitName;

    @TableField(exist = false)
    private List<AlarmRuleCampaignRel> rel;

    @TableField(exist = false)
    private List<AlarmEventMetric> alarmEventMetrics;

}
