package com.kym.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * 设备故障记录表
 *
 * @author skyline
 */
@Getter
@Setter
@TableName("t_fault_record")
@Accessors(chain = true)
public class FaultRecord extends BaseEntity<FaultRecord> {

    private static final long serialVersionUID = 1L;

    public static final int IS_NOTIFIED_未通知 = 0;
    public static final int IS_NOTIFIED_已通知 = 1;

    public static final int IS_RECOVERED_未恢复 = 0;
    public static final int IS_RECOVERED_已恢复 = 1;

    /**
     * 站点ID
     */
    private String stationId;

    /**
     * 设备名称
     */
    private String deviceName;

    /**
     * 故障类型：offline / water_shortage / foam_shortage
     */
    private String faultType;

    /**
     * 故障发生时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime faultTime;

    /**
     * 故障原因
     */
    private String faultReason;

    /**
     * 是否已通知：0-未通知，1-已通知
     */
    private Integer isNotified;

    /**
     * 通知发送时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime notifyTime;

    /**
     * 是否已恢复：0-未恢复，1-已恢复
     */
    private Integer isRecovered;

    /**
     * 恢复时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime recoverTime;
}
