Browse Source

机构大屏需求变更

suntianwu 3 years ago
parent
commit
5f81f09898

+ 122 - 54
src/main/java/com/care/bigscreen/controller/BigScreenController.java

@@ -32,7 +32,7 @@ public class BigScreenController {
     @Autowired
     private BigScreenService bigScreenService;
 
-
+    /////////////////////////////////////////////////////////运营商大屏////////////////////////////////////////////////////
     /**
      * 运营商大屏统计查询
      */
@@ -41,16 +41,83 @@ public class BigScreenController {
     @ApiImplicitParams({
             @ApiImplicitParam(paramType = "header", required = true, name = "token", dataType = "String", value = "token验证信息")
     })
-    public Result<BigScreenStatisticsVO> selectBigScreenStatisticsByOp(@RequestHeader("token") String token) {
+    public Result<OpBigScreenStatisticsVO> selectBigScreenStatisticsByOp(@RequestHeader("token") String token) {
         try {
-            BigScreenStatisticsVO bigScreenStatisticsVO =  bigScreenService.selectBigScreenStatistics(null,null);
-            return Result.success(bigScreenStatisticsVO);
+            OpBigScreenStatisticsVO opBigScreenStatisticsVO =  bigScreenService.selectBigScreenStatisticsByOp(null);
+            return Result.success(opBigScreenStatisticsVO);
         } catch (Exception e) {
            log.error("运营商大屏统计查询出现异常",e);
             return Result.error("系统错误,运营商大屏统计查询失败");
         }
     }
 
+
+    /**
+     * 运营商大屏的站点统计查询
+     */
+    @ApiOperation(value = "运营商大屏的站点统计查询", notes = "运营商大屏的站点统计查询")
+    @GetMapping("/selectOpBigScreenStatisticsByStation")
+    @ApiImplicitParams(
+            {
+                    @ApiImplicitParam(paramType = "header", required = true, name = "token", dataType = "String", value = "token验证信息"),
+                    @ApiImplicitParam(name = "stationId", value = "站点ID", dataTypeClass = Long.class,required = true)
+            }
+    )
+    public Result<OpBigScreenStatisticsVO> selectOpBigScreenStatisticsByStation(@RequestHeader("token") String token, Long stationId) {
+        try {
+            OpBigScreenStatisticsVO opBigScreenStatisticsVO =  bigScreenService.selectBigScreenStatisticsByOp(stationId);
+            return Result.success(opBigScreenStatisticsVO);
+        } catch (Exception e) {
+            log.error("运营商大屏的站点统计查询出现异常",e);
+            return Result.error("系统错误,运营商大屏的站点统计查询失败");
+        }
+    }
+
+    /**
+     * 运营商大屏的根据经纬度查询统计值
+     */
+    @ApiOperation(value = "运营商大屏的根据经纬度查询统计值", notes = "运营商大屏的根据经纬度查询统计值")
+    @GetMapping("/selectOpBigScreenStatisticsByLongitudeLatitude")
+    @ApiImplicitParams(
+            {
+                    @ApiImplicitParam(paramType = "header", required = true, name = "token", dataType = "String", value = "token验证信息"),
+                    @ApiImplicitParam(name = "longitudeLeftUp", value = "左上经度", dataTypeClass = String.class,required = true),
+                    @ApiImplicitParam(name = "latitudeLeftUp", value = "左上维度", dataTypeClass = String.class,required = true),
+                    @ApiImplicitParam(name = "longitudeRightDown", value = "右下经度", dataTypeClass = String.class,required = true),
+                    @ApiImplicitParam(name = "latitudeRightDown", value = "右下维度", dataTypeClass = String.class,required = true)
+            }
+    )
+    public Result<OpBigScreenStatisticsVO> selectOpBigScreenStatisticsByLongitudeLatitude(@RequestHeader("token") String token, String longitudeLeftUp, String latitudeLeftUp, String longitudeRightDown, String latitudeRightDown) {
+        try {
+            OpBigScreenStatisticsVO opBigScreenStatisticsVO =  bigScreenService.selectOpBigScreenStatisticsByLongitudeLatitude(longitudeLeftUp,latitudeLeftUp,longitudeRightDown,latitudeRightDown);
+            return Result.success(opBigScreenStatisticsVO);
+        } catch (Exception e) {
+            log.error("运营商大屏或机构大屏的根据经纬度查询统计值出现异常",e);
+            return Result.error("系统错误,运营商大屏或机构大屏的根据经纬度查询统计值失败");
+        }
+    }
+
+    /**
+     * 运营商大屏的站点列表查询
+     */
+    @ApiOperation(value = "运营商大屏的站点列表查询", notes = "运营商大屏的站点列表查询")
+    @GetMapping("/selectOpBigScreenStationList")
+    @ApiImplicitParams(
+            {
+                    @ApiImplicitParam(paramType = "header", required = true, name = "token", dataType = "String", value = "token验证信息")
+            }
+    )
+    public Result<List<BigScreenStationVO>> selectOpBigScreenStationList(@RequestHeader("token") String token) {
+        try {
+            List<BigScreenStationVO> bigScreenStationVOList =  bigScreenService.selectBigScreenStationList(null);
+            return Result.success(bigScreenStationVOList);
+        } catch (Exception e) {
+            log.error("运营商大屏的站点列表查询出现异常",e);
+            return Result.error("系统错误,运营商大屏的站点列表查询失败");
+        }
+    }
+
+    /////////////////////////////////////////////////////////机构大屏////////////////////////////////////////////////////
     /**
      * 机构大屏统计查询
      */
@@ -62,31 +129,30 @@ public class BigScreenController {
                     @ApiImplicitParam(name = "orgId", value = "机构ID", dataTypeClass = Long.class,required = true)
             }
     )
-    public Result<BigScreenStatisticsVO> selectBigScreenStatisticsByOrg(@RequestHeader("token") String token,Long orgId) {
+    public Result<OrgBigScreenStatisticsVO> selectBigScreenStatisticsByOrg(@RequestHeader("token") String token, Long orgId) {
         try {
-            BigScreenStatisticsVO bigScreenStatisticsVO =  bigScreenService.selectBigScreenStatistics(null,orgId);
-            return Result.success(bigScreenStatisticsVO);
+            OrgBigScreenStatisticsVO orgBigScreenStatisticsVO =  bigScreenService.selectBigScreenStatisticsByOrg(null,orgId);
+            return Result.success(orgBigScreenStatisticsVO);
         } catch (Exception e) {
             log.error("机构大屏统计查询异常",e);
             return Result.error("系统错误,机构大屏统计查询失败");
         }
     }
-
     /**
-     * 运营商大屏或机构大屏的站点统计查询
+     * 机构大屏的站点统计查询
      */
-    @ApiOperation(value = "运营商大屏或机构大屏的站点统计查询", notes = "运营商大屏或机构大屏的站点统计查询")
-    @GetMapping("/selectBigScreenStatisticsByStation")
+    @ApiOperation(value = "机构大屏的站点统计查询", notes = "机构大屏的站点统计查询")
+    @GetMapping("/selectOrgBigScreenStatisticsByStation")
     @ApiImplicitParams(
             {
                     @ApiImplicitParam(paramType = "header", required = true, name = "token", dataType = "String", value = "token验证信息"),
                     @ApiImplicitParam(name = "stationId", value = "站点ID", dataTypeClass = Long.class,required = true)
             }
     )
-    public Result<BigScreenStatisticsVO> selectBigScreenStatisticsByStation(@RequestHeader("token") String token,Long stationId) {
+    public Result<OrgBigScreenStatisticsVO> selectOrgBigScreenStatisticsByStation(@RequestHeader("token") String token, Long stationId) {
         try {
-            BigScreenStatisticsVO bigScreenStatisticsVO =  bigScreenService.selectBigScreenStatistics(stationId,null);
-            return Result.success(bigScreenStatisticsVO);
+            OrgBigScreenStatisticsVO orgBigScreenStatisticsVO =  bigScreenService.selectBigScreenStatisticsByOrg(stationId,null);
+            return Result.success(orgBigScreenStatisticsVO);
         } catch (Exception e) {
             log.error("运营商大屏或机构大屏的站点统计查询出现异常",e);
             return Result.error("系统错误,运营商大屏或机构大屏的站点统计查询失败");
@@ -94,10 +160,10 @@ public class BigScreenController {
     }
 
     /**
-     * 运营商大屏或机构大屏的根据经纬度查询统计值
+     * 机构大屏的根据经纬度查询统计值
      */
-    @ApiOperation(value = "运营商大屏或机构大屏的根据经纬度查询统计值", notes = "运营商大屏或机构大屏的根据经纬度查询统计值")
-    @GetMapping("/selectBigScreenStatisticsByLongitudeLatitude")
+    @ApiOperation(value = "机构大屏的根据经纬度查询统计值", notes = "机构大屏的根据经纬度查询统计值")
+    @GetMapping("/selectOrgBigScreenStatisticsByLongitudeLatitude")
     @ApiImplicitParams(
             {
                     @ApiImplicitParam(paramType = "header", required = true, name = "token", dataType = "String", value = "token验证信息"),
@@ -105,82 +171,84 @@ public class BigScreenController {
                     @ApiImplicitParam(name = "latitudeLeftUp", value = "左上维度", dataTypeClass = String.class,required = true),
                     @ApiImplicitParam(name = "longitudeRightDown", value = "右下经度", dataTypeClass = String.class,required = true),
                     @ApiImplicitParam(name = "latitudeRightDown", value = "右下维度", dataTypeClass = String.class,required = true),
-                    @ApiImplicitParam(name = "orgId", value = "机构ID", dataTypeClass = Long.class,required = false)
+                    @ApiImplicitParam(name = "orgId", value = "机构ID", dataTypeClass = Long.class,required = true)
             }
     )
-    public Result<BigScreenStatisticsVO> selectBigScreenStatisticsByLongitudeLatitude(@RequestHeader("token") String token,String longitudeLeftUp, String latitudeLeftUp,String longitudeRightDown,String latitudeRightDown,Long orgId) {
+    public Result<OrgBigScreenStatisticsVO> selectOrgBigScreenStatisticsByLongitudeLatitude(@RequestHeader("token") String token, String longitudeLeftUp, String latitudeLeftUp, String longitudeRightDown, String latitudeRightDown, Long orgId) {
         try {
-            BigScreenStatisticsVO bigScreenStatisticsVO =  bigScreenService.selectBigScreenStatisticsByLongitudeLatitude(longitudeLeftUp,latitudeLeftUp,longitudeRightDown,latitudeRightDown,orgId);
-            return Result.success(bigScreenStatisticsVO);
+            OrgBigScreenStatisticsVO orgBigScreenStatisticsVO =  bigScreenService.selectOrgBigScreenStatisticsByLongitudeLatitude(longitudeLeftUp,latitudeLeftUp,longitudeRightDown,latitudeRightDown,orgId);
+            return Result.success(orgBigScreenStatisticsVO);
         } catch (Exception e) {
-            log.error("运营商大屏或机构大屏的根据经纬度查询统计值出现异常",e);
-            return Result.error("系统错误,运营商大屏或机构大屏的根据经纬度查询统计值失败");
+            log.error("机构大屏的根据经纬度查询统计值出现异常",e);
+            return Result.error("系统错误,机构大屏的根据经纬度查询统计值失败");
         }
     }
-
     /**
-     * 运营商大屏或机构大屏的站点列表查询
+     * 机构大屏的站点列表查询
      */
-    @ApiOperation(value = "运营商大屏或机构大屏的站点列表查询", notes = "运营商大屏或机构大屏的站点列表查询")
-    @GetMapping("/selectBigScreenStationList")
+    @ApiOperation(value = "机构大屏的站点列表查询", notes = "机构大屏的站点列表查询")
+    @GetMapping("/selectOrgBigScreenStationList")
     @ApiImplicitParams(
             {
                     @ApiImplicitParam(paramType = "header", required = true, name = "token", dataType = "String", value = "token验证信息"),
-                    @ApiImplicitParam(name = "orgId", value = "机构ID", dataTypeClass = Long.class,required = false)
+                    @ApiImplicitParam(name = "orgId", value = "机构ID", dataTypeClass = Long.class,required = true)
             }
     )
-    public Result<List<BigScreenStationVO>> selectBigScreenStationList(@RequestHeader("token") String token,Long orgId) {
+    public Result<List<BigScreenStationVO>> selectOrgBigScreenStationList(@RequestHeader("token") String token,Long orgId) {
         try {
             List<BigScreenStationVO> bigScreenStationVOList =  bigScreenService.selectBigScreenStationList(orgId);
             return Result.success(bigScreenStationVOList);
         } catch (Exception e) {
-            log.error("运营商大屏或机构大屏的站点列表查询出现异常",e);
-            return Result.error("系统错误,运营商大屏或机构大屏的站点列表查询失败");
+            log.error("机构大屏的站点列表查询出现异常",e);
+            return Result.error("系统错误,机构大屏的站点列表查询失败");
         }
     }
 
     /**
-     * 机构大屏的站点列表用户数TOP5查询
+     * 机构大屏的进行中的安全事件列表查询
      */
-    @ApiOperation(value = "机构大屏的站点列表用户数TOP5查询", notes = "机构大屏的站点列表用户数TOP5查询")
-    @GetMapping("/selectBigScreenStationListOlderTop5")
+    @ApiOperation(value = "机构大屏的进行中的安全事件列表查询", notes = "机构大屏的进行中的安全事件列表查询")
+    @GetMapping("/selectOrgBigScreenRtEventList")
     @ApiImplicitParams(
             {
                     @ApiImplicitParam(paramType = "header", required = true, name = "token", dataType = "String", value = "token验证信息"),
                     @ApiImplicitParam(name = "orgId", value = "机构ID", dataTypeClass = Long.class,required = true)
             }
     )
-    public Result<List<BigScreenStationVO>> selectBigScreenStationListOlderTop5(@RequestHeader("token") String token,Long orgId) {
+    public Result<List<BigScreenEventVO>> selectOrgBigScreenRtEventList(@RequestHeader("token") String token,Long orgId) {
         try {
-            List<BigScreenStationVO> bigScreenStationVOList =  bigScreenService.selectBigScreenStationListOlderTop5(orgId);
-            return Result.success(bigScreenStationVOList);
+            List<BigScreenEventVO> bigScreenEventVOList =  bigScreenService.selectBigScreenRtEventList(orgId,null);
+            return Result.success(bigScreenEventVOList);
         } catch (Exception e) {
-            log.error("机构大屏的站点列表用户数TOP5查询出现异常",e);
-            return Result.error("系统错误,机构大屏的站点列表用户数TOP5查询失败");
+            log.error("机构大屏的进行中的安全事件列表查询出现异常",e);
+            return Result.error("系统错误,机构大屏的进行中的安全事件列表查询失败");
         }
     }
 
     /**
-     * 机构大屏的站点列表安全事件TOP5查询
+     * 机构大屏的设备列表查询
      */
-    @ApiOperation(value = "机构大屏的站点列表安全事件TOP5查询", notes = "机构大屏的站点列表安全事件TOP5查询")
-    @GetMapping("/selectBigScreenStationListEventTop5")
+    @ApiOperation(value = "机构大屏的设备列表查询", notes = "机构大屏的设备列表查询")
+    @GetMapping("/selectOrgBigScreenDeviceList")
     @ApiImplicitParams(
             {
                     @ApiImplicitParam(paramType = "header", required = true, name = "token", dataType = "String", value = "token验证信息"),
-                    @ApiImplicitParam(name = "orgId", value = "机构ID", dataTypeClass = Long.class,required = true)
+                    @ApiImplicitParam(name = "orgId", value = "机构ID", dataTypeClass = Long.class,required = true),
+                    @ApiImplicitParam(name = "stationId", value = "服务站ID", dataTypeClass = Long.class,required = false),
+                    @ApiImplicitParam(name = "status", value = "状态:1在线;2:离线", dataTypeClass = String.class,required = false)
             }
     )
-    public Result<List<BigScreenStationVO>> selectBigScreenStationListEventTop5(@RequestHeader("token") String token,Long orgId) {
+    public Result<List<BigScreenDeviceVO>> selectOrgBigScreenDeviceList(@RequestHeader("token") String token,Long orgId,Long stationId,String status) {
         try {
-            List<BigScreenStationVO> bigScreenStationVOList =  bigScreenService.selectBigScreenStationListEventTop5(orgId);
-            return Result.success(bigScreenStationVOList);
+            List<BigScreenDeviceVO> bigScreenDeviceVOList =  bigScreenService.selectOrgBigScreenDeviceList(orgId,stationId,status);
+            return Result.success(bigScreenDeviceVOList);
         } catch (Exception e) {
-            log.error("机构大屏的站点列表安全事件TOP5查询出现异常",e);
-            return Result.error("系统错误,机构大屏的站点列表安全事件TOP5查询失败");
+            log.error("机构大屏的设备列表查询出现异常",e);
+            return Result.error("系统错误,机构大屏的设备列表查询失败");
         }
     }
 
+    /////////////////////////////////////////////////////////服务站大屏////////////////////////////////////////////////////
     /**
      * 服务站大屏的站点统计查询
      */
@@ -192,10 +260,10 @@ public class BigScreenController {
                     @ApiImplicitParam(name = "stationId", value = "站点ID", dataTypeClass = Long.class,required = true)
             }
     )
-    public Result<BigScreenStationStatisticsVO> selectStationBigScreenStatisticsByStation(@RequestHeader("token") String token,Long stationId) {
+    public Result<StationBigScreenStatisticsVO> selectStationBigScreenStatisticsByStation(@RequestHeader("token") String token, Long stationId) {
         try {
-            BigScreenStationStatisticsVO bigScreenStationStatisticsVO =  bigScreenService.selectStationBigScreenStatisticsByStation(stationId);
-            return Result.success(bigScreenStationStatisticsVO);
+            StationBigScreenStatisticsVO stationBigScreenStatisticsVO =  bigScreenService.selectStationBigScreenStatisticsByStation(stationId);
+            return Result.success(stationBigScreenStatisticsVO);
         } catch (Exception e) {
             log.error("服务站大屏的站点统计查询出现异常",e);
             return Result.error("系统错误,服务站大屏的站点统计查询失败");
@@ -281,11 +349,11 @@ public class BigScreenController {
     )
     public Result<List<BigScreenEventVO>> selectBigScreenRtEventList(@RequestHeader("token") String token,Long stationId) {
         try {
-            List<BigScreenEventVO> bigScreenEventVOList =  bigScreenService.selectBigScreenRtEventList(stationId);
+            List<BigScreenEventVO> bigScreenEventVOList =  bigScreenService.selectBigScreenRtEventList(null,stationId);
             return Result.success(bigScreenEventVOList);
         } catch (Exception e) {
-            log.error("告警用户列表查询出现异常",e);
-            return Result.error("系统错误,告警用户列表查询失败");
+            log.error("服务站大屏的实时安全事件列表查询出现异常",e);
+            return Result.error("系统错误,服务站大屏的实时安全事件列表查询失败");
         }
     }
 

+ 27 - 17
src/main/java/com/care/bigscreen/mapper/BigSreenMapper.java

@@ -17,44 +17,49 @@ import java.util.List;
  */
 public interface BigSreenMapper extends BaseMapper<StStation> {
 
+    /**
+     * 运营商大屏统计查询
+     * @return 搜索符合条件的大屏统计数据
+     */
+    OpBigScreenStatisticsVO selectBigScreenStatisticsByOp(@Param("stationId") Long stationId);
 
     /**
-     * 大屏统计查询
+     * 运营商大屏统计查询
+     * @return 根据经纬度范围搜索符合条件的大屏统计数据
+     */
+    OpBigScreenStatisticsVO selectOpBigScreenStatisticsByLongitudeLatitude(@Param("longitudeLeftUp") String longitudeLeftUp, @Param("latitudeLeftUp") String latitudeLeftUp, @Param("longitudeRightDown") String longitudeRightDown, @Param("latitudeRightDown")String latitudeRightDown);
+
+
+
+    /**
+     * 机构大屏统计查询
      * @return 搜索符合条件的大屏统计数据
      */
-    BigScreenStatisticsVO selectBigScreenStatistics(@Param("stationId") Long stationId, @Param("orgId") Long orgId);
+    OrgBigScreenStatisticsVO selectBigScreenStatisticsByOrg(@Param("stationId") Long stationId, @Param("orgId") Long orgId);
+
+
     /**
      * 大屏统计查询(机构汇总表查询)
      * @return 搜索符合条件的大屏统计数据
      */
-    BigScreenStatisticsVO selectBigScreenOrgStatistics(@Param("orgId") Long orgId);
+    BigScreenOrgVO selectBigScreenOrgStatistics(@Param("orgId") Long orgId);
 
     /**
      * 大屏统计查询
      * @return 根据经纬度范围搜索符合条件的大屏统计数据
      */
-    BigScreenStatisticsVO selectBigScreenStatisticsByLongitudeLatitude(@Param("longitudeLeftUp") String longitudeLeftUp,@Param("latitudeLeftUp") String latitudeLeftUp,@Param("longitudeRightDown") String longitudeRightDown,@Param("latitudeRightDown")String latitudeRightDown,@Param("orgId") Long orgId);
+    OrgBigScreenStatisticsVO selectOrgBigScreenStatisticsByLongitudeLatitude(@Param("longitudeLeftUp") String longitudeLeftUp, @Param("latitudeLeftUp") String latitudeLeftUp, @Param("longitudeRightDown") String longitudeRightDown, @Param("latitudeRightDown")String latitudeRightDown, @Param("orgId") Long orgId);
 
     /**
      * 站点列表查询
      */
     List<BigScreenStationVO> selectBigScreenStationList(@Param("orgId") Long orgId);
 
-    /**
-     * 站点列表用户数TOP5查询
-     */
-    List<BigScreenStationVO> selectBigScreenStationListOlderTop5(@Param("orgId") Long orgId);
-
-    /**
-     * 站点列表安全事件数TOP5查询
-     */
-    List<BigScreenStationVO> selectBigScreenStationListEventTop5(@Param("orgId") Long orgId);
-
     /**
      * 服务站大屏的站点统计查询
      * @return 搜索符合条件的大屏统计数据
      */
-    BigScreenStationStatisticsVO selectStationBigScreenStatisticsByStation(@Param("stationId") Long stationId);
+    StationBigScreenStatisticsVO selectStationBigScreenStatisticsByStation(@Param("stationId") Long stationId);
 
     /**
      * 告警用户列表查询
@@ -72,9 +77,14 @@ public interface BigSreenMapper extends BaseMapper<StStation> {
     BigScreenEventTotalVO selectStationBigScreenEventTotal(@Param("stationId") Long stationId);
 
     /**
-     * 服务站大屏的实时安全事件列表查询
+     * 机构大屏或服务站大屏的实时安全事件列表查询
+     */
+    List<BigScreenEventVO> selectBigScreenRtEventList(@Param("orgId") Long orgId, @Param("stationId") Long stationId);
+
+    /**
+     * 机构大屏的设备列表查询
      */
-    List<BigScreenEventVO> selectBigScreenRtEventList(@Param("stationId") Long stationId);
+    List<BigScreenDeviceVO> selectOrgBigScreenDeviceList(@Param("orgId") Long orgId, @Param("stationId") Long stationId, @Param("status") String status);
 
     /**
      * 服务站大屏的已完成安全事件总记录数

+ 21 - 14
src/main/java/com/care/bigscreen/service/BigScreenService.java

@@ -14,40 +14,42 @@ import java.util.List;
  * @date 2021/05/20/19:41
  */
 public interface BigScreenService {
-
     /**
-     * 大屏统计查询
+     * 运营商大屏统计查询
      * @return 搜索符合条件的大屏统计数据
      */
-    BigScreenStatisticsVO selectBigScreenStatistics(Long stationId, Long orgId);
+    OpBigScreenStatisticsVO selectBigScreenStatisticsByOp(Long stationId);
 
     /**
-     * 大屏统计查询
+     * 运营商大屏根据经纬度统计查询
      * @return 根据经纬度范围搜索符合条件的大屏统计数据
      */
-    BigScreenStatisticsVO selectBigScreenStatisticsByLongitudeLatitude(String longitudeLeftUp,String latitudeLeftUp,String longitudeRightDown,String latitudeRightDown,Long orgId);
+    OpBigScreenStatisticsVO selectOpBigScreenStatisticsByLongitudeLatitude(String longitudeLeftUp, String latitudeLeftUp, String longitudeRightDown, String latitudeRightDown);
 
     /**
-     * 站点列表查询
+     * 机构大屏统计查询
+     * @return 搜索符合条件的大屏统计数据
      */
-    List<BigScreenStationVO> selectBigScreenStationList(Long orgId);
+    OrgBigScreenStatisticsVO selectBigScreenStatisticsByOrg(Long stationId, Long orgId);
+
 
     /**
-     * 站点列表用户数TOP5查询
+     * 运营商大屏根据经纬度统计查询
+     * @return 根据经纬度范围搜索符合条件的大屏统计数据
      */
-    List<BigScreenStationVO> selectBigScreenStationListOlderTop5(Long orgId);
+    OrgBigScreenStatisticsVO selectOrgBigScreenStatisticsByLongitudeLatitude(String longitudeLeftUp, String latitudeLeftUp, String longitudeRightDown, String latitudeRightDown, Long orgId);
 
     /**
-     * 站点列表安全事件数TOP5查询
+     * 站点列表查询
      */
-    List<BigScreenStationVO> selectBigScreenStationListEventTop5(Long orgId);
+    List<BigScreenStationVO> selectBigScreenStationList(Long orgId);
 
 
     /**
      * 服务站大屏的站点统计查询
      * @return 搜索符合条件的大屏统计数据
      */
-    BigScreenStationStatisticsVO selectStationBigScreenStatisticsByStation(Long stationId);
+    StationBigScreenStatisticsVO selectStationBigScreenStatisticsByStation(Long stationId);
 
     /**
      * 告警用户列表查询
@@ -65,9 +67,14 @@ public interface BigScreenService {
     BigScreenEventTotalVO selectStationBigScreenEventTotal(Long stationId);
 
     /**
-     * 服务站大屏的实时安全事件列表查询
+     * 机构大屏或服务站大屏的实时安全事件列表查询
+     */
+    List<BigScreenEventVO> selectBigScreenRtEventList(Long orgId, Long stationId);
+
+    /**
+     * 机构大屏的设备列表查询
      */
-    List<BigScreenEventVO> selectBigScreenRtEventList(Long stationId);
+    List<BigScreenDeviceVO> selectOrgBigScreenDeviceList(Long orgId, Long stationId,String status);
 
     /**
      * 服务站大屏的已完成安全事件列表分页查询

+ 47 - 28
src/main/java/com/care/bigscreen/service/impl/BigScreenServiceImpl.java

@@ -46,57 +46,68 @@ public class BigScreenServiceImpl implements BigScreenService {
     private StOrganizationMapper stOrganizationMapper;
 
     /**
-     * 大屏统计查询
+     * 运营商大屏统计查询
      * @return 搜索符合条件的大屏统计数据
      */
     @Override
-    public BigScreenStatisticsVO selectBigScreenStatistics(Long stationId, Long orgId){
-        BigScreenStatisticsVO bigScreenStatisticsVO =  bigSreenMapper.selectBigScreenStatistics(stationId,orgId);
-        BigScreenStatisticsVO bigScreenStatisticsVO2 = null;
-        if(stationId == null && orgId == null){ //运营商大屏
-            bigScreenStatisticsVO2 =  bigSreenMapper.selectBigScreenOrgStatistics(null);
-        } else if(stationId == null && orgId != null) { //机构大屏
-            bigScreenStatisticsVO2 =  bigSreenMapper.selectBigScreenOrgStatistics(orgId);
+    public OpBigScreenStatisticsVO selectBigScreenStatisticsByOp(Long stationId){
+        OpBigScreenStatisticsVO opBigScreenStatisticsVO =  bigSreenMapper.selectBigScreenStatisticsByOp(stationId);
+        BigScreenOrgVO bigScreenOrgVO = null;
+        if(stationId == null){ //运营商大屏
+            bigScreenOrgVO =  bigSreenMapper.selectBigScreenOrgStatistics(null);
         } else { //站点查询
-            bigScreenStatisticsVO2 =  bigSreenMapper.selectBigScreenOrgStatistics(careStationService.getById(stationId).getOrgId());
+            bigScreenOrgVO =  bigSreenMapper.selectBigScreenOrgStatistics(careStationService.getById(stationId).getOrgId());
         }
 
-        bigScreenStatisticsVO.setSeatsAmount(bigScreenStatisticsVO2.getSeatsAmount());
-        bigScreenStatisticsVO.setSeatsOnlineDuration(bigScreenStatisticsVO2.getSeatsOnlineDuration());
-        return bigScreenStatisticsVO;
+        opBigScreenStatisticsVO.setSeatsAmount(bigScreenOrgVO.getSeatsAmount());
+        opBigScreenStatisticsVO.setSeatsOnlineDuration(bigScreenOrgVO.getSeatsOnlineDuration());
+        return opBigScreenStatisticsVO;
     }
 
+
     /**
-     * 大屏统计查询
+     * 运营商大屏统计查询
      * @return 根据经纬度范围搜索符合条件的大屏统计数据
      */
     @Override
-    public BigScreenStatisticsVO selectBigScreenStatisticsByLongitudeLatitude(String longitudeLeftUp,String latitudeLeftUp,String longitudeRightDown,String latitudeRightDown,Long orgId) {
-        return bigSreenMapper.selectBigScreenStatisticsByLongitudeLatitude(longitudeLeftUp,latitudeLeftUp,longitudeRightDown,latitudeRightDown,orgId);
+    public OpBigScreenStatisticsVO selectOpBigScreenStatisticsByLongitudeLatitude(String longitudeLeftUp, String latitudeLeftUp, String longitudeRightDown, String latitudeRightDown) {
+        return bigSreenMapper.selectOpBigScreenStatisticsByLongitudeLatitude(longitudeLeftUp,latitudeLeftUp,longitudeRightDown,latitudeRightDown);
     }
 
     /**
-     * 站点列表查询
+     * 机构大屏统计查询
+     * @return 搜索符合条件的大屏统计数据
      */
     @Override
-    public List<BigScreenStationVO> selectBigScreenStationList(Long orgId) {
-        return bigSreenMapper.selectBigScreenStationList(orgId);
+    public OrgBigScreenStatisticsVO selectBigScreenStatisticsByOrg(Long stationId, Long orgId){
+        OrgBigScreenStatisticsVO orgBigScreenStatisticsVO =  bigSreenMapper.selectBigScreenStatisticsByOrg(stationId,orgId);
+        BigScreenOrgVO bigScreenOrgVO = null;
+        if(stationId == null){ //机构大屏
+            bigScreenOrgVO =  bigSreenMapper.selectBigScreenOrgStatistics(orgId);
+        } else { //站点查询
+            bigScreenOrgVO =  bigSreenMapper.selectBigScreenOrgStatistics(careStationService.getById(stationId).getOrgId());
+        }
+
+        orgBigScreenStatisticsVO.setStationAmount(bigScreenOrgVO.getStationAmount());
+
+        return orgBigScreenStatisticsVO;
     }
 
     /**
-     * 站点列表用户数TOP5查询
+     * 机构大屏统计查询
+     * @return 根据经纬度范围搜索符合条件的大屏统计数据
      */
     @Override
-    public List<BigScreenStationVO> selectBigScreenStationListOlderTop5(Long orgId){
-        return bigSreenMapper.selectBigScreenStationListOlderTop5(orgId);
+    public OrgBigScreenStatisticsVO selectOrgBigScreenStatisticsByLongitudeLatitude(String longitudeLeftUp, String latitudeLeftUp, String longitudeRightDown, String latitudeRightDown, Long orgId) {
+        return bigSreenMapper.selectOrgBigScreenStatisticsByLongitudeLatitude(longitudeLeftUp,latitudeLeftUp,longitudeRightDown,latitudeRightDown,orgId);
     }
 
     /**
-     * 站点列表安全事件数TOP5查询
+     * 站点列表查询
      */
     @Override
-    public List<BigScreenStationVO> selectBigScreenStationListEventTop5(Long orgId){
-        return bigSreenMapper.selectBigScreenStationListEventTop5(orgId);
+    public List<BigScreenStationVO> selectBigScreenStationList(Long orgId) {
+        return bigSreenMapper.selectBigScreenStationList(orgId);
     }
 
     /**
@@ -104,7 +115,7 @@ public class BigScreenServiceImpl implements BigScreenService {
      * @return 搜索符合条件的大屏统计数据
      */
     @Override
-    public BigScreenStationStatisticsVO selectStationBigScreenStatisticsByStation(Long stationId){
+    public StationBigScreenStatisticsVO selectStationBigScreenStatisticsByStation(Long stationId){
         return bigSreenMapper.selectStationBigScreenStatisticsByStation(stationId);
     }
 
@@ -135,11 +146,19 @@ public class BigScreenServiceImpl implements BigScreenService {
     }
 
     /**
-     * 服务站大屏的实时安全事件列表查询
+     * 机构大屏或服务站大屏的实时安全事件列表查询
+     */
+    @Override
+    public List<BigScreenEventVO> selectBigScreenRtEventList(Long orgId ,Long stationId) {
+        return bigSreenMapper.selectBigScreenRtEventList(orgId, stationId);
+    }
+
+    /**
+     * 机构大屏的设备列表查询
      */
     @Override
-    public List<BigScreenEventVO> selectBigScreenRtEventList(Long stationId) {
-        return bigSreenMapper.selectBigScreenRtEventList(stationId);
+    public List<BigScreenDeviceVO> selectOrgBigScreenDeviceList(Long orgId, Long stationId,String status) {
+        return bigSreenMapper.selectOrgBigScreenDeviceList(orgId, stationId,status);
     }
 
     /**

+ 36 - 0
src/main/java/com/care/bigscreen/vo/BigScreenDeviceVO.java

@@ -0,0 +1,36 @@
+package com.care.bigscreen.vo;
+
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+
+/**
+ * 大屏设备响应类
+ *
+ * @author stw
+ * @since 2021-05-20
+ */
+@Data
+@ApiModel(value = "大屏设备响应类", description = "大屏设备响应类")
+public class BigScreenDeviceVO {
+
+
+    @ApiModelProperty(value = "设备名称")
+    private String deviceName;
+
+    @ApiModelProperty(value = "经度")
+    private BigDecimal longitude;
+
+    @ApiModelProperty(value = "纬度")
+    private BigDecimal latitude;
+
+    @ApiModelProperty(value = "状态:1在线;2:离线")
+    private Integer status;
+
+    @ApiModelProperty(value = "地址")
+    private String deviceAddr;
+}

+ 36 - 0
src/main/java/com/care/bigscreen/vo/BigScreenOrgVO.java

@@ -0,0 +1,36 @@
+package com.care.bigscreen.vo;
+
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+
+/**
+ * 大屏机构响应类
+ *
+ * @author stw
+ * @since 2021-05-20
+ */
+@Data
+@ApiModel(value = "大屏机构响应类", description = "大屏机构响应类")
+public class BigScreenOrgVO {
+
+
+    @ApiModelProperty(value = "服务站总数")
+    private Long stationAmount;
+
+    @ApiModelProperty(value = "坐席总人数")
+    private Long seatsAmount;
+
+    @ApiModelProperty(value = "坐席总在线时长(小时)")
+    private BigDecimal seatsOnlineDuration;
+
+    @ApiModelProperty(value = "坐席当前在线人数")
+    private Long seatsCurrOnlineAmount;
+
+    @ApiModelProperty(value = "坐席累计接打分钟数")
+    private BigDecimal seatsCallMinAmount;
+}

+ 6 - 0
src/main/java/com/care/bigscreen/vo/BigScreenStationVO.java

@@ -47,4 +47,10 @@ public class BigScreenStationVO {
 
     @ApiModelProperty(value = "安全事件数")
     private Long eventAmount;
+
+    @ApiModelProperty(value = "管家人数")
+    private Long chamberlainAmount;
+
+    @ApiModelProperty(value = "设备数量")
+    private Long deviceAmount;
 }

+ 3 - 3
src/main/java/com/care/bigscreen/vo/BigScreenStatisticsVO.java

@@ -9,14 +9,14 @@ import java.math.BigDecimal;
 
 
 /**
- * 大屏统计响应类
+ * 运营商大屏统计响应类
  *
  * @author stw
  * @since 2021-05-20
  */
 @Data
-@ApiModel(value = "大屏统计响应类", description = "大屏统计响应类")
-public class BigScreenStatisticsVO {
+@ApiModel(value = "运营商大屏统计响应类", description = "运营商大屏统计响应类")
+public class OpBigScreenStatisticsVO {
 
     @ApiModelProperty(value = "用户数")
     private Long olderAmount;

+ 76 - 0
src/main/java/com/care/bigscreen/vo/OrgBigScreenStatisticsVO.java

@@ -0,0 +1,76 @@
+package com.care.bigscreen.vo;
+
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+
+/**
+ * 机构大屏统计响应类
+ *
+ * @author stw
+ * @since 2021-05-20
+ */
+@Data
+@ApiModel(value = "机构大屏统计响应类", description = "机构大屏统计响应类")
+public class OrgBigScreenStatisticsVO {
+
+
+    @ApiModelProperty(value = "安全管家总人数")
+    private Long chamberlainAmount;
+
+    @ApiModelProperty(value = "服务中人数")
+    private Long chamberlainInServiceAmount;
+
+    @ApiModelProperty(value = "累计服务总人次")
+    private Long serveAmount;
+
+    @ApiModelProperty(value = "服务站总数")
+    private Long stationAmount;
+
+    @ApiModelProperty(value = "设备总数")
+    private Long deviceAmount;
+
+    @ApiModelProperty(value = "设备在线总数")
+    private Long deviceOnlineAmount;
+
+    @ApiModelProperty(value = "设备离线总数")
+    private Long deviceOfflineAmount;
+
+    @ApiModelProperty(value = "实时安全事件数")
+    private Long rtEventAmount;
+
+    @ApiModelProperty(value = "跌倒事件数")
+    private Long fallAmount;
+
+    @ApiModelProperty(value = "跌倒事件数占比")
+    private BigDecimal fallRate;
+
+    @ApiModelProperty(value = "久滞事件数")
+    private Long stagnationAmount;
+
+    @ApiModelProperty(value = "久滞事件数占比")
+    private BigDecimal stagnationRate;
+
+    @ApiModelProperty(value = "坠床事件数")
+    private Long fallingBedAmount;
+
+    @ApiModelProperty(value = "坠床事件数占比")
+    private BigDecimal fallingBedRate;
+
+    @ApiModelProperty(value = "主动呼叫事件数")
+    private Long activeCallAmount;
+
+    @ApiModelProperty(value = "主动呼叫事件数占比")
+    private BigDecimal activeCallRate;
+
+    @ApiModelProperty(value = "户外呼叫事件数")
+    private Long outdoorsCallAmount;
+
+    @ApiModelProperty(value = "户外呼叫事件数占比")
+    private BigDecimal outdoorsCallRate;
+
+}

+ 1 - 1
src/main/java/com/care/bigscreen/vo/BigScreenStationStatisticsVO.java

@@ -16,7 +16,7 @@ import java.math.BigDecimal;
  */
 @Data
 @ApiModel(value = "站点大屏统计响应类", description = "站点大屏统计响应类")
-public class BigScreenStationStatisticsVO {
+public class StationBigScreenStatisticsVO {
     @ApiModelProperty(value = "站点ID")
     private Long stationId;
 

+ 78 - 32
src/main/resources/mybatis/BigSreenMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="com.care.bigscreen.mapper.BigSreenMapper">
 
     <!--查询-->
-    <select id="selectBigScreenStatistics" resultType="com.care.bigscreen.vo.BigScreenStatisticsVO">
+    <select id="selectBigScreenStatisticsByOp" resultType="com.care.bigscreen.vo.OpBigScreenStatisticsVO">
         SELECT
         sum(older_amount) olderAmount,
         sum(older_60_80_amount) older6080Amount,
@@ -49,14 +49,13 @@
             <if test="stationId != null and stationId != ''">
                 AND t.station_id = #{stationId}
             </if>
-            <if test="orgId != null and orgId != ''">
-                AND t.org_id = #{orgId}
-            </if>
         </where>
     </select>
 
-    <select id="selectBigScreenOrgStatistics" resultType="com.care.bigscreen.vo.BigScreenStatisticsVO">
+    <!--机构统计表查询-->
+    <select id="selectBigScreenOrgStatistics" resultType="com.care.bigscreen.vo.BigScreenOrgVO">
         SELECT
+        sum(station_amount) stationAmount,
         sum(seats_amount) seatsAmount,
         convert(sum(seats_online_duration)/3600,decimal(20,2)) seatsOnlineDuration
         FROM st_organization t
@@ -68,8 +67,8 @@
         </where>
     </select>
 
-    <!--根据经纬度查询-->
-    <select id="selectBigScreenStatisticsByLongitudeLatitude" resultType="com.care.bigscreen.vo.BigScreenStatisticsVO">
+    <!--运营商大屏根据经纬度查询-->
+    <select id="selectOpBigScreenStatisticsByLongitudeLatitude" resultType="com.care.bigscreen.vo.OpBigScreenStatisticsVO">
         SELECT
         sum(older_amount) olderAmount,
         sum(older_60_80_amount) older6080Amount,
@@ -80,9 +79,52 @@
         <where>
             t.longitude >= #{longitudeLeftUp} and t.longitude &lt;= #{longitudeRightDown}
             AND t.latitude &lt;= #{latitudeLeftUp} and t.longitude >= #{latitudeRightDown}
+        </where>
+    </select>
+
+    <!--机构大屏查询统计-->
+    <select id="selectBigScreenStatisticsByOrg" resultType="com.care.bigscreen.vo.OrgBigScreenStatisticsVO">
+        SELECT
+        sum(chamberlain_amount) chamberlainAmount,
+        sum(chamberlain_in_service_amount) chamberlainInServiceAmount,
+        sum(serve_amount) serveAmount,
+        sum(device_amount) deviceAmount,
+        sum(indoor_online_amount + outdoor_online_amount) deviceOnlineAmount,
+        sum(indoor_offline_amount + outdoor_offline_amount) deviceOfflineAmount,
+        sum(rt_event_amount) rtEventAmount,
+        sum(rt_fall_amount + his_fall_amount) fallAmount,
+        convert(sum(rt_fall_amount + his_fall_amount)/sum(rt_event_amount + his_event_amount),decimal(20,2)) fallRate,
+        sum(rt_stagnation_amount + his_stagnation_amount) stagnationAmount,
+        convert(sum(rt_stagnation_amount + his_stagnation_amount)/sum(rt_event_amount + his_event_amount),decimal(20,2)) stagnationRate,
+        sum(rt_falling_bed_amount + his_falling_bed_amount) fallingBedAmount,
+        convert(sum(rt_falling_bed_amount + his_falling_bed_amount)/sum(rt_event_amount + his_event_amount),decimal(20,2)) fallingBedRate,
+        sum(rt_active_call_amount + his_active_call_amount) activeCallAmount,
+        convert(sum(rt_active_call_amount + his_active_call_amount)/sum(rt_event_amount + his_event_amount),decimal(20,2)) activeCallRate,
+        sum(rt_outdoors_call_amount + his_outdoors_call_amount) outdoorsCallAmount,
+        convert(sum(rt_outdoors_call_amount + his_outdoors_call_amount)/sum(rt_event_amount + his_event_amount),decimal(20,2)) outdoorsCallRate
+        FROM st_station t
+        <where>
+            1 = 1
             <if test="orgId != null and orgId != ''">
                 AND t.org_id = #{orgId}
             </if>
+            <if test="stationId != null and stationId != ''">
+                AND t.station_id = #{stationId}
+            </if>
+        </where>
+    </select>
+
+    <!--机构大屏根据经纬度查询-->
+    <select id="selectOrgBigScreenStatisticsByLongitudeLatitude" resultType="com.care.bigscreen.vo.OrgBigScreenStatisticsVO">
+        SELECT
+        (select station_amount from st_organization where org_id = t.org_id) stationAmount,
+        sum(device_amount) deviceAmount,
+        sum(indoor_online_amount + outdoor_online_amount) deviceOnlineAmount
+        FROM st_station t
+        <where>
+            t.longitude >= #{longitudeLeftUp} and t.longitude &lt;= #{longitudeRightDown}
+            AND t.latitude &lt;= #{latitudeLeftUp} and t.longitude >= #{latitudeRightDown}
+            AND t.org_id = #{orgId}
         </where>
     </select>
 
@@ -95,7 +137,10 @@
         a.latitude,
         b.director,
         b.phone,
-        b.addr
+        b.addr,
+        a.chamberlain_amount chamberlainAmount,
+        a.device_amount deviceAmount,
+        (a.rt_event_amount + a.his_event_amount) eventAmount
         FROM st_station a INNER JOIN care_station b ON a.station_id = b.id
         <where>
            1 = 1
@@ -105,39 +150,34 @@
         </where>
     </select>
 
-    <select id="selectBigScreenStationListOlderTop5" resultType="com.care.bigscreen.vo.BigScreenStationVO">
+    <select id="selectOrgBigScreenDeviceList" resultType="com.care.bigscreen.vo.BigScreenDeviceVO">
         SELECT
-        a.station_id stationId,
-        a.station_name stationName,
-        a.older_amount olderAmount
-        FROM st_station a
+        a.name deviceName,
+        (case when a.longitude is null then
+        (select b.longitude from care_house b where b.id in (select c.house_id from care_house_device_rel c where c.dev_id = a.id) limit 1)
+        else a.longitude  end ) longitude,
+        (case when a.longitude is null then
+        (select b.latitude from care_house b where b.id in (select c.house_id from care_house_device_rel c where c.dev_id = a.id) limit 1)
+        else a.latitude  end ) latitude,
+        a.status,
+        (select b.addr from care_house b where b.id in (select c.house_id from care_house_device_rel c where c.dev_id = a.id) limit 1) deviceAddr
+        FROM care_device a
         <where>
             1 = 1
             <if test="orgId != null and orgId != ''">
                 AND a.org_id = #{orgId}
             </if>
-        </where>
-        order by a.older_amount DESC
-        limit 5
-    </select>
-
-    <select id="selectBigScreenStationListEventTop5" resultType="com.care.bigscreen.vo.BigScreenStationVO">
-        SELECT
-        a.station_id stationId,
-        a.station_name stationName,
-        (a.rt_event_amount + a.his_event_amount) eventAmount
-        FROM st_station a
-        <where>
-            1 = 1
-            <if test="orgId != null and orgId != ''">
-                AND a.org_id = #{orgId}
+            <if test="stationId != null and stationId != ''">
+                AND a.station_id = #{stationId}
+            </if>
+            <if test="status != null and status != ''">
+                AND a.status = #{status}
             </if>
         </where>
-        order by (a.rt_event_amount + a.his_event_amount) DESC
-        limit 5
     </select>
 
-    <select id="selectStationBigScreenStatisticsByStation" resultType="com.care.bigscreen.vo.BigScreenStationStatisticsVO">
+
+    <select id="selectStationBigScreenStatisticsByStation" resultType="com.care.bigscreen.vo.StationBigScreenStatisticsVO">
         SELECT
         a.station_id stationId,
         a.station_name stationName,
@@ -233,7 +273,13 @@
         (select sdc.name from sys_dim_code sdc where sdc.dim_code = a.status and sdc.type_code='event_order_status') status,
         '告警' eventType
         FROM care_event_order a
-        where a.station_id = #{stationId} and a.status in ('0','1')
+        where a.status in ('0','1')
+        <if test="orgId != null and orgId != ''">
+            and a.org_id = #{orgId}
+        </if>
+        <if test="stationId != null and stationId != ''">
+            and a.station_id = #{stationId}
+        </if>
         order by a.status,a.create_time
     </select>