Commit 8356c18116aebff02551fd3aef01157ebf01d9b0
Merge branch 'ljl1216' into 'master'
fix: 设备枚举类型数据丢失 See merge request huang/thingsboard3.3.2!13
Showing
1 changed file
with
5 additions
and
2 deletions
... | ... | @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; |
6 | 6 | import com.fasterxml.jackson.databind.JsonNode; |
7 | 7 | import lombok.Data; |
8 | 8 | import lombok.EqualsAndHashCode; |
9 | +import org.apache.ibatis.type.EnumTypeHandler; | |
9 | 10 | import org.thingsboard.server.common.data.yunteng.constant.ModelConstants; |
10 | 11 | import org.thingsboard.server.common.data.yunteng.enums.DeviceCredentialsEnum; |
11 | 12 | import org.thingsboard.server.common.data.yunteng.enums.DeviceState; |
... | ... | @@ -23,14 +24,16 @@ public class YtDevice extends TenantBaseEntity { |
23 | 24 | private JsonNode deviceInfo; |
24 | 25 | |
25 | 26 | private LocalDateTime activeTime; |
26 | - private String deviceState; | |
27 | + @TableField(typeHandler = EnumTypeHandler.class) | |
28 | + private DeviceState deviceState; | |
27 | 29 | private String profileId; |
28 | 30 | private String deviceToken; |
29 | 31 | private String tbDeviceId; |
30 | 32 | private String deviceTypeId; |
31 | 33 | private LocalDateTime lastConnectTime; |
32 | 34 | private String label; |
33 | - private String deviceType; | |
35 | + @TableField(typeHandler = EnumTypeHandler.class) | |
36 | + private DeviceTypeEnum deviceType; | |
34 | 37 | // private DeviceCredentialsEnum deviceCredentials; |
35 | 38 | private String organizationId; |
36 | 39 | /** 告警状态:0:正常 1:告警 */ | ... | ... |