Browse Source

feat: 【IoT 物联网】新增网关设备 ID 字段到 IotDevicePageReqVO,支持网关子设备的功能

haohao 5 months ago
parent
commit
6fdd91d01e

+ 3 - 0
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/device/vo/device/IotDevicePageReqVO.java

@@ -31,4 +31,7 @@ public class IotDevicePageReqVO extends PageParam {
     @Schema(description = "设备分组编号", example = "1024")
     private Long groupId;
 
+    @Schema(description = "网关设备 ID", example = "16380")
+    private Long gatewayId;
+
 }

+ 1 - 0
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/mysql/device/IotDeviceMapper.java

@@ -31,6 +31,7 @@ public interface IotDeviceMapper extends BaseMapperX<IotDeviceDO> {
                 .eqIfPresent(IotDeviceDO::getDeviceType, reqVO.getDeviceType())
                 .likeIfPresent(IotDeviceDO::getNickname, reqVO.getNickname())
                 .eqIfPresent(IotDeviceDO::getState, reqVO.getStatus())
+                .eqIfPresent(IotDeviceDO::getGatewayId, reqVO.getGatewayId())
                 .apply(ObjectUtil.isNotNull(reqVO.getGroupId()), "FIND_IN_SET(" + reqVO.getGroupId() + ",group_ids) > 0")
                 .orderByDesc(IotDeviceDO::getId));
     }