Browse Source

设备管理-视频监测-列表查询相关接口上传-1

jichaobo 3 năm trước cách đây
mục cha
commit
e0e1162428

+ 26 - 2
fiveep-controller/src/main/java/com/bizmatics/controller/web/DeviceController.java

@@ -100,6 +100,7 @@ public class DeviceController {
 
     /**
      * 设备管理-通信设备-新增
+     *
      * @param correspondDeviceVOT
      * @return
      */
@@ -111,6 +112,7 @@ public class DeviceController {
 
     /**
      * 设备管理-通信设备-修改
+     *
      * @param correspondDeviceVOT
      * @return
      */
@@ -122,6 +124,7 @@ public class DeviceController {
 
     /**
      * 设备管理-通信设备-注销
+     *
      * @param id
      * @return
      */
@@ -133,9 +136,10 @@ public class DeviceController {
 
     /**
      * 设备管理-通信设备-查询
+     *
      * @param deviceName 设备名称
-     * @param size 页数
-     * @param current 条数
+     * @param size       页数
+     * @param current    条数
      * @return
      */
     @GetMapping("correspondDeviceList")
@@ -147,6 +151,7 @@ public class DeviceController {
 
     /**
      * 设备管理-通信设备-修改回显
+     *
      * @param id 通信设备表主键ID
      * @return
      */
@@ -154,5 +159,24 @@ public class DeviceController {
     public ApiResult<List<CorrespondDeviceListVO>> correspondDeviceListEcho(@RequestParam int id) {
         return ApiResult.success(deviceService.correspondDeviceListEcho(id));
     }
+
+    /**
+     * 设备管理-视频监测-列表查询
+     * @param siteId  站点ID
+     * @param deviceName 设备名称
+     * @param size 页数
+     * @param current 条数
+     * @param deviceType 1:183用电设备,2:视频监控设备,3:171用电设备,4:173用电设备,5:158智能网关,6:其他 0:所有
+     * @return
+     */
+    @GetMapping("videoMonitoringDeviceList")
+    public ApiResult<CommonPage<Device>> videoMonitoringDeviceList(@RequestParam Integer siteId,
+                                                                   @RequestParam(required = false) String deviceName,
+                                                                   @RequestParam(value = "size", required = false, defaultValue = "1") Integer size,
+                                                                   @RequestParam(value = "current", required = false, defaultValue = "10") Integer current,
+                                                                   @RequestParam(value = "deviceType", required = false, defaultValue = "2") Integer deviceType
+    ) {
+        return ApiResult.success(deviceService.videoMonitoringDeviceList(deviceName, deviceType, siteId, size, current));
+    }
 }
 

+ 6 - 8
fiveep-model/src/main/java/com/bizmatics/model/Device.java

@@ -42,6 +42,7 @@ public class Device implements Serializable {
      */
     private String deviceName;
 
+    private String floor;
     /**
      * 所属站点
      */
@@ -68,19 +69,16 @@ public class Device implements Serializable {
     private String creator;
 
     /**
-     * sim卡号
+     * 使能标识(0 不生效,1生效)
      */
-    private String sim;
+    private Integer enable;
 
     /**
-     * 楼层
+     * sim卡号
      */
-    private String floor;
+    private String sim;
+
 
-    /**
-     * 使能标识(0 不生效,1生效)
-     */
-    private Integer enable;
 
     @TableField(exist = false)
     private Integer deviceStatus;

+ 2 - 0
fiveep-service/src/main/java/com/bizmatics/service/DeviceService.java

@@ -50,4 +50,6 @@ public interface DeviceService extends CrudService<Device> {
     CommonPage<CorrespondDeviceVO> correspondDeviceList(String deviceName, int size, int current);
 
     List<CorrespondDeviceListVO> correspondDeviceListEcho(int id);
+
+    CommonPage<Device> videoMonitoringDeviceList(String deviceName, Integer deviceType, Integer siteId, Integer size, Integer current);
 }

+ 19 - 0
fiveep-service/src/main/java/com/bizmatics/service/impl/DeviceServiceImpl.java

@@ -2,7 +2,9 @@ package com.bizmatics.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.bizmatics.common.core.bean.CommonPage;
 import com.bizmatics.common.core.util.DateUtils;
 import com.bizmatics.common.mvc.base.AbstractCrudService;
@@ -181,6 +183,23 @@ public class DeviceServiceImpl extends AbstractCrudService<DeviceMapper, Device>
         return list;
     }
 
+    @Override
+    public CommonPage<Device> videoMonitoringDeviceList(String deviceName,Integer deviceType,Integer siteId, Integer size, Integer current){
+        IPage<Device> page = new Page<Device>(size, current);
+        LambdaQueryWrapper<Device> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(Device::getSiteId, siteId).eq(Device::getEnable, 1);
+        if (deviceType != null && deviceType!=0) {
+            queryWrapper.eq(Device::getDeviceType, deviceType);
+        }
+        if (deviceName!=null && deviceName.equals("") && deviceName.equals(null)){
+            queryWrapper.like(Device::getDeviceName, deviceName);
+        }
+
+        page = this.page(page, queryWrapper);
+        this.ToCommonPage(page);
+        return new CommonPage<>(page.getRecords(), page.getTotal(), page.getCurrent(), page.getSize());
+    }
+
 
 
 }