Jelajahi Sumber

物联总览代码提交

jingyuanchao 1 tahun lalu
induk
melakukan
93e91ed420

+ 2 - 2
soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/mapper/IotBoardMapper.java

@@ -26,14 +26,14 @@ public interface IotBoardMapper extends BaseMapper {
 
     IotBoardOverviewItemVo dvrDisk(String orgPath);
 
-    List<Map<String,Long>> countDeviceNums(String orgPath);
+    List<Map<String,String>> countDeviceNums(String orgPath);
 
     List<Map<String, String>> countDeviceNums2(String orgPath);
 
     List<Map<String, String>> countSensorNums(String orgPath);
 
 
-    List<Map<String, String>> selectVideoDaysStorage(String orgPath, Date date);
+    List<Map<String, String>> selectVideoDaysStorage(@Param("orgPath") String orgPath, @Param("startTime") Date startTime);
 
     List<MediatorVideoIntegrityCheckLog> selectVideoCheckSelf(@Param("orgPath") String orgPath, @Param("startTime") String startTime, @Param("endTime") String endTime);
 }

+ 7 - 5
soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/service/impl/IotBoardServiceImpl.java

@@ -314,17 +314,19 @@ public class IotBoardServiceImpl implements IotBoardService {
         IotBoardTotalData totalData = new IotBoardTotalData();
         //构建设备一览表数据
         IotBoardTotalData.DeviceOverview deviceOverview = new IotBoardTotalData.DeviceOverview();
-        List<Map<String, Long>> deviceNums = iotBoardMapper.countDeviceNums(orgPath);
+        List<Map<String, String>> deviceNums = iotBoardMapper.countDeviceNums(orgPath);
         List<Map<String, String>> deviceNums2 = iotBoardMapper.countDeviceNums2(orgPath);
-        for (Map<String, Long> map : deviceNums) {
+        for (Map<String, String> map : deviceNums) {
+            String aLong = map.get(MAP_VALUE);
+            int res = Integer.parseInt(aLong);
             if (CategoryDataEnum.IOT_DETECTION_DEVICE.getId().equals(map.get(CATEGORY_ID))) {
-                deviceOverview.setEdgeComputingHosts(map.get(MAP_VALUE).intValue());
+                deviceOverview.setEdgeComputingHosts(res);
             }
             if (CategoryDataEnum.ALARM_HOST_DEVICE.getId().equals(map.get(CATEGORY_ID))) {
-                deviceOverview.setAlarmControllers(map.get(MAP_VALUE).intValue());
+                deviceOverview.setAlarmControllers(res);
             }
             if (CategoryDataEnum.MONITOR_HOST_DEVICE.getId().equals(map.get(CATEGORY_ID))) {
-                deviceOverview.setHardDiskRecorders(map.get(MAP_VALUE).intValue());
+                deviceOverview.setHardDiskRecorders(res);
             }
         }
         for (Map<String, String> map : deviceNums2) {

+ 1 - 1
soc-modules/soc-modules-iot/src/main/resources/mapper/IotAlarmDataMapper.xml

@@ -179,7 +179,7 @@
     </select>
 
     <select id="selectAlarmCount" resultType="java.util.Map">
-        select d.field_code as deviceType, count(1) as nums
+        select d.field_code as deviceType, CAST(COUNT(1) AS CHAR) as nums
         from iot_alarm_data d
                  inner join sys_org o on o.id = d.org_id
         where o.deleted = 0

+ 6 - 6
soc-modules/soc-modules-iot/src/main/resources/mapper/IotBoardMapper.xml

@@ -93,7 +93,7 @@
     </select>
 
     <select id="countDeviceNums" resultType="java.util.Map">
-        select category_id as categoryId, count(1) as nums
+        select category_id as categoryId, CAST(COUNT(1) AS CHAR) as nums
         from iot_device d
                  inner join sys_org o on o.id = d.org_id
         where d.deleted = 0
@@ -103,21 +103,21 @@
     </select>
 
     <select id="countDeviceNums2" resultType="java.util.Map">
-        select 'sensor' as categoryId, count(1) as nums
+        select 'sensor' as categoryId, CAST(COUNT(1) AS CHAR) as nums
         from iot_sensor s
                  inner join sys_org o on o.id = s.org_id
         where s.deleted = 0
           and o.deleted = 0
           and org_path like concat(#{orgPath}, '%')
         union all
-        select 'channel' as categoryId, count(1) as nums
+        select 'channel' as categoryId, CAST(COUNT(1) AS CHAR) as nums
         from iot_dvr_channel c
                  inner join sys_org o on o.id = c.org_id
         where c.deleted = 0
           and o.deleted = 0
           and org_path like concat(#{orgPath}, '%')
         union all
-        select 'disk' as categoryId, count(1) as nums
+        select 'disk' as categoryId, CAST(COUNT(1) AS CHAR) as nums
         from iot_dvr_disk d
                  inner join sys_org o on o.id = d.org_id
         where d.deleted = 0
@@ -126,7 +126,7 @@
     </select>
 
     <select id="countSensorNums" resultType="java.util.Map">
-        select s.device_type as deviceType, count(1) as nums
+        select s.device_type as deviceType, CAST(COUNT(1) AS CHAR) as nums
         from iot_sensor s
                  inner join sys_org o on o.id = s.org_id
         where o.deleted = 0
@@ -136,7 +136,7 @@
     </select>
 
     <select id="selectVideoDaysStorage" resultType="java.util.Map">
-        select c.plan_days as planDays, sum(c.plan_days != c.real_days) as nums
+        select CAST(c.plan_days AS CHAR) as planDays,CAST(sum(c.plan_days != c.real_days) AS CHAR) as nums
         from mediator_video_days_check c
                  inner join sys_org o on o.id = c.org_id
         where o.deleted = 0