Commit 46ce4580 authored by chenzhao's avatar chenzhao

修改统计图代码

parent a72da86b
...@@ -137,7 +137,7 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -137,7 +137,7 @@ public class IdxBizFanHealthIndexController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测测点层左侧列表", notes = "预警监测风机层左侧列表") @ApiOperation(httpMethod = "GET",value = "预警监测测点层左侧列表", notes = "预警监测风机层左侧列表")
@GetMapping(value = "/tableLeftByPointList") @GetMapping(value = "/tableLeftByPointList")
public ResponseModel<Page<Map<String,Object>>> queryForLeftTableByPointList(@RequestParam(required = false) String STATION, @RequestParam(required = false)String HEALTHLEVEL,@RequestParam(required = false) String EQUIPMENTNAME,,@RequestParam(required = false)String POINTNAME,Integer current,Integer size) { public ResponseModel<Page<Map<String,Object>>> queryForLeftTableByPointList(@RequestParam(required = false) String STATION, @RequestParam(required = false)String HEALTHLEVEL,@RequestParam(required = false) String EQUIPMENTNAME,@RequestParam(required = false)String POINTNAME,Integer current,Integer size) {
Page<Map<String,Object>> page = new Page<Map<String,Object>>(); Page<Map<String,Object>> page = new Page<Map<String,Object>>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
......
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.controller; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvHealthIndexDto; import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvHealthIndexDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWarningRecord;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizPvHealthIndexServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizPvHealthIndexServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -166,16 +167,20 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -166,16 +167,20 @@ public class IdxBizPvHealthIndexController extends BaseController {
@ApiOperation(httpMethod = "GET",value = "预警监测设备级统计", notes = "预警监测设备级统计") @ApiOperation(httpMethod = "GET",value = "预警监测设备级统计", notes = "预警监测设备级统计")
@GetMapping(value = "/queryForPointNum") @GetMapping(value = "/queryForPointNum")
public ResponseModel<List<Map<String,Object>>> queryForLeftTableListByPointNum(@RequestParam(required = false) String STATION,@RequestParam(required = false) String SUBARRAY,@RequestParam(required = false) String EQUIPMENTNAME) { public ResponseModel<List<Map<String,Object>>> queryForLeftTableListByPointNum(@RequestParam(required = false) String STATION,@RequestParam(required = false) String SUBARRAY,@RequestParam(required = false) String EQUIPMENTNAME) {
List<Map<String, Object>> maps = idxBizPvHealthIndexServiceImpl.warningData(STATION, SUBARRAY, EQUIPMENTNAME); List<IdxBizPvWarningRecord> idxBizPvWarningRecordList = idxBizPvHealthIndexServiceImpl.warningData(STATION, SUBARRAY, EQUIPMENTNAME);
int total = idxBizPvHealthIndexServiceImpl.pointNum(STATION, SUBARRAY, EQUIPMENTNAME); int total = idxBizPvHealthIndexServiceImpl.pointNum(STATION, SUBARRAY, EQUIPMENTNAME);
Map<String,Object> warningNum =new HashMap<>(); Map<String,Object> warningNum =new HashMap<>();
warningNum.put("name","异常"); warningNum.put("name","注意");
warningNum.put("value",maps.size()); warningNum.put("value",idxBizPvWarningRecordList.stream().filter(e->e.getWarningName().equals("注意")).count());
warningNum.put("name","警告");
warningNum.put("value",idxBizPvWarningRecordList.stream().filter(e->e.getWarningName().equals("警告")).count());
warningNum.put("name","危险");
warningNum.put("value",idxBizPvWarningRecordList.stream().filter(e->e.getWarningName().equals("危险")).count());
Map<String,Object> pointNum =new HashMap<>(); Map<String,Object> pointNum =new HashMap<>();
pointNum.put("name","正常"); pointNum.put("name","正常");
pointNum.put("value",total - maps.size()); pointNum.put("value",total - idxBizPvWarningRecordList.size());
List<Map<String,Object>> list = new ArrayList<>(); List<Map<String,Object>> list = new ArrayList<>();
list.add(pointNum); list.add(pointNum);
......
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.mapper2; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.mapper2;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvHealthIndexDto; import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvHealthIndexDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvHealthIndex; import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvHealthIndex;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWarningRecord;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -27,7 +28,7 @@ public interface IdxBizPvHealthIndexMapper extends BaseMapper<IdxBizPvHealthInde ...@@ -27,7 +28,7 @@ public interface IdxBizPvHealthIndexMapper extends BaseMapper<IdxBizPvHealthInde
int queryForLeftTableListByPointCount(String STATION, String SUBARRAY, String HEALTHLEVEL, String EQUIPMENTNAME,String POINTNAME); int queryForLeftTableListByPointCount(String STATION, String SUBARRAY, String HEALTHLEVEL, String EQUIPMENTNAME,String POINTNAME);
List<Map<String,Object>> warningData(String STATION, String SUBARRAY, String EQUIPMENTNAME); List<IdxBizPvWarningRecord> warningData(String STATION, String SUBARRAY, String EQUIPMENTNAME);
Integer pointNum(String STATION, String SUBARRAY, String EQUIPMENTNAME); Integer pointNum(String STATION, String SUBARRAY, String EQUIPMENTNAME);
......
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.service.impl; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvHealthIndexDto; import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvHealthIndexDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvHealthIndex; import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvHealthIndex;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWarningRecord;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthIndexMapper; import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthIndexMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.service.IIdxBizPvHealthIndexService; import com.yeejoin.amos.boot.module.jxiop.biz.service.IIdxBizPvHealthIndexService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -61,7 +62,7 @@ public class IdxBizPvHealthIndexServiceImpl extends BaseService<IdxBizPvHealthIn ...@@ -61,7 +62,7 @@ public class IdxBizPvHealthIndexServiceImpl extends BaseService<IdxBizPvHealthIn
return this.getBaseMapper().pointNum(STATION, SUBARRAY,EQUIPMENTNAME); return this.getBaseMapper().pointNum(STATION, SUBARRAY,EQUIPMENTNAME);
} }
public List<Map<String,Object>> warningData(String STATION, String SUBARRAY , String EQUIPMENTNAME) { public List<IdxBizPvWarningRecord> warningData(String STATION, String SUBARRAY , String EQUIPMENTNAME) {
return this.getBaseMapper().warningData(STATION, SUBARRAY, EQUIPMENTNAME); return this.getBaseMapper().warningData(STATION, SUBARRAY, EQUIPMENTNAME);
} }
......
...@@ -239,38 +239,31 @@ ...@@ -239,38 +239,31 @@
</select> </select>
<select id="warningData" resultType="map"> <select id="warningData" resultType="com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWarningRecord">
SELECT * FROM (SELECT SELECT
cl. STATION, *
cl. SUBARRAY,
cl.EQUIPMENT_NAME
FROM FROM
idx_biz_pv_point_process_variable_classification cl idx_biz_pv_warning_record re
INNER JOIN idx_biz_pv_warning_record re ON re.EQUIPMENT_NAME = cl.EQUIPMENT_NAME AND re.STATION = cl.STATION AND re.SUBARRAY = cl.SUBARRAY
AND re.`STATUS` = 0
WHERE WHERE
cl.TAG_CODE = '分析变量' re.`STATUS` = 0
GROUP BY cl.EQUIPMENT_NAME) a <if test="EQUIPMENTNAME != '' and EQUIPMENTNAME != null">
<where> AND re.EQUIPMENT_NAME = #{EQUIPMENTNAME}
<if test="EQUIPMENTNAME != '' and EQUIPMENTNAME != null"> </if>
AND a.EQUIPMENT_NAME = #{EQUIPMENTNAME} <if test="SUBARRAY != null and SUBARRAY != '' ">
</if> AND re.SUBARRAY = #{SUBARRAY}
<if test="SUBARRAY != null and SUBARRAY != '' "> </if>
AND a.SUBARRAY = #{SUBARRAY} <if test="STATION != null and STATION != '' ">
</if> AND re.STATION = #{STATION}
<if test="STATION != null and STATION != '' "> </if>
AND a.STATION = #{STATION}
</if>
</where>
</select> </select>
<select id="pointNum" resultType="int"> <select id="pointNum" resultType="int">
SELECT SELECT
count(1) count(1)
FROM FROM
idx_biz_pv_point_process_variable_classification cl idx_biz_pv_point_process_variable_classification cl
WHERE WHERE
cl.TAG_CODE = '分析变量' cl.TAG_CODE = '分析变量'
<if test="EQUIPMENTNAME != '' and EQUIPMENTNAME != null"> <if test="EQUIPMENTNAME != '' and EQUIPMENTNAME != null">
AND cl.EQUIPMENT_NAME = #{EQUIPMENTNAME} AND cl.EQUIPMENT_NAME = #{EQUIPMENTNAME}
</if> </if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment