yq 3 gadi atpakaļ
vecāks
revīzija
23633ba424

+ 2 - 2
mhfire-mapping/src/main/java/com/bizmatics/mhfire/persistence/mapper/vo/DeviceCollectVO.java

@@ -37,12 +37,12 @@ public class DeviceCollectVO {
     /**
      * 上线率
      */
-    private Double onRate;
+    private Double onRate = 1.00;
 
     /**
      * 接单率
      */
-    private Double taskOrderRate;
+    private Double taskOrderRate = 1.00;
     /**
      * 处置率
      */

+ 2 - 22
mhfire-mapping/src/main/resources/mapper/mysql/DeviceMapper.xml

@@ -64,30 +64,10 @@
         GROUP BY d.device_type
     </select>
     <select id="selectCollectOne" resultType="com.bizmatics.mhfire.persistence.mapper.vo.DeviceCollectVO">
-        select d.device_type as deviceType,count(d.id) as deviceCount,count(da.id) as alertCount,
-        count(if(d.device_flag = 1, 1, null)) as lineCount,
-        (
         select
-        ROUND(COUNT(CASE WHEN dd.device_flag=1 THEN dd.device_flag END)/COUNT(*),2) AS rate_a
-        FROM device as dd
-        where dd.device_type = d.device_type
-        ) as lineRate,
-
-        (
-        select
-        ROUND(COUNT(CASE WHEN dan.id != null THEN dan.id END)/COUNT(*),2) AS rate_a
-        FROM device as dd
-        left join device_alert as dan
-        on dd.`code` = dan.device_code
-        where dd.device_type = d.device_type
-        ) as alertRate,
 
-        (
-        select
-        ROUND(COUNT(CASE WHEN dan.aj_flag=3 THEN dan.aj_flag END)/COUNT(*),2)
-        FROM device_aj as dan
-        where dan.device_type = d.device_type
-        ) as checkRate
+        ROUND(COUNT(CASE WHEN aj.aj_flag=3 THEN aj.aj_flag END)/COUNT(aj.id),2)
+        as checkRate
 
         from device as d
         left join device_alert as da

+ 1 - 1
mhfire-service/src/main/java/com/bizmatics/mhfire/service/impl/JcjAjxxServiceImpl.java

@@ -160,7 +160,7 @@ public class JcjAjxxServiceImpl extends AbstractCrudService<JcjAjxxMapper, JcjAj
     public CommonPage<AlertMapVO> pageMap(Integer current, Integer size, Date startTime, Date endTime,String ajType) {
 
         LambdaQueryWrapper<JcjAjxx> queryWrapper = Wrappers.lambdaQuery();
-        queryWrapper.select(JcjAjxx::getId,JcjAjxx::getGisX,JcjAjxx::getGisY)
+        queryWrapper.select(JcjAjxx::getId,JcjAjxx::getGisX,JcjAjxx::getGisY,JcjAjxx::getAjlx)
                 .between(null != startTime && null != endTime,JcjAjxx::getCreated,startTime,endTime)
                 .eq(StringUtils.isNotBlank(ajType),JcjAjxx::getAjlx,ajType)
                 .orderByDesc(JcjAjxx::getCreated);

+ 2 - 0
mhfire-service/src/main/java/com/bizmatics/mhfire/service/vo/AlertMapVO.java

@@ -11,4 +11,6 @@ public class AlertMapVO {
     private String gisY;
 
         private String id;
+
+    private String ajlx;
 }