From 061749548c0b603774582f823768c23f351a39e1 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: Mon, 22 May 2023 11:23:48 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AD=97=E6=AE=B5=E5=90=8D?=
=?UTF-8?q?=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../iot/vmp/storager/dao/DeviceChannelMapper.java | 6 +++---
.../iot/vmp/web/gb28181/ApiDeviceController.java | 4 ++--
.../iot/vmp/web/gb28181/dto/DeviceChannelExtend.java | 12 ++++++------
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
index 5628be92..22b95c22 100644
--- a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
@@ -88,12 +88,12 @@ public interface DeviceChannelMapper {
"SELECT " +
"dc.*, " +
"de.name as device_name, " +
- "de.online as device_online " +
+ "de.on_line as device_online " +
"from " +
"wvp_device_channel dc " +
"LEFT JOIN wvp_device de ON dc.device_id = de.device_id " +
"WHERE 1=1" +
- " AND dc.device_id = #{deviceId} " +
+ " AND dc.device_id = #{deviceId} " +
" AND (dc.channel_id LIKE '%${query}%' OR dc.name LIKE '%${query}%' OR dc.name LIKE '%${query}%') " +
" AND dc.parent_id=#{parentChannelId} " +
" AND dc.status=true" +
@@ -112,7 +112,7 @@ public interface DeviceChannelMapper {
"SELECT " +
"dc.*, " +
"de.name as device_name, " +
- "de.online as device_online " +
+ "de.on_line as device_online " +
"from " +
"wvp_device_channel dc " +
"LEFT JOIN wvp_device de ON dc.device_id = de.device_id " +
diff --git a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java
index ba301755..d8c20930 100644
--- a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java
+++ b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java
@@ -148,7 +148,7 @@ public class ApiDeviceController {
deviceJOSNChannel.put("ID", deviceChannelExtend.getChannelId());
deviceJOSNChannel.put("DeviceID", deviceChannelExtend.getDeviceId());
deviceJOSNChannel.put("DeviceName", deviceChannelExtend.getDeviceName());
- deviceJOSNChannel.put("DeviceOnline", deviceChannelExtend.getDeviceOnline() == 1);
+ deviceJOSNChannel.put("DeviceOnline", deviceChannelExtend.isDeviceOnline());
deviceJOSNChannel.put("Channel", 0); // TODO 自定义序号
deviceJOSNChannel.put("Name", deviceChannelExtend.getName());
deviceJOSNChannel.put("Custom", false);
@@ -167,7 +167,7 @@ public class ApiDeviceController {
// 1-IETF RFC3261,
// 2-基于口令的双向认证,
// 3-基于数字证书的双向认证
- deviceJOSNChannel.put("Status", deviceChannelExtend.getStatus() == 1 ? "ON":"OFF");
+ deviceJOSNChannel.put("Status", deviceChannelExtend.isStatus() ? "ON":"OFF");
deviceJOSNChannel.put("Longitude", deviceChannelExtend.getLongitude());
deviceJOSNChannel.put("Latitude", deviceChannelExtend.getLatitude());
deviceJOSNChannel.put("PTZType ", deviceChannelExtend.getPTZType()); // 云台类型, 0 - 未知, 1 - 球机, 2 - 半球,
diff --git a/src/main/java/com/genersoft/iot/vmp/web/gb28181/dto/DeviceChannelExtend.java b/src/main/java/com/genersoft/iot/vmp/web/gb28181/dto/DeviceChannelExtend.java
index 972d1a6a..5e76cb70 100644
--- a/src/main/java/com/genersoft/iot/vmp/web/gb28181/dto/DeviceChannelExtend.java
+++ b/src/main/java/com/genersoft/iot/vmp/web/gb28181/dto/DeviceChannelExtend.java
@@ -25,7 +25,7 @@ public class DeviceChannelExtend {
private String deviceName;
- private int deviceOnline;
+ private boolean deviceOnline;
/**
* 生产厂商
@@ -146,7 +146,7 @@ public class DeviceChannelExtend {
* OFF
* 遇到过NVR下的IPC下发信令可以推流, 但是 Status 响应 OFF
*/
- private int status;
+ private boolean status;
/**
* 经度
@@ -417,11 +417,11 @@ public class DeviceChannelExtend {
this.PTZTypeText = PTZTypeText;
}
- public int getStatus() {
+ public boolean isStatus() {
return status;
}
- public void setStatus(int status) {
+ public void setStatus(boolean status) {
this.status = status;
}
@@ -545,11 +545,11 @@ public class DeviceChannelExtend {
this.deviceName = deviceName;
}
- public int getDeviceOnline() {
+ public boolean isDeviceOnline() {
return deviceOnline;
}
- public void setDeviceOnline(int deviceOnline) {
+ public void setDeviceOnline(boolean deviceOnline) {
this.deviceOnline = deviceOnline;
}
}