Przeglądaj źródła

Merge branch 'V0.0.9' of http://10.87.21.221:8000/jzyd_yyds/soc into V0.0.9

zhulu 1 rok temu
rodzic
commit
1e4ddfe8e8

+ 1 - 43
soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/mapper/VideoDaysCheckMapper.java

@@ -1,21 +1,10 @@
 package com.xunmei.iot.mapper;
 
-import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.xunmei.common.core.domain.video.MediatorVideoDaysCheck;
-import com.xunmei.iot.dto.videoDays.VideoDayCheckPageDto;
-import com.xunmei.iot.dto.videoDays.VideoDayCheckWebPageDto;
-import com.xunmei.iot.dto.videoDays.VideoDaysInconformityDto;
-import com.xunmei.iot.vo.videoDays.*;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
-import java.time.LocalDate;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
 /**
  * <p>
  * 录像机天数检查 Mapper 接口
@@ -27,36 +16,5 @@ import java.util.Map;
 @Mapper
 public interface VideoDaysCheckMapper extends BaseMapper<MediatorVideoDaysCheck> {
 
-//    Page<VideoDaysCheckPageVo> selectPageByOrgId(@Param("request") VideoDayCheckPageDto request, Page<VideoDaysCheckPageVo> mePage);
-
-    VideoDaysCheckChannelDetailVo selectChannelDetailById(@Param("equipmentcode") String equipmentCode, @Param("channelcode") String channelCode);
-
-//    List<VideoDaysCheck> selectByOrgId(@Param("orgId")Long orgId);
-
-//    MePage<VideoIntegrityCheckPageVo> selectPageByOrgId(@Param("orgId")Long orgId, MePage<VideoIntegrityCheckPageVo> mePage);
-
-    Page<VideoDaysCheckPageVo> selectPageByOrgIdAndTimeAndStatus(@Param("request") VideoDayCheckPageDto request, @Param("page") Page<VideoDaysCheckPageVo> mePage);
-    List<Map<String, Object>> totalVideoData(@Param("dayOfStartTime") Date dayOfStartTime, @Param("dayOfEndTime") Date dayOfEndTime, @Param("orgIds") List<Long> orgIds);
-//    @DS(DataSourceName.SHARDING_DATA_SOURCE_NAME)
-    List<Map<String, Object>> totalVideoDataLog(@Param("dayOfStartTime") Date dayOfStartTime, @Param("dayOfEndTime") Date dayOfEndTime, @Param("orgIds") List<Long> orgIds);
-    List<Map<String, Object>> totalDeviceNum(@Param("orgIds") List<Long> orgIds, @Param("categoryId") Long categoryId);
-
-    List<Map<String, Object>> totalHostOffData(@Param("orgIds") List<Long> orgIds, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
-
-    Page<VideoDayCheckWebPageVo> selectWebPageData(@Param("pageDto") VideoDayCheckWebPageDto pageDto, @Param("page") Page<VideoDayCheckWebPageVo> mePage);
-
-    VideoDayCheckWebDetailVo getWebDetailVo(@Param("id") Long id);
-
-    List<VideoDayCheckWebPageVo> selectVideoLoseDevice(@Param("orgId") Long orgId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
-
-
-    List<VideoDaysCheckChannelVo> selectChannelsByTime(@Param("equipmentCode") String equipmentCode, @Param("request") VideoDayCheckPageDto request);
-
-    List<VideoDaysCheckChannelVo> selectNotReportChannels(@Param("equipmentCode") String equipmentCode, @Param("request") VideoDayCheckPageDto request);
-
-    Integer getVideoDaysCheckAlarmNum(@Param("request") VideoDaysInconformityDto request);
-
-    List<VideoDaysCheckChannelVo> selectNotReportChannels(@Param("equipmentCode") String equipmentCode, @Param("request") VideoDayCheckPageDto request, @Param("codeList") List<String> codeList);
-
-    List<Map<String, Object>> totalLxwzxData(List<Long> orgIds, LocalDate parse);
+    Integer selectExceptionCount(@Param("orgId") Long orgId);
 }

+ 2 - 12
soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/service/impl/IotServiceImpl.java

@@ -2,7 +2,6 @@ package com.xunmei.iot.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.xunmei.common.core.domain.iot.domain.IotDvrChannel;
-import com.xunmei.common.core.domain.video.MediatorVideoDaysCheck;
 import com.xunmei.common.core.domain.video.MediatorVideoDiagnosisRecord;
 import com.xunmei.iot.mapper.IotDvrChannelMapper;
 import com.xunmei.iot.mapper.VideoDaysCheckMapper;
@@ -24,17 +23,8 @@ public class IotServiceImpl implements IotService {
 
     @Override
     public Integer selectVideoDayExceptionChannelNums(Long orgId) {
-        LambdaQueryWrapper<IotDvrChannel> channelWrapper = new LambdaQueryWrapper<>();
-        channelWrapper.eq(IotDvrChannel::getOrgId, orgId);
-        if (channelMapper.selectCount(channelWrapper) < 1) {
-            return null;
-        }
-
-
-        LambdaQueryWrapper<MediatorVideoDaysCheck> wrapper = new LambdaQueryWrapper<MediatorVideoDaysCheck>();
-        wrapper.eq(MediatorVideoDaysCheck::getOrgId, orgId);
-        wrapper.eq(MediatorVideoDaysCheck::getStatus, 1);
-        return videoDaysCheckMapper.selectCount(wrapper).intValue();
+        //此处考虑录像完整性和录像天数,任意一个异常就算异常
+        return videoDaysCheckMapper.selectExceptionCount(orgId);
     }
 
 

+ 17 - 0
soc-modules/soc-modules-iot/src/main/resources/mapper/VideoDaysCheckmapper.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.xunmei.iot.mapper.VideoDaysCheckMapper">
+    <select id="selectExceptionCount" resultType="java.lang.Integer">
+        select sum(CASE
+                       WHEN vdc.status = 0 and vic.status = 0 THEN 0
+                       ELSE if(vdc.status = 1 or vic.status > 0, 1, 0) END) as state
+        FROM iot_dvr_channel dc
+                 INNER JOIN mediator_video_days_check vdc
+                            on dc.host_code = vdc.equipment_code and dc.channel_code = vdc.channel_code
+                 INNER JOIN mediator_video_integrity_check vic
+                            on dc.host_code = vic.equipment_code and dc.channel_code = vic.channel_code
+
+        where dc.org_id = #{orgId}
+          and dc.deleted = 0
+    </select>
+</mapper>