package com.gyee.wisdom.alarm.sharding.entity;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gyee.wisdom.alarm.sharding.cache.StationCache;
import com.gyee.wisdom.alarm.sharding.util.ChineseDes;

import lombok.AccessLevel;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;


@Data
@TableName("SCADABJ")
public class Scadabj implements Serializable {

    private static final long serialVersionUID = -7009408032434108640L;

    @TableId("ID")
    private Long id;
    @ChineseDes("测点")
    @TableField("POINTKEY")
    private String pointKey;
    @ChineseDes("描述")
    @TableField("DESCRIPTION")
    private String description;
    @TableField("CATEGORY1")
    private String category1;
    @TableField("CATEGORY2")
    private String category2;
    @TableField("CATEGORY3")
    private String category3;
    @TableField("CATEGORY4")
    private String category4;
    @ChineseDes("场站")
    @TableField("STATIONID")
    private String stationId;
    @TableField("DEVICEID")
    private String deviceId;
    @ChineseDes("报警级别")
    @TableField("RANK")
    private String rank;
    @ChineseDes("是否启用")
    @TableField("ENABLED")
    private int enabled=-1;
    @TableField("ALARMTYPE")
    @ChineseDes("报警逻辑")
    private int alarmType = -1;
    @TableField(exist = false)
    public String userName;//操作人
    @Getter(AccessLevel.NONE)
    @Setter(AccessLevel.NONE)
    @TableField(exist = false)
    public String stationName;

    public String getStationName(){
        String name = StationCache.getStationName(this.stationId);
        return name;
    }

}
