Koishi 1 éve
szülő
commit
f450aaa8ba

+ 50 - 5
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/Application/ApplicationController.java

@@ -100,16 +100,19 @@ public class ApplicationController {
         }
 
     }
+
+
+
     @GetMapping(value = "/shutdowngs")
     @ApiOperation(value = "故障次数公司", notes = "故障次数公司")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "type", value = "场站编号", required = true, dataType = "string", paramType = "query")
+            @ApiImplicitParam(name = "type", value = "编号", required = true, dataType = "string", paramType = "query")
     })
-    public AjaxResult getshutdown(String type) throws Exception {
+    public AjaxResult getshutdowngs(String type) throws Exception {
 
         List<Map<String, Object>>   list = new ArrayList<>();
 
-            list = applicationService.shutdown(type);
+        list = applicationService.shutdown(type);
 
         if (null != list) {
             return AjaxResult.successData(200, list);
@@ -119,11 +122,10 @@ public class ApplicationController {
 
     }
 
-
     @GetMapping(value = "/shutdowncz")
     @ApiOperation(value = "故障次数场站", notes = "故障次数场站")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "type", value = "场站编号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "type", value = "编号", required = true, dataType = "string", paramType = "query"),
             @ApiImplicitParam(name = "wpId", value = "场站编号", required = false, dataType = "string", paramType = "query")
     })
     public AjaxResult getshutdowncz(String type,String wpId) throws Exception {
@@ -140,4 +142,47 @@ public class ApplicationController {
 
     }
 
+
+    @GetMapping(value = "/shutdowngsjx")
+    @ApiOperation(value = "机型故障次数公司", notes = "机型故障次数公司")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "type", value = "编号", required = true, dataType = "string", paramType = "query")
+    })
+    public AjaxResult getshutdownjx(String type) throws Exception {
+
+        List<Map<String, Object>>   list = new ArrayList<>();
+
+        list = applicationService.shutdownjx(type);
+
+        if (null != list) {
+            return AjaxResult.successData(200, list);
+        } else {
+            return AjaxResult.error(500, "操作失败");
+        }
+
+    }
+
+
+
+    @GetMapping(value = "/shutdownczjx")
+    @ApiOperation(value = "机型故障次数场站", notes = "机型故障次数场站")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "type", value = "编号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "wpId", value = "场站编号", required = false, dataType = "string", paramType = "query")
+    })
+    public AjaxResult getshutdownczjx(String type,String wpId) throws Exception {
+
+        List<Map<String, Object>>   list = new ArrayList<>();
+        if (wpId!=null) {
+            list = applicationService.shutdownczjx(type, wpId);
+        }
+        if (null != list) {
+            return AjaxResult.successData(200, list);
+        } else {
+            return AjaxResult.error(500, "操作失败");
+        }
+
+    }
+
+
 }

+ 52 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/mapper/auto/ProEconAlarmTypeMapper.java

@@ -69,4 +69,56 @@ public interface ProEconAlarmTypeMapper extends BaseMapper<ProEconAlarmType> {
             "GROUP BY pro_econ_alarm_type.name")
     List<Map<String, Object>> getAlarmTypeCountsyearcz(@Param("wpId") String wpId);
 
+
+    @Select("SELECT pro_econ_equipmentmodel.name, COUNT(pro_econ_shutdown_event.windturbine_id) AS num_of_events " +
+            "FROM pro_econ_equipmentmodel " +
+            "JOIN pro_basic_equipment ON pro_econ_equipmentmodel.id = pro_basic_equipment.model_id " +
+            "JOIN pro_econ_shutdown_event ON pro_basic_equipment.id = pro_econ_shutdown_event.windturbine_id " +
+            "WHERE pro_econ_shutdown_event.stop_time::date = current_date " +
+            "GROUP BY pro_econ_equipmentmodel.name")
+    List<Map<String, Object>> getResults();
+
+    @Select("SELECT pro_econ_equipmentmodel.name, COUNT(pro_econ_shutdown_event.windturbine_id) AS num_of_events " +
+            "FROM pro_econ_equipmentmodel " +
+            "JOIN pro_basic_equipment ON pro_econ_equipmentmodel.id = pro_basic_equipment.model_id " +
+            "JOIN pro_econ_shutdown_event ON pro_basic_equipment.id = pro_econ_shutdown_event.windturbine_id " +
+            "WHERE EXTRACT(MONTH FROM pro_econ_shutdown_event.stop_time::date) = EXTRACT(MONTH FROM current_date) " +
+            "GROUP BY pro_econ_equipmentmodel.name")
+    List<Map<String, Object>> getResultsmonth();
+
+    @Select("SELECT pro_econ_equipmentmodel.name, COUNT(pro_econ_shutdown_event.windturbine_id) AS num_of_events " +
+            "FROM pro_econ_equipmentmodel " +
+            "JOIN pro_basic_equipment ON pro_econ_equipmentmodel.id = pro_basic_equipment.model_id " +
+            "JOIN pro_econ_shutdown_event ON pro_basic_equipment.id = pro_econ_shutdown_event.windturbine_id " +
+            "WHERE EXTRACT(YEAR FROM pro_econ_shutdown_event.stop_time::date) = EXTRACT(YEAR FROM current_date) " +
+            "GROUP BY pro_econ_equipmentmodel.name")
+    List<Map<String, Object>> getResultsyear();
+
+    @Select("SELECT pro_econ_equipmentmodel.name, COUNT(pro_econ_shutdown_event.windturbine_id) AS num_of_events " +
+            "FROM pro_econ_equipmentmodel " +
+            "JOIN pro_basic_equipment ON pro_econ_equipmentmodel.id = pro_basic_equipment.model_id " +
+            "JOIN pro_econ_shutdown_event ON pro_basic_equipment.id = pro_econ_shutdown_event.windturbine_id " +
+            "WHERE pro_econ_shutdown_event.stop_time::date = current_date " +
+            "AND pro_econ_shutdown_event.windpowerstation_id = #{wpId} " +
+            "GROUP BY pro_econ_equipmentmodel.name")
+    List<Map<String, Object>> getResultscz(@Param("wpId") String wpId);
+
+    @Select("SELECT pro_econ_equipmentmodel.name, COUNT(pro_econ_shutdown_event.windturbine_id) AS num_of_events " +
+            "FROM pro_econ_equipmentmodel " +
+            "JOIN pro_basic_equipment ON pro_econ_equipmentmodel.id = pro_basic_equipment.model_id " +
+            "JOIN pro_econ_shutdown_event ON pro_basic_equipment.id = pro_econ_shutdown_event.windturbine_id " +
+            "WHERE EXTRACT(MONTH FROM pro_econ_shutdown_event.stop_time::date) = EXTRACT(MONTH FROM current_date) " +
+            "AND pro_econ_shutdown_event.windpowerstation_id = #{wpId} " +
+            "GROUP BY pro_econ_equipmentmodel.name")
+    List<Map<String, Object>> getResultsmonthcz(@Param("wpId") String wpId);
+
+    @Select("SELECT pro_econ_equipmentmodel.name, COUNT(pro_econ_shutdown_event.windturbine_id) AS num_of_events " +
+            "FROM pro_econ_equipmentmodel " +
+            "JOIN pro_basic_equipment ON pro_econ_equipmentmodel.id = pro_basic_equipment.model_id " +
+            "JOIN pro_econ_shutdown_event ON pro_basic_equipment.id = pro_econ_shutdown_event.windturbine_id " +
+            "WHERE EXTRACT(YEAR FROM pro_econ_shutdown_event.stop_time::date) = EXTRACT(YEAR FROM current_date) " +
+            "AND pro_econ_shutdown_event.windpowerstation_id = #{wpId} " +
+            "GROUP BY pro_econ_equipmentmodel.name")
+    List<Map<String, Object>> getResultsyearcz(@Param("wpId") String wpId);
+
 }

+ 44 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/Application/ApplicationService.java

@@ -428,6 +428,7 @@ public class ApplicationService {
     }
 
 
+    //公司故障
     public  List<Map<String, Object>>  shutdown(String type) throws Exception {
 
         List<Map<String, Object>> gz = new ArrayList<>();
@@ -448,6 +449,7 @@ public class ApplicationService {
 
     }
 
+    //场站故障
 
     public  List<Map<String, Object>>  shutdowncz(String type,String wpId) throws Exception {
 
@@ -467,4 +469,46 @@ public class ApplicationService {
         return gz;
     }
 
+
+    //公司机型
+    public  List<Map<String, Object>>  shutdownjx(String type) throws Exception {
+
+        List<Map<String, Object>> gz = new ArrayList<>();
+
+        if (type.equals("day")) {
+            List<Map<String, Object>> typeCounts = proEconAlarmTypeMapper.getResults();
+            gz = typeCounts;
+        }else if (type.equals("month")){
+            List<Map<String, Object>> alarmTypeCountsmonth = proEconAlarmTypeMapper.getResultsmonth();
+            gz=alarmTypeCountsmonth;
+        }else if (type.equals("year")){
+            List<Map<String, Object>> alarmTypeCountsyear = proEconAlarmTypeMapper.getResultsyear();
+            gz=alarmTypeCountsyear;
+        }
+
+        return gz;
+
+
+    }
+
+
+    //场站机型
+    public  List<Map<String, Object>>  shutdownczjx(String type,String wpId) throws Exception {
+
+        List<Map<String, Object>> gz = new ArrayList<>();
+        if (type.equals("day")) {
+            List<Map<String, Object>> typeCounts = proEconAlarmTypeMapper.getResultscz(wpId);
+            gz = typeCounts;
+        }else if (type.equals("month")){
+            List<Map<String, Object>> alarmTypeCountsmonth = proEconAlarmTypeMapper.getResultsmonthcz(wpId);
+            gz=alarmTypeCountsmonth;
+        }else if (type.equals("year")){
+            List<Map<String, Object>> alarmTypeCountsyear = proEconAlarmTypeMapper.getResultsyearcz(wpId);
+            gz=alarmTypeCountsyear;
+        }
+
+
+        return gz;
+    }
+
 }