DeviceLp.java 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. package com.zy.omp.model;
  2. import java.io.Serializable;
  3. import java.time.LocalDateTime;
  4. import com.baomidou.mybatisplus.annotation.TableField;
  5. import com.baomidou.mybatisplus.annotation.TableName;
  6. import lombok.Data;
  7. import com.baomidou.mybatisplus.annotation.IdType;
  8. import com.baomidou.mybatisplus.annotation.TableId;
  9. /**
  10. * <p>
  11. * 设备-路牌
  12. * </p>
  13. *
  14. * @author chenyi
  15. * @since 2021-06-12
  16. */
  17. @Data
  18. @TableName("device_lp")
  19. public class DeviceLp implements Serializable {
  20. private static final long serialVersionUID = 1L;
  21. @TableId(value = "id", type = IdType.AUTO)
  22. private Integer id;
  23. /**
  24. * 设备IMEI
  25. */
  26. private String num;
  27. /**
  28. * 登录MQTT 用户名
  29. */
  30. private String clientId;
  31. /**
  32. * 登录MQTT 密码
  33. */
  34. private String password;
  35. /**
  36. * 设备组
  37. */
  38. @TableField("`group`")
  39. private String group;
  40. /**
  41. * SN码
  42. */
  43. private String sn;
  44. /**
  45. * 定时唤醒时间
  46. */
  47. private Double wakeInt;
  48. /**
  49. * 阈值
  50. */
  51. private Integer thresh;
  52. /**
  53. * 电量
  54. */
  55. private String battery;
  56. /**
  57. * 信号
  58. */
  59. private String s4g;
  60. private String x;
  61. private String y;
  62. private String z;
  63. private String anglex;
  64. private String angley;
  65. private String anglez;
  66. /**
  67. * 温度
  68. */
  69. private String temp;
  70. /**
  71. * 经度
  72. */
  73. private String lon;
  74. /**
  75. * 纬度
  76. */
  77. private String lat;
  78. /**
  79. * 经度(gcj)
  80. */
  81. private String lonGcj;
  82. /**
  83. * 纬度(gcj)
  84. */
  85. private String latGcj;
  86. /**
  87. * 格式化的地理位置
  88. */
  89. private String site;
  90. /**
  91. * 定位模式 1:GPS 2:基站
  92. */
  93. private Integer mode;
  94. /**
  95. * 上传类型
  96. */
  97. private String dataType;
  98. /**
  99. * 数据更新时间
  100. */
  101. private LocalDateTime updateTime;
  102. /**
  103. * 获取在线状态
  104. */
  105. public Integer getStatus() {
  106. if (updateTime == null || wakeInt == null) return 0;
  107. return updateTime.compareTo(LocalDateTime.now().minusMinutes((int) (wakeInt * 60) + 5));
  108. }
  109. }