SysMsgBean.java
5.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
package com.glsx.dao.bean;
import com.j256.ormlite.field.DataType;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
/**
* id:当前字段是不是id字段(一个实体类中只能设置一个id字段)
* columnName:表示当前属性在表中代表哪个字段
* generatedId:设置属性值在数据表中的数据是否自增
* useGetSet:是否使用Getter/Setter方法来访问这个字段
* canBeNull:字段是否可以为空,默认值是true
* unique:是否唯一
* defaultValue:设置这个字段的默认值
* foreignColumnName:外键约束指向的类中的属性名
* foreign:当前字段是否是外键
* foreignAutoRefresh:如果这个属性设置为true,在关联查询的时候就不需要再调用refresh()方法了
*/
// 数据库表名,默认为类名
@DatabaseTable (tableName = SysMsgBean.TABLE_NAME)
public class SysMsgBean {
//为了沿用之前数据库的数据,表名和列名和之前保持一致.以防数据读取异常2021年6月23日
public static final String TABLE_NAME = "SYS_MSG_BEAN";
public static final String COLUMN_NAME_ID = "_id";
public static final String COLUMN_NAME_MSG_TYPE = "MSG_TYPE";
public static final String COLUMN_NAME_MSG_STATE = "MSG_STATE";
public static final String COLUMN_NAME_MSG_TIME = "MSG_TIME";
public static final String COLUMN_NAME_MSG_CONTENT = "MSG_CONTENT";
public static final String COLUMN_NAME_MSG_URL = "MSG_URL";
public static final String COLUMN_NAME_DEVICE_SN = "DEVICE_SN";
public static final String COLUMN_NAME_USER_ID = "USER_ID";
public static final String COLUMN_NAME_POSITION = "POSITION";
// 主键
@DatabaseField(columnName = COLUMN_NAME_ID,generatedId = true,dataType = DataType.INTEGER)
public int id;
@DatabaseField(columnName = COLUMN_NAME_MSG_TYPE,dataType = DataType.INTEGER)
public int msgType; //消息类型 实时照片拍摄成功消息、回看视频下载成功消息
@DatabaseField(columnName = COLUMN_NAME_MSG_STATE,dataType = DataType.INTEGER)
public int msgState; //消息状态
@DatabaseField(columnName = COLUMN_NAME_MSG_TIME,dataType = DataType.STRING)
public String msgTime; //消息时间
@DatabaseField(columnName = COLUMN_NAME_MSG_CONTENT,dataType = DataType.STRING)
public String msgContent; //消息内容
@DatabaseField(columnName = COLUMN_NAME_MSG_URL,dataType = DataType.STRING)
public String msgUrl; // 视频\照片详情
@DatabaseField(columnName = COLUMN_NAME_DEVICE_SN,dataType = DataType.STRING)
public String deviceSn; //
@DatabaseField(columnName = COLUMN_NAME_USER_ID,dataType = DataType.STRING)
public String userId; //
@DatabaseField(columnName = COLUMN_NAME_POSITION,dataType = DataType.STRING)
public String position;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getMsgType() {
return msgType;
}
public void setMsgType(int msgType) {
this.msgType = msgType;
}
public int getMsgState() {
return msgState;
}
public void setMsgState(int msgState) {
this.msgState = msgState;
}
public String getMsgTime() {
return msgTime;
}
public void setMsgTime(String msgTime) {
this.msgTime = msgTime;
}
public String getMsgContent() {
return msgContent;
}
public void setMsgContent(String msgContent) {
this.msgContent = msgContent;
}
public String getMsgUrl() {
return msgUrl;
}
public void setMsgUrl(String msgUrl) {
this.msgUrl = msgUrl;
}
public String getDeviceSn() {
return deviceSn;
}
public void setDeviceSn(String deviceSn) {
this.deviceSn = deviceSn;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getPosition() {
return position;
}
public void setPosition(String position) {
this.position = position;
}
public SysMsgBean() {
}
public SysMsgBean(int id, Integer msgType, Integer msgState, String msgTime,
String msgContent, String msgUrl, String deviceSn, String userId,
String position) {
this.id = id;
this.msgType = msgType;
this.msgState = msgState;
this.msgTime = msgTime;
this.msgContent = msgContent;
this.msgUrl = msgUrl;
this.deviceSn = deviceSn;
this.userId = userId;
this.position = position;
}
@Override
public String toString() {
return "SysMsgBean{" +
"id=" + id +
", msgType=" + msgType +
", msgState=" + msgState +
", msgTime='" + msgTime + '\'' +
", msgContent='" + msgContent + '\'' +
", msgUrl='" + msgUrl + '\'' +
", deviceSn='" + deviceSn + '\'' +
", userId='" + userId + '\'' +
", position='" + position + '\'' +
'}';
}
}