luowei 1 rok pred
rodič
commit
463e3e57ac

+ 10 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/mapper/ResumptionReportMapper.java

@@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Param;
 
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author :LuoWei
@@ -31,4 +32,13 @@ public interface ResumptionReportMapper {
     IntrusionTestReportVO selectServiceBankReport(@Param("date") String date, @Param("orgPath") String orgPath);
 
     IntrusionTestReportVO selectStandbyPower(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("orgPath") String orgPath);
+
+    /**
+     * 隐患
+     * @param startTime
+     * @param endTime
+     * @param orgPath
+     * @return
+     */
+    Map selectStandbyPowerAbnormalNumber(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("orgPath") String orgPath);
 }

+ 11 - 5
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/service/impl/ResumptionReportServiceImpl.java

@@ -22,11 +22,7 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.net.URLEncoder;
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 /**
  * @author :LuoWei
@@ -325,6 +321,16 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
             }
             IntrusionTestReportVO intrusionTestReportVO1 = resumptionReportMapper.selectStandbyPower(resumptionDTO.getStartTime(), resumptionDTO.getEndTime(), o.getPath());
             BeanUtils.copyProperties(intrusionTestReportVO1, intrusionTestReportVO);
+          //隐患
+            Map map = resumptionReportMapper.selectStandbyPowerAbnormalNumber(resumptionDTO.getStartTime(), resumptionDTO.getEndTime(), o.getPath());
+            Object abnormalNumber = map.get("abnormalNumber");
+            intrusionTestReportVO1.setAbnormalNumber(Integer.valueOf(abnormalNumber.toString()));
+
+            Object realityRectificationNumber = map.get("realityRectificationNumber");
+            intrusionTestReportVO1.setRealityRectificationNumber(Integer.valueOf(realityRectificationNumber.toString()));
+
+            Object realityRectificationRate = map.get("realityRectificationRate");
+            intrusionTestReportVO1.setRealityRectificationRate(realityRectificationRate.toString());
             intrusionTestReportVO.setCity(sysOrg1.getShortName().indexOf("地区行社") == -1 ? sysOrg1.getShortName().substring(0, 2) : sysOrg1.getShortName().split("地区行社")[0]);
             intrusionTestReportVO.setOrgName(o.getShortName());
             Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(o.getPath());

+ 41 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/reportForms/ResumptionReportMapper.xml

@@ -196,4 +196,45 @@
             and a.org_path  like concat(#{orgPath},'%')
         </if>
     </select>
+    <select id="selectStandbyPowerAbnormalNumber" resultType="java.util.Map">
+        SELECT
+            IFNULL( SUM( IF ( c.confirm_status >= 2 AND c.reform_status IN ( 10, 11 ), 1, 0 ) ), 0 ) AS abnormalNumber,
+            IFNULL( SUM( IF ( c.reform_status = 11, 1, 0 )), 0 ) AS realityRectificationNumber,
+        IFNULL(
+        CONCAT(
+        ROUND(
+        SUM(
+        IF
+        ( c.reform_status = 11, 1, 0 ))/ IFNULL( SUM( IF ( c.confirm_status >= 2 AND c.reform_status IN ( 10, 11 ), 1, 0 ) ), 0 )* 100,
+        2
+        ),
+        '%'
+        ),
+        '0%'
+        ) AS realityRectificationRate
+        FROM
+            core_resumption a
+                LEFT JOIN core_resumption_plan b ON a.plan_id = b.id
+                LEFT JOIN core_question c ON c.src_task_id = a.id
+        WHERE
+            c.src_type = 1
+          AND b.plan_type = 5
+        <if test="startTime !=null and endTime !=null">
+            and ((
+            #{startTime} &lt;= a.plan_start_time
+            and #{endTime} >= a.plan_start_time
+            )
+            or (
+            #{startTime} &lt;= a.plan_end_time
+            and #{endTime} >= a.plan_end_time
+            )
+            or (
+            #{startTime} >= a.plan_start_time
+            and #{endTime} &lt;= a.plan_end_time
+            ))
+        </if>
+        <if test="orgPath !=null">
+            and a.org_path  like concat(#{orgPath},'%')
+        </if>
+    </select>
 </mapper>