Commit a91b0e3e authored by wujiang's avatar wujiang

修改统计

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