diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/controller/OilAnalysisController.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/controller/OilAnalysisController.java new file mode 100644 index 0000000..c752cbd --- /dev/null +++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/controller/OilAnalysisController.java @@ -0,0 +1,31 @@ +package com.ruoyi.project.oil.controller; + +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.oil.service.IOilThDeviceReportService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/analysis") +public class OilAnalysisController extends BaseController { + + @Autowired + private IOilThDeviceReportService oilThDeviceReportService; + + @GetMapping("/factoryBoundaryOnline") + public AjaxResult getDeviceReport(Long deptId, String beginDate, String endDate) { + List> alarmCount = oilThDeviceReportService.selectAlarmCountByDeptIdAndDateRange(deptId, beginDate, endDate); + List> alarmCountDesc = oilThDeviceReportService.selectAlarmCountByDeptIdAndDateRangeDesc(deptId, beginDate, endDate); + Map resultMap = new HashMap<>(); + resultMap.put("alarmCount", alarmCount); + resultMap.put("alarmCountDesc", alarmCountDesc); + return AjaxResult.success(resultMap); + } +} diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/mapper/ThDeviceReportMapper.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/mapper/ThDeviceReportMapper.java index 394ef2f..72dea74 100644 --- a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/mapper/ThDeviceReportMapper.java +++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/mapper/ThDeviceReportMapper.java @@ -71,4 +71,11 @@ public interface ThDeviceReportMapper { */ @MapKey("day") List> dailyReportDataOverview(@Param("day") String day); + + @MapKey("day") + List> selectAlarmCountByDeptIdAndDateRange(@Param("deptId") Long deptId, @Param("beginDate") String beginDate, @Param("endDate") String endDate); + + @MapKey("sn") + List> selectAlarmCountByDeptIdAndDateRangeDesc(@Param("deptId") Long deptId, @Param("beginDate") String beginDate, @Param("endDate") String endDate); + } diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/IOilThDeviceReportService.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/IOilThDeviceReportService.java index 809c6dc..c4ab0b1 100644 --- a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/IOilThDeviceReportService.java +++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/IOilThDeviceReportService.java @@ -9,4 +9,8 @@ public interface IOilThDeviceReportService { List> monthReportDataOverviewDeviceDs(Long deptId, String month); List> dailyReportDataOverview(String day); + + List> selectAlarmCountByDeptIdAndDateRange(Long deptId, String beginDate, String endDate); + + List> selectAlarmCountByDeptIdAndDateRangeDesc(Long deptId, String beginDate, String endDate); } diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/impl/OilThDeviceReportService.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/impl/OilThDeviceReportService.java index bdd02be..65bafc5 100644 --- a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/impl/OilThDeviceReportService.java +++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/impl/OilThDeviceReportService.java @@ -31,4 +31,14 @@ public class OilThDeviceReportService implements IOilThDeviceReportService { return camelCaseMapListKey(thDeviceReportMapper.dailyReportDataOverview(day)); } + @Override + public List> selectAlarmCountByDeptIdAndDateRange(Long deptId, String beginDate, String endDate) { + return camelCaseMapListKey(thDeviceReportMapper.selectAlarmCountByDeptIdAndDateRange(deptId, beginDate, endDate)); + } + + @Override + public List> selectAlarmCountByDeptIdAndDateRangeDesc(Long deptId, String beginDate, String endDate) { + return camelCaseMapListKey(thDeviceReportMapper.selectAlarmCountByDeptIdAndDateRangeDesc(deptId, beginDate, endDate)); + } + } diff --git a/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/ThDeviceReportMapper.xml b/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/ThDeviceReportMapper.xml index 1d90452..ec182ed 100644 --- a/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/ThDeviceReportMapper.xml +++ b/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/ThDeviceReportMapper.xml @@ -177,4 +177,52 @@ GROUP BY TO_CHAR(d.report_time, 'YYYY-MM-DD'), ppp.dept_name, pp.dept_name, p.dept_name, d.sn ORDER BY ppp.dept_name, pp.dept_name, p.dept_name + + + + + diff --git a/ruoyi-ui/src/api/analysis/index.js b/ruoyi-ui/src/api/analysis/index.js new file mode 100644 index 0000000..f37aa86 --- /dev/null +++ b/ruoyi-ui/src/api/analysis/index.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' + +export function factoryBoundaryOnline(params) { + return request({ + url: '/analysis/factoryBoundaryOnline', + params: params, + method: 'get', + }) +} diff --git a/ruoyi-ui/src/views/dataAnalysis/bound/index.vue b/ruoyi-ui/src/views/dataAnalysis/bound/index.vue index 65889da..fc380de 100644 --- a/ruoyi-ui/src/views/dataAnalysis/bound/index.vue +++ b/ruoyi-ui/src/views/dataAnalysis/bound/index.vue @@ -1,302 +1,344 @@ - - - - \ No newline at end of file + lineStyle: { + color: "#DE390F", + }, + label: { + show: true, + color: "#ddd", + formatter: "{c}%", // {c}数据值 + }, + }, + ], + }; + + this.myChart = echarts.init(this.$refs.qdCityMap1); + this.myChart.setOption(option); + }, + }, +}; + +