国标设备管理新增设备编号查询条件

pull/1645/head
wendy512 2024-10-12 16:33:15 +08:00
parent a59854e244
commit 9c5f9c020e
5 changed files with 13 additions and 6 deletions

View File

@ -97,14 +97,15 @@ public class DeviceQuery {
@Parameter(name = "page", description = "当前页", required = true) @Parameter(name = "page", description = "当前页", required = true)
@Parameter(name = "count", description = "每页查询数量", required = true) @Parameter(name = "count", description = "每页查询数量", required = true)
@Parameter(name = "query", description = "搜索", required = false) @Parameter(name = "query", description = "搜索", required = false)
@Parameter(name = "deviceId", description = "设备编号", required = false)
@Parameter(name = "status", description = "状态", required = false) @Parameter(name = "status", description = "状态", required = false)
@GetMapping("/devices") @GetMapping("/devices")
@Options() @Options()
public PageInfo<Device> devices(int page, int count, String query, Boolean status){ public PageInfo<Device> devices(int page, int count, String query, String deviceId, Boolean status){
if (ObjectUtils.isEmpty(query)){ if (ObjectUtils.isEmpty(query)){
query = null; query = null;
} }
return deviceService.getAll(page, count, query, status); return deviceService.getAll(page, count, query, deviceId, status);
} }
/** /**

View File

@ -340,10 +340,11 @@ public interface DeviceMapper {
" FROM wvp_device de" + " FROM wvp_device de" +
" where 1 = 1 "+ " where 1 = 1 "+
" <if test='status != null'> AND de.on_line=${status}</if>"+ " <if test='status != null'> AND de.on_line=${status}</if>"+
" <if test='deviceId != null'> AND de.device_id=#{deviceId}</if>"+
" <if test='query != null'> AND coalesce(custom_name, name) LIKE '%${query}%'</if> " + " <if test='query != null'> AND coalesce(custom_name, name) LIKE '%${query}%'</if> " +
" order by create_time desc "+ " order by create_time desc "+
" </script>") " </script>")
List<Device> getDeviceList(@Param("query") String query, @Param("status") Boolean status); List<Device> getDeviceList(@Param("query") String query, @Param("deviceId") String deviceId, @Param("status") Boolean status);
@Select("select * from wvp_device_channel where id = #{id}") @Select("select * from wvp_device_channel where id = #{id}")
DeviceChannel getRawChannel(@Param("id") int id); DeviceChannel getRawChannel(@Param("id") int id);

View File

@ -154,7 +154,7 @@ public interface IDeviceService {
*/ */
List<Device> getAll(); List<Device> getAll();
PageInfo<Device> getAll(int page, int count, String query, Boolean status); PageInfo<Device> getAll(int page, int count, String query, String deviceId, Boolean status);
Device getDevice(Integer gbDeviceDbId); Device getDevice(Integer gbDeviceDbId);

View File

@ -548,9 +548,9 @@ public class DeviceServiceImpl implements IDeviceService {
} }
@Override @Override
public PageInfo<Device> getAll(int page, int count, String query, Boolean status) { public PageInfo<Device> getAll(int page, int count, String query, String deviceId, Boolean status) {
PageHelper.startPage(page, count); PageHelper.startPage(page, count);
List<Device> all = deviceMapper.getDeviceList(query, status); List<Device> all = deviceMapper.getDeviceList(query, deviceId, status);
return new PageInfo<>(all); return new PageInfo<>(all);
} }

View File

@ -6,6 +6,9 @@
搜索: 搜索:
<el-input @input="getDeviceList" style="margin-right: 1rem; width: auto;" size="mini" placeholder="关键字" <el-input @input="getDeviceList" style="margin-right: 1rem; width: auto;" size="mini" placeholder="关键字"
prefix-icon="el-icon-search" v-model="searchSrt" clearable></el-input> prefix-icon="el-icon-search" v-model="searchSrt" clearable></el-input>
设备编号:
<el-input @input="getDeviceList" style="margin-right: 1rem; width: auto;" size="mini" placeholder="设备编号"
prefix-icon="el-icon-search" v-model="deviceId" clearable></el-input>
在线状态: 在线状态:
<el-select size="mini" style="width: 8rem; margin-right: 1rem;" @change="getDeviceList" v-model="online" placeholder="请选择" <el-select size="mini" style="width: 8rem; margin-right: 1rem;" @change="getDeviceList" v-model="online" placeholder="请选择"
default-first-option> default-first-option>
@ -118,6 +121,7 @@ export default {
deviceList: [], // deviceList: [], //
currentDevice: {}, // currentDevice: {}, //
searchSrt: "", searchSrt: "",
deviceId: "",
online: null, online: null,
videoComponentList: [], videoComponentList: [],
updateLooper: 0, // updateLooper: 0, //
@ -171,6 +175,7 @@ export default {
page: this.currentPage, page: this.currentPage,
count: this.count, count: this.count,
query: this.searchSrt, query: this.searchSrt,
deviceId: this.deviceId,
status: this.online, status: this.online,
} }
}).then( (res)=> { }).then( (res)=> {