package com.sptg.iot.api.entity;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author zwx
 * @create 2020/11/13 10:33
 */
@Setter
@Getter
@TableName(value = "iot_smoke_device")
public class IotSmokeDevice {

    /**
     * 主键
     */
    @TableId(value = "l_id", type = IdType.AUTO)
    private Long id;

    /**
     * 主键
     */
    @TableField(value = "s_device_id")
    private String device_id;

    /**
     * 烟雾监测状态 0,烟雾报警;1,烟雾报警 解除
     * 例：smoke_state1
     */
    @TableField(value = "s_smoke_state")
    private String smoke_state;

    /**
     * 烟雾浓度 百分比/%
     */
    @TableField(value = "s_smoke_value")
    private String smoke_value;

    /**
     * 防拆报警 0,设备装上;1,拆除报警
     */
    @TableField(value = "s_tamper_alarm")
    private String tamper_alarm;

    /**
     * 故障告警 1,烟感故障;2,烟感故障解 除;3,低压故障;4,低压故障解除
     */
    @TableField(value = "s_error")
    private String error;

    /**
     * 消音
     */
    @TableField(value = "s_muffling")
    private String muffling;

    /**
     * 消音响应
     */
    @TableField(value = "s_muffling_resp")
    private String muffling_resp;

    /**
     * 最新同步更新时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @TableField(value = "t_last_heartbeat_date")
    private Date lastHeartbeatDate;
}
