package com.zy.omp.model; import java.io.Serializable; import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; /** *

* 设备-路牌 *

* * @author chenyi * @since 2021-06-12 */ @Data @TableName("device_lp") public class DeviceLp implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Integer id; /** * 设备IMEI */ private String num; /** * 登录MQTT 用户名 */ private String clientId; /** * 登录MQTT 密码 */ private String password; /** * 设备组 */ @TableField("`group`") private String group; /** * SN码 */ private String sn; /** * 定时唤醒时间 */ private Double wakeInt; /** * 阈值 */ private Integer thresh; /** * 电量 */ private String battery; /** * 信号 */ private String s4g; private String x; private String y; private String z; private String anglex; private String angley; private String anglez; /** * 温度 */ private String temp; /** * 经度 */ private String lon; /** * 纬度 */ private String lat; /** * 经度(gcj) */ private String lonGcj; /** * 纬度(gcj) */ private String latGcj; /** * 格式化的地理位置 */ private String site; /** * 定位模式 1:GPS 2:基站 */ private Integer mode; /** * 上传类型 */ private String dataType; /** * 数据更新时间 */ private LocalDateTime updateTime; /** * 获取在线状态 */ public Integer getStatus() { if (updateTime == null || wakeInt == null) return 0; return updateTime.compareTo(LocalDateTime.now().minusMinutes((int) (wakeInt * 60) + 5)); } }