package com.mortals.xhx.module.device.model;

import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.device.model.vo.DeviceAlarmVo;
/**
* 设备告警日志实体对象
*
* @author zxfei
* @date 2022-08-04
*/

public class DeviceAlarmEntity extends DeviceAlarmVo {
    private static final long serialVersionUID = 1L;

    /**
    * 告警设备Id
    */
    private Long deviceId;
    /**
    * 告警设备编码
    */
    private String deviceCode;
    /**
    * 告警类型,(0.离线)
    */
    private Integer alarmType;
    /**
    * 告警级别(0.危险，1.次要，2.一般)
    */
    private Integer alarmLevel;
    /**
    * 告警详细内容
    */
    private String alarmContent;
    /**
    * 告警时间
    */
    @Excel(name = "告警时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date alarmTime;



    public DeviceAlarmEntity(){}
    /**
    * 获取 告警设备Id
    * @return Long
    */
    public Long getDeviceId(){
        return deviceId;
    }
    /**
    * 设置 告警设备Id
    * @param deviceId
    */
    public void setDeviceId(Long deviceId){
        this.deviceId = deviceId;
    }
    /**
    * 获取 告警设备编码
    * @return String
    */
    public String getDeviceCode(){
        return deviceCode;
    }
    /**
    * 设置 告警设备编码
    * @param deviceCode
    */
    public void setDeviceCode(String deviceCode){
        this.deviceCode = deviceCode;
    }
    /**
    * 获取 告警类型,(0.离线)
    * @return Integer
    */
    public Integer getAlarmType(){
        return alarmType;
    }
    /**
    * 设置 告警类型,(0.离线)
    * @param alarmType
    */
    public void setAlarmType(Integer alarmType){
        this.alarmType = alarmType;
    }
    /**
    * 获取 告警级别(0.危险，1.次要，2.一般)
    * @return Integer
    */
    public Integer getAlarmLevel(){
        return alarmLevel;
    }
    /**
    * 设置 告警级别(0.危险，1.次要，2.一般)
    * @param alarmLevel
    */
    public void setAlarmLevel(Integer alarmLevel){
        this.alarmLevel = alarmLevel;
    }
    /**
    * 获取 告警详细内容
    * @return String
    */
    public String getAlarmContent(){
        return alarmContent;
    }
    /**
    * 设置 告警详细内容
    * @param alarmContent
    */
    public void setAlarmContent(String alarmContent){
        this.alarmContent = alarmContent;
    }
    /**
    * 获取 告警时间
    * @return Date
    */
    public Date getAlarmTime(){
        return alarmTime;
    }
    /**
    * 设置 告警时间
    * @param alarmTime
    */
    public void setAlarmTime(Date alarmTime){
        this.alarmTime = alarmTime;
    }




    @Override
    public int hashCode() {
         return this.getId().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj instanceof DeviceAlarmEntity) {
            DeviceAlarmEntity tmp = (DeviceAlarmEntity) obj;
            if (this.getId() == tmp.getId()) {
                 return true;
            }
        }
        return false;
    }

    public String toString(){
        StringBuilder sb = new StringBuilder("");
        sb.append(",deviceId:").append(getDeviceId());
        sb.append(",deviceCode:").append(getDeviceCode());
        sb.append(",alarmType:").append(getAlarmType());
        sb.append(",alarmLevel:").append(getAlarmLevel());
        sb.append(",alarmContent:").append(getAlarmContent());
        sb.append(",alarmTime:").append(getAlarmTime());
        return sb.toString();
    }

    public void initAttrValue(){

            this.deviceId = null;

            this.deviceCode = "";

            this.alarmType = null;

            this.alarmLevel = null;

            this.alarmContent = "";

            this.alarmTime = null;
    }
}