Commit 71f9d999 authored by chenzhao's avatar chenzhao

修改接口

parent cfd3c83e
...@@ -21,10 +21,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthLevelMapper; ...@@ -21,10 +21,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthLevelMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRuleSetServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRuleSetServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizPvWarningRuleSetServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizPvWarningRuleSetServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanHealthIndexMapper; import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.*;
import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvWaringRecordMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex; import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord; import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex; import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex;
...@@ -92,6 +89,8 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -92,6 +89,8 @@ public class TDBigScreenAnalyseController extends BaseController {
@Autowired @Autowired
PvWaringRecordMapper pvWaringRecordMapper; PvWaringRecordMapper pvWaringRecordMapper;
@Autowired
FanHealthIndexDayMapper fanHealthIndexDayMapper;
@Autowired @Autowired
...@@ -225,7 +224,8 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -225,7 +224,8 @@ public class TDBigScreenAnalyseController extends BaseController {
@GetMapping(value = "/getHealthInfoByArea") @GetMapping(value = "/getHealthInfoByArea")
public ResponseModel<Map<String, Object>> getHealthInfoByArea() throws Exception { public ResponseModel<Map<String, Object>> getHealthInfoByArea() throws Exception {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getHealthInfoByArea(); // List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getHealthInfoByArea();
List<Map<String, Object>> healthListInfo = fanHealthIndexDayMapper.getHealthInfoByArea();
Map<String, Integer> collect = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("area").toString(), t -> Integer.valueOf(t.get("healthIndex").toString().replace(".0", "")))); Map<String, Integer> collect = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("area").toString(), t -> Integer.valueOf(t.get("healthIndex").toString().replace(".0", ""))));
// List<String> list = Arrays.asList("华中片区", "西北片区", "西南片区", "华南片区", "华东片区", "东北片区", "华北片区"); // List<String> list = Arrays.asList("华中片区", "西北片区", "西南片区", "华南片区", "华东片区", "东北片区", "华北片区");
...@@ -1143,7 +1143,7 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -1143,7 +1143,7 @@ public class TDBigScreenAnalyseController 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 = "/queryIndexByArae") @GetMapping(value = "/queryIndexByArae")
public ResponseModel<Map<String, Object>> queryIndexByArae(@RequestParam(required = false) String area, String analysisType, String startTimeTop, String endTimeTop) { public ResponseModel<Map<String, Object>> queryIndexByArae(@RequestParam(required = false) String area, String analysisType, String startTimeTop, String endTimeTop) {
......
...@@ -33,4 +33,6 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> { ...@@ -33,4 +33,6 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
" GROUP BY station,health_level order by sort"+ " GROUP BY station,health_level order by sort"+
"</script>") "</script>")
List<Map<String,Object>> selectEquipStatusByStation(@Param("area")String area,@Param("analysisObjType")String analysisObjType,@Param("station")String station); List<Map<String,Object>> selectEquipStatusByStation(@Param("area")String area,@Param("analysisObjType")String analysisObjType,@Param("station")String station);
List<Map<String, Object>> getHealthInfoByArea();
} }
...@@ -2,4 +2,24 @@ ...@@ -2,4 +2,24 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanHealthIndexDayMapper"> <mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanHealthIndexDayMapper">
<select id="getHealthInfoByArea" resultType="java.util.Map">
select area as area,
ceil(avg(a.avghealthindex)) as healthindex
from (
select avg(health_index) as avghealthindex,
area
from analysis_data.fan_health_index_day
where analysis_obj_type = '片区'
group by area
union all
(
select avg(health_index) as avghealthindex,
area
from analysis_data.pv_health_index_day
where analysis_obj_type = '片区'
group by area
)
) a
group by a.area
</select>
</mapper> </mapper>
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