package com.lutao.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.lutao.annotate.Validation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

@ApiModel(value = "参数报警闭环管理")
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@TableName("tag_alarm_clm")
public class TagAlarmClm extends Model<TagAlarmClm> {
    private static final long serialVersionUID = -421067413562732163L;

    @ApiModelProperty(value = "id")
    @TableId
    private Integer id;

    @ApiModelProperty(value = "原始id")
    @Validation(message = "tag_alarm_clm表{id}不能为空")
    private String originId;

    @ApiModelProperty(value = "app_id")
    private String appId;

    @ApiModelProperty(value = "平台编码")
    @Validation(message = "tag_alarm_clm表{platform_code}不能为空")
    private String platformCode;

    @ApiModelProperty(value = "设施名称")
    private String facilityName;

    @ApiModelProperty(value = "设施编码")
    private String facilityCode;

    @ApiModelProperty(value = "设备名称")
    private String equipName;

    @ApiModelProperty(value = "设备编码")
    private String equipCode;

    @ApiModelProperty(value = "参数id")
    @Validation(message = "tag_alarm_clm表{tag_id}不能为空")
    private String tagId;

    @ApiModelProperty(value = "参数编码")
    @Validation(message = "tag_alarm_clm表{tag_code}不能为空")
    private String tagCode;

    @ApiModelProperty(value = "参数名称")
    @Validation(message = "tag_alarm_clm表{tag_name}不能为空")
    private String tagName;

    @ApiModelProperty(value = "参数类型:1 流量\n" +
            "2 温度\n" +
            "3 压力\n" +
            "4 电流\n" +
            "5 液位\n" +
            "6火灾\n" +
            "7 可燃气体\n" +
            "8 有毒有害气体\n")
    @Validation(message = "tag_alarm_clm表{tag_type}不能为空")
    private String tagType;

    @ApiModelProperty(value = "状态:00 已消警\n" +
            "01 已报警\n")
    @Validation(message = "tag_alarm_clm表{status}不能为空")
    private String state;

    @ApiModelProperty(value = "报警时间")
    @Validation(message = "tag_alarm_clm表{alarm_timestamp}不能为空")
    private LocalDateTime alarmTimestamp;

    @ApiModelProperty(value = "报警值")
    @Validation(message = "tag_alarm_clm表{alarm_value}不能为空")
    private String alarmValue;

    @ApiModelProperty(value = "最后更新时间")
    @Validation(message = "tag_alarm_clm表{last_update_time}不能为空")
    private LocalDateTime lastUpdateTime;


    @ApiModelProperty(value = "报警类型:0 报警\n" +
            "1 高报\n" +
            "2 高高报\n" +
            "3 低报\n" +
            "4 低低报\n")
    @Validation(message = "tag_alarm_clm表{alarm_type}不能为空")
    private String alarmType;

    @ApiModelProperty(value = "报警时长")
    @Validation(message = "tag_alarm_clm表{alarm_duration}不能为空")
    private String alarmDuration;

    @ApiModelProperty(value = "处理人姓名")
    private String handleBy;

    @ApiModelProperty(value = "处理状态0 未处理\n" +
            "1 已处理\n")
    @Validation(message = "tag_alarm_clm表{handle_state}不能为空")
    private String handleState;

    @ApiModelProperty(value = "创建日期")
    private LocalDateTime createDate;

    @ApiModelProperty(value = "创建人")
    private String createBy;

    @ApiModelProperty(value = "更新日期")
    private LocalDateTime updateDate;

    @ApiModelProperty(value = "更新人")
    private String updateBy;


    @ApiModelProperty(value = "数据收集时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "数据更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}
