Commit 667257a75a228ce7fe50a8a3cc8160628876015f

Authored by 64850858
1 parent eb6b6529

添加创建时间与更新时间

sql/mysql.sql
... ... @@ -15,6 +15,8 @@ create table device
15 15 registerTime varchar(50) null,
16 16 keepaliveTime varchar(50) null,
17 17 ip varchar(50) not null,
  18 + createTime varchar(50) not null,
  19 + updateTime varchar(50) not null,
18 20 port int not null,
19 21 expires int not null,
20 22 hostAddress varchar(50) not null
... ... @@ -49,6 +51,8 @@ create table device_channel
49 51 deviceId varchar(50) not null,
50 52 parental varchar(50) null,
51 53 hasAudio bit(1) null,
  54 + createTime varchar(50) not null,
  55 + updateTime varchar(50) not null,
52 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 84 */
85 85 private int expires;
86 86  
  87 + /**
  88 + * 创建时间
  89 + */
  90 + private String createTime;
  91 +
  92 + /**
  93 + * 更新时间
  94 + */
  95 + private String updateTime;
  96 +
87 97 public String getDeviceId() {
88 98 return deviceId;
89 99 }
... ... @@ -203,4 +213,20 @@ public class Device {
203 213 public void setExpires(int expires) {
204 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 118 * 云台类型描述字符串
119 119 */
120 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 413 public void setStreamId(String streamId) {
404 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 16  
17 17 @Insert("INSERT INTO device_channel (channelId, deviceId, name, manufacture, model, owner, civilCode, block, " +
18 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 20 "VALUES ('${channelId}', '${deviceId}', '${name}', '${manufacture}', '${model}', '${owner}', '${civilCode}', '${block}'," +
21 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 23 int add(DeviceChannel channel);
24 24  
25 25 @Update(value = {" <script>" +
26 26 "UPDATE device_channel " +
27   - "SET deviceId='${deviceId}'" +
  27 + "SET updateTime=datetime('now','localtime'))" +
28 28 "<if test=\"name != null\">, name='${name}'</if>" +
29 29 "<if test=\"manufacture != null\">, manufacture='${manufacture}'</if>" +
30 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 30 "expires," +
31 31 "registerTime," +
32 32 "keepaliveTime," +
  33 + "createTime," +
  34 + "updateTime," +
33 35 "online" +
34 36 ") VALUES (" +
35 37 "#{deviceId}," +
... ... @@ -45,13 +47,15 @@ public interface DeviceMapper {
45 47 "#{expires}," +
46 48 "#{registerTime}," +
47 49 "#{keepaliveTime}," +
  50 + "datetime('now','localtime')," +
  51 + "datetime('now','localtime')," +
48 52 "#{online}" +
49 53 ")")
50 54 int add(Device device);
51 55  
52 56 @Update(value = {" <script>" +
53 57 "UPDATE device " +
54   - "SET deviceId='${deviceId}'" +
  58 + "SET updateTime=datetime('now','localtime')" +
55 59 "<if test=\"name != null\">, name='${name}'</if>" +
56 60 "<if test=\"manufacturer != null\">, manufacturer='${manufacturer}'</if>" +
57 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 46 </el-table-column>
47 47 <el-table-column prop="registerTime" label="最近注册" align="center" width="140">
48 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 53 <el-table-column label="地址" width="180" align="center">
50 54 <template slot-scope="scope">
51 55 <div slot="reference" class="name-wrapper">
... ...