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

import com.mortals.xhx.module.device.model.vo.DeviceAlarmInfoVo;
import lombok.Data;

import java.util.Date;
/**
 * 设备告警日志实体对象
 *
 * @author zxfei
 * @date 2023-07-19
 */
@Data
public class DeviceAlarmInfoEntity extends DeviceAlarmInfoVo {
    private static final long serialVersionUID = 1L;

    /**
     * 告警时间
     */
    private Date alarmTime;
    /**
     * 告警设备Id
     */
    private Long alarmDevice;
    /**
     * 告警类型,(0.离线)
     */
    private Integer alarmType;
    /**
     * 告警级别(0.危险，1.次要，2.一般)
     */
    private Integer alarmLevel;
    /**
     * 接收人员[设备管理的责任人]
     */
    private String alarmReceivePersonnel;
    /**
     * 接收人员电话
     */
    private String receivePersonnelTelephone;
    /**
     * 告警状态,来自工单系统(0.未清除，1.清除未确认，2.清除已确认)
     */
    private Integer alarmStatus;
    /**
     * 告警详细内容
     */
    private String alarmContent;
    /**
     * 站点Id，来源基础服务平台
     */
    private Long siteId;
    /**
     * 设备编码
     */
    private String deviceCode;
    /**
     * 设备名称
     */
    private String deviceName;
    /**
     * 是否推送
     */
    private Integer push;
    /**
     * 产品Id
     */
    private Long productId;
    /**
     * 产品编码
     */
    private String productCode;
    /**
     * 产品名称
     */
    private String productName;
    @Override
    public int hashCode() {
        return this.getId().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj instanceof DeviceAlarmInfoEntity) {
            DeviceAlarmInfoEntity tmp = (DeviceAlarmInfoEntity) obj;
            if (this.getId() == tmp.getId()) {
                return true;
            }
        }
        return false;
    }

    public void initAttrValue(){

        this.alarmTime = null;

        this.alarmDevice = -1L;

        this.alarmType = -1;

        this.alarmLevel = -1;

        this.alarmReceivePersonnel = "";

        this.receivePersonnelTelephone = "";

        this.alarmStatus = 0;

        this.alarmContent = "";

        this.siteId = -1L;

        this.deviceCode = "";

        this.deviceName = "";

        this.push = 0;

        this.productId = -1L;

        this.productCode = "";

        this.productName = "";
    }
}