Commit a91b0e3e authored by wujiang's avatar wujiang

修改统计

parent 1399327e
......@@ -119,12 +119,15 @@
UNION ALL
SELECT '报警' AS status
) AS all_statuses
LEFT JOIN hygf_jp_collector ON all_statuses.status = hygf_jp_collector.state and hygf_jp_collector.third_station_id
LEFT JOIN hygf_jp_collector ON all_statuses.status = hygf_jp_collector.state
<if test="thirdStationIds!=null">
and hygf_jp_collector.third_station_id
in(
<foreach collection="thirdStationIds" item="item" separator=",">
(#{item})
</foreach>)
</foreach>
)
</if>
GROUP BY all_statuses.status
ORDER BY all_statuses.status;
......
......@@ -144,13 +144,17 @@
UNION ALL
SELECT '报警' AS status
) AS all_statuses
LEFT JOIN hygf_jp_inverter ON all_statuses.status = hygf_jp_inverter.state and hygf_jp_inverter.third_station_id
LEFT JOIN hygf_jp_inverter ON all_statuses.status = hygf_jp_inverter.state
<if test="thirdStationIds!=null">
and hygf_jp_inverter.third_station_id
in(
<foreach collection="thirdStationIds" item="item" separator=",">
(#{item})
</foreach>
)
</if>
)
GROUP BY all_statuses.status
ORDER BY all_statuses.status;
......
......@@ -238,15 +238,28 @@ public class TdHygfJpInverterWarnServiceImpl
public Map<String, Object> queryStateNumber(String regionalCompaniesCode, String amosCompanyCode, String thirdStationId, String type) {
// 查询所有场站
List<JpStationDto> jpStationDtos = jpStationServiceImpl.queryAllPowerStation(regionalCompaniesCode, amosCompanyCode, thirdStationId, type);
List<String> thirdStationIds=null;
if(regionalCompaniesCode==null&&amosCompanyCode==null)
{
thirdStationIds=null;
}
else
{
// 查询所有场站
List<JpStationDto> jpStationDtos = jpStationServiceImpl.queryAllPowerStation(regionalCompaniesCode, amosCompanyCode, thirdStationId, type);
if (!CollectionUtils.isEmpty(jpStationDtos)) {
thirdStationIds = jpStationDtos.stream().map(JpStation -> JpStation.getThirdStationId()).collect(Collectors.toList());
}
}
Map<String, Object> result = new HashMap<>();
if (!CollectionUtils.isEmpty(jpStationDtos)) {
// 获取thirdStationId集合
List<String> thirdStationIds = jpStationDtos.stream().map(JpStation -> JpStation.getThirdStationId()).collect(Collectors.toList());
Map<String, Object> result = new HashMap<>();
//在线
List<Integer> online = new ArrayList<>();
......@@ -291,7 +304,6 @@ public class TdHygfJpInverterWarnServiceImpl
result.put("xData",Arrays.asList("在线","报警","离线"));
result.put("yData",resultNumMap);
}
return result;
......
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