package com.zksy.base.alarm.domain;

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.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@TableName(value ="alarm_data")
@Data
public class AlarmData implements Serializable {
    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    @ApiModelProperty(value = "主键")
    private String id;

    @TableField(value = "device_code")
    @ApiModelProperty(value = "设备编码")
    private String deviceCode;

    @TableField(value = "device_name")
    @ApiModelProperty(value = "设备名称")
    private String deviceName;

    @TableField(value = "device_type")
    @ApiModelProperty(value = "设备类型")
    private String deviceType;

    @TableField(value = "warning_type")
    @ApiModelProperty(value = "预警类型")
    private String warningType;

    @TableField(value = "warning_code")
    @ApiModelProperty(value = "预警编码")
    private String warningCode;

    @TableField(value = "min_value")
    @ApiModelProperty(value = "预警最小值，小于等于该值视为报警")
    private BigDecimal minValue;

    @TableField(value = "max_value")
    @ApiModelProperty(value = "预警最大值，大于等于该值视为报警")
    private BigDecimal maxValue;

    @TableField(value = "actual_value")
    @ApiModelProperty(value = "实际值")
    private BigDecimal actualValue;

    @TableField(value = "alarm_level")
    @ApiModelProperty(value = "告警等级 1-4，1级最高")
    private Integer alarmLevel;

    @TableField(value = "deviation_ratio")
    @ApiModelProperty(value = "偏差率（百分比）")
    private BigDecimal deviationRatio;

    @TableField(value = "alarm_status")
    @ApiModelProperty(value = "报警状态 0-未处理 1-已处理")
    private Integer alarmStatus;

    @TableField(value = "alarm_time")
    @ApiModelProperty(value = "报警时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime alarmTime;

    @TableField(value = "handle_time")
    @ApiModelProperty(value = "处理时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime handleTime;

    @TableField(value = "handle_user")
    @ApiModelProperty(value = "处理人")
    private String handleUser;

    @TableField(value = "handle_remark")
    @ApiModelProperty(value = "处理备注")
    private String handleRemark;

    @TableField(value = "remark")
    @ApiModelProperty(value = "备注")
    private String remark;

    @TableField(value = "create_time")
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    @TableField(value = "update_time")
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;

    @TableField(exist = false)
    @ApiModelProperty(value = "经度")
    private String longitude;

    @TableField(exist = false)
    @ApiModelProperty(value = "纬度")
    private String latitude;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
