Commit b3427df5d60b149084152aada771de6d7900bd45

Authored by liujun001
1 parent b4830a3a

NVR添加搜索

src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java
@@ -165,7 +165,7 @@ public interface DeviceMapper { @@ -165,7 +165,7 @@ public interface DeviceMapper {
165 "(SELECT count(0) FROM wvp_device_channel WHERE device_id=de.device_id) as channel_count " + 165 "(SELECT count(0) FROM wvp_device_channel WHERE device_id=de.device_id) as channel_count " +
166 "FROM wvp_device de" + 166 "FROM wvp_device de" +
167 "<if test=\"onLine != null\"> where on_line=${onLine}</if>"+ 167 "<if test=\"onLine != null\"> where on_line=${onLine}</if>"+
168 - " order by create_time desc "+ 168 + " order by on_line desc,create_time desc "+
169 " </script>" 169 " </script>"
170 ) 170 )
171 List<Device> getDevices(Boolean onLine); 171 List<Device> getDevices(Boolean onLine);
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java
@@ -109,12 +109,13 @@ public class DeviceQuery { @@ -109,12 +109,13 @@ public class DeviceQuery {
109 @Operation(summary = "分页查询国标设备", security = @SecurityRequirement(name = JwtUtils.HEADER)) 109 @Operation(summary = "分页查询国标设备", security = @SecurityRequirement(name = JwtUtils.HEADER))
110 @Parameter(name = "page", description = "当前页", required = true) 110 @Parameter(name = "page", description = "当前页", required = true)
111 @Parameter(name = "count", description = "每页查询数量", required = true) 111 @Parameter(name = "count", description = "每页查询数量", required = true)
  112 + @Parameter(name = "online", description = "在线状态")
112 @GetMapping("/devices") 113 @GetMapping("/devices")
113 @Options() 114 @Options()
114 - public PageInfo<Device> devices(int page, int count) { 115 + public PageInfo<Device> devices(int page, int count,Boolean online) {
115 // if (page == null) page = 0; 116 // if (page == null) page = 0;
116 // if (count == null) count = 20; 117 // if (count == null) count = 20;
117 - return storager.queryVideoDeviceList(page, count, null); 118 + return storager.queryVideoDeviceList(page, count, online);
118 } 119 }
119 120
120 /** 121 /**
web_src/src/components/DeviceList.vue
@@ -3,6 +3,14 @@ @@ -3,6 +3,14 @@
3 <div class="page-header"> 3 <div class="page-header">
4 <div class="page-title">设备列表</div> 4 <div class="page-title">设备列表</div>
5 <div class="page-header-btn"> 5 <div class="page-header-btn">
  6 + 在线状态:
  7 + <el-select size="mini" style="width: 8rem; margin-right: 1rem;" @change="getDeviceList()" v-model="online" placeholder="请选择"
  8 + default-first-option>
  9 + <el-option label="全部" value=""></el-option>
  10 + <el-option label="在线" value="true"></el-option>
  11 + <el-option label="离线" value="false"></el-option>
  12 + </el-select>
  13 +
6 <el-button icon="el-icon-plus" size="mini" style="margin-right: 1rem;" type="primary" @click="add">添加设备 14 <el-button icon="el-icon-plus" size="mini" style="margin-right: 1rem;" type="primary" @click="add">添加设备
7 </el-button> 15 </el-button>
8 <el-button icon="el-icon-refresh-right" circle size="mini" :loading="getDeviceListLoading" 16 <el-button icon="el-icon-refresh-right" circle size="mini" :loading="getDeviceListLoading"
@@ -112,6 +120,7 @@ export default { @@ -112,6 +120,7 @@ export default {
112 currentDeviceChannelsLenth: 0, 120 currentDeviceChannelsLenth: 0,
113 winHeight: window.innerHeight - 200, 121 winHeight: window.innerHeight - 200,
114 currentPage: 1, 122 currentPage: 1,
  123 + online:'true',
115 count: 15, 124 count: 15,
116 total: 0, 125 total: 0,
117 getDeviceListLoading: false, 126 getDeviceListLoading: false,
@@ -157,7 +166,8 @@ export default { @@ -157,7 +166,8 @@ export default {
157 url: `/api/device/query/devices`, 166 url: `/api/device/query/devices`,
158 params: { 167 params: {
159 page: this.currentPage, 168 page: this.currentPage,
160 - count: this.count 169 + count: this.count,
  170 + online:this.online
161 } 171 }
162 }).then( (res)=> { 172 }).then( (res)=> {
163 if (res.data.code === 0) { 173 if (res.data.code === 0) {