龚焕茏
2024-04-02 100fccb242e35b1c912ceb13fd956f48aa64acbc
设备列表展示、详情展示、显隐列、统计数
5个文件已修改
77 ■■■■■ 已修改文件
ycl-server/src/main/java/com/ycl/platform/controller/TMonitorController.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/mapper/TMonitorMapper.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/ITMonitorService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/controller/TMonitorController.java
@@ -11,7 +11,6 @@
import enumeration.BusinessType;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -96,4 +95,24 @@
    {
        return toAjax(tMonitorService.deleteTMonitorByIds(ids));
    }
    /**
     * 获取视频设备统计数
     */
    @GetMapping("/getVideoCount/{cameraFunType}")
    public AjaxResult getVideoCount(@PathVariable String cameraFunType)
    {
        return success(tMonitorService.getVideoCount(cameraFunType));
    }
    /**
     * 获取异常恢复视频设备统计数
     */
    @GetMapping("/recoveryException")
    public AjaxResult recoveryException()
    {
        return success(tMonitorService.recoveryException());
    }
}
ycl-server/src/main/java/com/ycl/platform/mapper/TMonitorMapper.java
@@ -4,6 +4,7 @@
import com.ycl.platform.domain.vo.TMonitorVO;
import java.util.List;
import java.util.Map;
/**
 * 设备资产Mapper接口
@@ -60,4 +61,13 @@
     * @return 结果
     */
    public int deleteTMonitorByIds(Long[] ids);
    /**
     * 获取视频统计
     * @param cameraFunType 类型
     * @return 统计数
     */
    Map<String, String> getVideoCount(String cameraFunType);
    Map<String, String> recoveryException();
}
ycl-server/src/main/java/com/ycl/platform/service/ITMonitorService.java
@@ -4,6 +4,7 @@
import com.ycl.platform.domain.vo.TMonitorVO;
import java.util.List;
import java.util.Map;
/**
 * 设备资产Service接口
@@ -60,4 +61,14 @@
     * @return 结果
     */
    public int deleteTMonitorById(Long id);
    /**
     * 获取指定摄像头功能类型下的视频数量。
     *
     * @param cameraFunType 摄像头功能类型,用于筛选视频。
     * @return 返回一个包含视频数量的Map对象,其中key为统计指标,value为对应功能类型下的统计数量。
     */
    Map<String, String> getVideoCount(String cameraFunType);
    Map<String, String> recoveryException();
}
ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java
@@ -8,6 +8,7 @@
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 * 设备资产Service业务层处理
@@ -92,4 +93,14 @@
    {
        return tMonitorMapper.deleteTMonitorById(id);
    }
    @Override
    public Map<String, String> getVideoCount(String cameraFunType) {
        return tMonitorMapper.getVideoCount(cameraFunType);
    }
    @Override
    public Map<String, String> recoveryException() {
        return tMonitorMapper.recoveryException();
    }
}
ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
@@ -225,4 +225,28 @@
            #{id}
        </foreach>
    </delete>
    <select id="getVideoCount" resultType="java.util.Map">
        SELECT count(*)                                                          AS totalPosts,
               IFNULL(SUM(IF(on_state = 1, 1, 0)), 0)                            AS totalMembers,
               IFNULL(SUM(IF(on_state = 2, 1, 0)), 0)                            AS postsPercentage,
               IFNULL(SUM(IF(default_order = 1, 1, 0)), 0)                       AS totalViews,
               -1                                                                as noStore,
               -1                                                                as partStore,
               IFNULL(ROUND(SUM(IF(on_state = 1, 1, 0)) / count(*) * 100, 2), 0) as viewsPercentage,
               -1                                                                as totalFace,
               -1                                                                as totalCar
        FROM t_monitor
        WHERE camera_fun_type like concat('%', #{cameraFunType}, '%')
    </select>
    <select id="recoveryException" resultType="java.util.Map">
        SELECT count(*)                                                          AS totalPosts,
               IFNULL(SUM(IF(on_state = 1, 1, 0)), 0)                            AS totalMembers,
               IFNULL(SUM(IF(on_state = 2, 1, 0)), 0)                            AS postsPercentage,
               IFNULL(SUM(IF(default_order = 1, 1, 0)), 0)                       AS totalViews,
               IFNULL(ROUND(SUM(IF(on_state = 1, 1, 0)) / count(*) * 100, 2), 0) as viewsPercentage
        FROM t_monitor
        WHERE recovery = 1
    </select>
</mapper>