Commit 667257a75a228ce7fe50a8a3cc8160628876015f
1 parent
eb6b6529
添加创建时间与更新时间
Showing
7 changed files
with
68 additions
and
4 deletions
sql/mysql.sql
| @@ -15,6 +15,8 @@ create table device | @@ -15,6 +15,8 @@ create table device | ||
| 15 | registerTime varchar(50) null, | 15 | registerTime varchar(50) null, |
| 16 | keepaliveTime varchar(50) null, | 16 | keepaliveTime varchar(50) null, |
| 17 | ip varchar(50) not null, | 17 | ip varchar(50) not null, |
| 18 | + createTime varchar(50) not null, | ||
| 19 | + updateTime varchar(50) not null, | ||
| 18 | port int not null, | 20 | port int not null, |
| 19 | expires int not null, | 21 | expires int not null, |
| 20 | hostAddress varchar(50) not null | 22 | hostAddress varchar(50) not null |
| @@ -49,6 +51,8 @@ create table device_channel | @@ -49,6 +51,8 @@ create table device_channel | ||
| 49 | deviceId varchar(50) not null, | 51 | deviceId varchar(50) not null, |
| 50 | parental varchar(50) null, | 52 | parental varchar(50) null, |
| 51 | hasAudio bit(1) null, | 53 | hasAudio bit(1) null, |
| 54 | + createTime varchar(50) not null, | ||
| 55 | + updateTime varchar(50) not null, | ||
| 52 | primary key (channelId, deviceId) | 56 | primary key (channelId, deviceId) |
| 53 | ); | 57 | ); |
| 54 | 58 |
src/main/java/com/genersoft/iot/vmp/gb28181/bean/Device.java
| @@ -84,6 +84,16 @@ public class Device { | @@ -84,6 +84,16 @@ public class Device { | ||
| 84 | */ | 84 | */ |
| 85 | private int expires; | 85 | private int expires; |
| 86 | 86 | ||
| 87 | + /** | ||
| 88 | + * 创建时间 | ||
| 89 | + */ | ||
| 90 | + private String createTime; | ||
| 91 | + | ||
| 92 | + /** | ||
| 93 | + * 更新时间 | ||
| 94 | + */ | ||
| 95 | + private String updateTime; | ||
| 96 | + | ||
| 87 | public String getDeviceId() { | 97 | public String getDeviceId() { |
| 88 | return deviceId; | 98 | return deviceId; |
| 89 | } | 99 | } |
| @@ -203,4 +213,20 @@ public class Device { | @@ -203,4 +213,20 @@ public class Device { | ||
| 203 | public void setExpires(int expires) { | 213 | public void setExpires(int expires) { |
| 204 | this.expires = expires; | 214 | this.expires = expires; |
| 205 | } | 215 | } |
| 216 | + | ||
| 217 | + public String getCreateTime() { | ||
| 218 | + return createTime; | ||
| 219 | + } | ||
| 220 | + | ||
| 221 | + public void setCreateTime(String createTime) { | ||
| 222 | + this.createTime = createTime; | ||
| 223 | + } | ||
| 224 | + | ||
| 225 | + public String getUpdateTime() { | ||
| 226 | + return updateTime; | ||
| 227 | + } | ||
| 228 | + | ||
| 229 | + public void setUpdateTime(String updateTime) { | ||
| 230 | + this.updateTime = updateTime; | ||
| 231 | + } | ||
| 206 | } | 232 | } |
src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java
| @@ -118,6 +118,16 @@ public class DeviceChannel { | @@ -118,6 +118,16 @@ public class DeviceChannel { | ||
| 118 | * 云台类型描述字符串 | 118 | * 云台类型描述字符串 |
| 119 | */ | 119 | */ |
| 120 | private String PTZTypeText; | 120 | private String PTZTypeText; |
| 121 | + | ||
| 122 | + /** | ||
| 123 | + * 创建时间 | ||
| 124 | + */ | ||
| 125 | + private String createTime; | ||
| 126 | + | ||
| 127 | + /** | ||
| 128 | + * 更新时间 | ||
| 129 | + */ | ||
| 130 | + private String updateTime; | ||
| 121 | 131 | ||
| 122 | /** | 132 | /** |
| 123 | * 在线/离线 | 133 | * 在线/离线 |
| @@ -403,4 +413,20 @@ public class DeviceChannel { | @@ -403,4 +413,20 @@ public class DeviceChannel { | ||
| 403 | public void setStreamId(String streamId) { | 413 | public void setStreamId(String streamId) { |
| 404 | this.streamId = streamId; | 414 | this.streamId = streamId; |
| 405 | } | 415 | } |
| 416 | + | ||
| 417 | + public String getCreateTime() { | ||
| 418 | + return createTime; | ||
| 419 | + } | ||
| 420 | + | ||
| 421 | + public void setCreateTime(String createTime) { | ||
| 422 | + this.createTime = createTime; | ||
| 423 | + } | ||
| 424 | + | ||
| 425 | + public String getUpdateTime() { | ||
| 426 | + return updateTime; | ||
| 427 | + } | ||
| 428 | + | ||
| 429 | + public void setUpdateTime(String updateTime) { | ||
| 430 | + this.updateTime = updateTime; | ||
| 431 | + } | ||
| 406 | } | 432 | } |
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
| @@ -16,15 +16,15 @@ public interface DeviceChannelMapper { | @@ -16,15 +16,15 @@ public interface DeviceChannelMapper { | ||
| 16 | 16 | ||
| 17 | @Insert("INSERT INTO device_channel (channelId, deviceId, name, manufacture, model, owner, civilCode, block, " + | 17 | @Insert("INSERT INTO device_channel (channelId, deviceId, name, manufacture, model, owner, civilCode, block, " + |
| 18 | "address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " + | 18 | "address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " + |
| 19 | - "ipAddress, port, password, PTZType, status, streamId, longitude, latitude) " + | 19 | + "ipAddress, port, password, PTZType, status, streamId, longitude, latitude, createTime, updateTime) " + |
| 20 | "VALUES ('${channelId}', '${deviceId}', '${name}', '${manufacture}', '${model}', '${owner}', '${civilCode}', '${block}'," + | 20 | "VALUES ('${channelId}', '${deviceId}', '${name}', '${manufacture}', '${model}', '${owner}', '${civilCode}', '${block}'," + |
| 21 | "'${address}', ${parental}, '${parentId}', ${safetyWay}, ${registerWay}, '${certNum}', ${certifiable}, ${errCode}, '${secrecy}', " + | 21 | "'${address}', ${parental}, '${parentId}', ${safetyWay}, ${registerWay}, '${certNum}', ${certifiable}, ${errCode}, '${secrecy}', " + |
| 22 | - "'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status}, '${streamId}', ${longitude}, ${latitude})") | 22 | + "'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status}, '${streamId}', ${longitude}, ${latitude}, datetime('now','localtime'), datetime('now','localtime'))") |
| 23 | int add(DeviceChannel channel); | 23 | int add(DeviceChannel channel); |
| 24 | 24 | ||
| 25 | @Update(value = {" <script>" + | 25 | @Update(value = {" <script>" + |
| 26 | "UPDATE device_channel " + | 26 | "UPDATE device_channel " + |
| 27 | - "SET deviceId='${deviceId}'" + | 27 | + "SET updateTime=datetime('now','localtime'))" + |
| 28 | "<if test=\"name != null\">, name='${name}'</if>" + | 28 | "<if test=\"name != null\">, name='${name}'</if>" + |
| 29 | "<if test=\"manufacture != null\">, manufacture='${manufacture}'</if>" + | 29 | "<if test=\"manufacture != null\">, manufacture='${manufacture}'</if>" + |
| 30 | "<if test=\"model != null\">, model='${model}'</if>" + | 30 | "<if test=\"model != null\">, model='${model}'</if>" + |
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java
| @@ -30,6 +30,8 @@ public interface DeviceMapper { | @@ -30,6 +30,8 @@ public interface DeviceMapper { | ||
| 30 | "expires," + | 30 | "expires," + |
| 31 | "registerTime," + | 31 | "registerTime," + |
| 32 | "keepaliveTime," + | 32 | "keepaliveTime," + |
| 33 | + "createTime," + | ||
| 34 | + "updateTime," + | ||
| 33 | "online" + | 35 | "online" + |
| 34 | ") VALUES (" + | 36 | ") VALUES (" + |
| 35 | "#{deviceId}," + | 37 | "#{deviceId}," + |
| @@ -45,13 +47,15 @@ public interface DeviceMapper { | @@ -45,13 +47,15 @@ public interface DeviceMapper { | ||
| 45 | "#{expires}," + | 47 | "#{expires}," + |
| 46 | "#{registerTime}," + | 48 | "#{registerTime}," + |
| 47 | "#{keepaliveTime}," + | 49 | "#{keepaliveTime}," + |
| 50 | + "datetime('now','localtime')," + | ||
| 51 | + "datetime('now','localtime')," + | ||
| 48 | "#{online}" + | 52 | "#{online}" + |
| 49 | ")") | 53 | ")") |
| 50 | int add(Device device); | 54 | int add(Device device); |
| 51 | 55 | ||
| 52 | @Update(value = {" <script>" + | 56 | @Update(value = {" <script>" + |
| 53 | "UPDATE device " + | 57 | "UPDATE device " + |
| 54 | - "SET deviceId='${deviceId}'" + | 58 | + "SET updateTime=datetime('now','localtime')" + |
| 55 | "<if test=\"name != null\">, name='${name}'</if>" + | 59 | "<if test=\"name != null\">, name='${name}'</if>" + |
| 56 | "<if test=\"manufacturer != null\">, manufacturer='${manufacturer}'</if>" + | 60 | "<if test=\"manufacturer != null\">, manufacturer='${manufacturer}'</if>" + |
| 57 | "<if test=\"model != null\">, model='${model}'</if>" + | 61 | "<if test=\"model != null\">, model='${model}'</if>" + |
src/main/resources/wvp.sqlite
No preview for this file type
web_src/src/components/DeviceList.vue
| @@ -46,6 +46,10 @@ | @@ -46,6 +46,10 @@ | ||
| 46 | </el-table-column> | 46 | </el-table-column> |
| 47 | <el-table-column prop="registerTime" label="最近注册" align="center" width="140"> | 47 | <el-table-column prop="registerTime" label="最近注册" align="center" width="140"> |
| 48 | </el-table-column> | 48 | </el-table-column> |
| 49 | + <el-table-column prop="updateTime" label="更新时间" align="center" width="140"> | ||
| 50 | + </el-table-column> | ||
| 51 | + <el-table-column prop="createTime" label="创建时间" align="center" width="140"> | ||
| 52 | + </el-table-column> | ||
| 49 | <el-table-column label="地址" width="180" align="center"> | 53 | <el-table-column label="地址" width="180" align="center"> |
| 50 | <template slot-scope="scope"> | 54 | <template slot-scope="scope"> |
| 51 | <div slot="reference" class="name-wrapper"> | 55 | <div slot="reference" class="name-wrapper"> |