|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+package com.wm.gis.entity;
|
|
|
2
|
+
|
|
|
3
|
+import jakarta.persistence.*;
|
|
|
4
|
+import org.locationtech.jts.geom.Point;
|
|
|
5
|
+
|
|
|
6
|
+import java.time.LocalDateTime;
|
|
|
7
|
+
|
|
|
8
|
+@Entity
|
|
|
9
|
+@Table(name = "iot_device")
|
|
|
10
|
+public class IotDevice {
|
|
|
11
|
+ @Id
|
|
|
12
|
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
13
|
+ private Long id;
|
|
|
14
|
+
|
|
|
15
|
+ @Column(unique = true, nullable = false, length = 50)
|
|
|
16
|
+ private String deviceCode;
|
|
|
17
|
+
|
|
|
18
|
+ @Column(nullable = false, length = 100)
|
|
|
19
|
+ private String name;
|
|
|
20
|
+
|
|
|
21
|
+ @Column(nullable = false, length = 50)
|
|
|
22
|
+ private String deviceType;
|
|
|
23
|
+
|
|
|
24
|
+ @Column(name = "longitude", precision = 10, scale = 6)
|
|
|
25
|
+ private Double longitude;
|
|
|
26
|
+
|
|
|
27
|
+ @Column(name = "latitude", precision = 10, scale = 6)
|
|
|
28
|
+ private Double latitude;
|
|
|
29
|
+
|
|
|
30
|
+ @Column(name = "gis_layer_name", length = 100)
|
|
|
31
|
+ private String gisLayerName;
|
|
|
32
|
+
|
|
|
33
|
+ @Column(name = "created_at")
|
|
|
34
|
+ private LocalDateTime createdAt;
|
|
|
35
|
+
|
|
|
36
|
+ @Column(name = "updated_at")
|
|
|
37
|
+ private LocalDateTime updatedAt;
|
|
|
38
|
+
|
|
|
39
|
+ @Column(name = "location_geom", columnDefinition = "geometry(Point, 4326)")
|
|
|
40
|
+ private Point locationGeom;
|
|
|
41
|
+
|
|
|
42
|
+ // getters and setters
|
|
|
43
|
+ public Long getId() { return id; }
|
|
|
44
|
+ public void setId(Long id) { this.id = id; }
|
|
|
45
|
+ public String getDeviceCode() { return deviceCode; }
|
|
|
46
|
+ public void setDeviceCode(String deviceCode) { this.deviceCode = deviceCode; }
|
|
|
47
|
+ public String getName() { return name; }
|
|
|
48
|
+ public void setName(String name) { this.name = name; }
|
|
|
49
|
+ public String getDeviceType() { return deviceType; }
|
|
|
50
|
+ public void setDeviceType(String deviceType) { this.deviceType = deviceType; }
|
|
|
51
|
+ public Double getLongitude() { return longitude; }
|
|
|
52
|
+ public void setLongitude(Double longitude) { this.longitude = longitude; }
|
|
|
53
|
+ public Double getLatitude() { return latitude; }
|
|
|
54
|
+ public void setLatitude(Double latitude) { this.latitude = latitude; }
|
|
|
55
|
+ public String getGisLayerName() { return gisLayerName; }
|
|
|
56
|
+ public void setGisLayerName(String gisLayerName) { this.gisLayerName = gisLayerName; }
|
|
|
57
|
+ public LocalDateTime getCreatedAt() { return createdAt; }
|
|
|
58
|
+ public void setCreatedAt(LocalDateTime createdAt) { this.createdAt = createdAt; }
|
|
|
59
|
+ public LocalDateTime getUpdatedAt() { return updatedAt; }
|
|
|
60
|
+ public void setUpdatedAt(LocalDateTime updatedAt) { this.updatedAt = updatedAt; }
|
|
|
61
|
+ public Point getLocationGeom() { return locationGeom; }
|
|
|
62
|
+ public void setLocationGeom(Point locationGeom) { this.locationGeom = locationGeom; }
|
|
|
63
|
+}
|