Commit 56299ab8 authored by chenzhao's avatar chenzhao

修改代码

parent f10478ec
...@@ -27,9 +27,11 @@ ...@@ -27,9 +27,11 @@
generate, generate,
fullhour fullhour
from from
house_pv_data.td_hygf_inverter_year_generate house_pv_data.td_hygf_inverter_total_generate
<where> <where>
year_time = #{time} <if test="time != null and time !=''">
and year_time = #{time}
</if>
<if test="snCode != null and snCode !=''"> <if test="snCode != null and snCode !=''">
and sn_code = #{snCode} and sn_code = #{snCode}
</if> </if>
......
...@@ -221,9 +221,11 @@ public class JpInverterController extends BaseController { ...@@ -221,9 +221,11 @@ public class JpInverterController extends BaseController {
return ResponseHelper.buildResponse(jpInverterServiceImpl.selectDayTrend(treeParams1, time, snCode, thirdStationId)); return ResponseHelper.buildResponse(jpInverterServiceImpl.selectDayTrend(treeParams1, time, snCode, thirdStationId));
}else if (treeParams.get("date").equals("month")){ }else if (treeParams.get("date").equals("month")){
return ResponseHelper.buildResponse(jpInverterServiceImpl.selectMonthTrend(time, snCode, thirdStationId)); return ResponseHelper.buildResponse(jpInverterServiceImpl.selectMonthTrend(time, snCode, thirdStationId));
}else { }else if (treeParams.get("date").equals("year")) {
return ResponseHelper.buildResponse(jpInverterServiceImpl.selectYearTrend(time, snCode, thirdStationId)); return ResponseHelper.buildResponse(jpInverterServiceImpl.selectYearTrend(time, snCode, thirdStationId));
} }else {
return ResponseHelper.buildResponse(jpInverterServiceImpl.selectTotalTrend(time, snCode, thirdStationId));
}
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
...@@ -338,7 +338,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter ...@@ -338,7 +338,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
}else { }else {
List<TdHYGFInverterTotalGenerate> maps = tdHYGFInverterYearGenerateMapper.selectTotalSum(null, snCode, thirdStationId); List<TdHYGFInverterTotalGenerate> maps = tdHYGFInverterYearGenerateMapper.selectTotalSum(null, snCode, thirdStationId);
double fullhour = maps.stream().mapToDouble(TdHYGFInverterTotalGenerate::getFullhour).sum(); double fullhour = maps.stream().mapToDouble(TdHYGFInverterTotalGenerate::getFullhour).sum();
double income = maps.stream().mapToDouble(TdHYGFInverterTotalGenerate::getIncome).sum(); double income = maps.stream().filter(e->null != e.getIncome() ).mapToDouble(TdHYGFInverterTotalGenerate::getIncome).sum();
double generate = maps.stream().mapToDouble(TdHYGFInverterTotalGenerate::getGenerate).sum(); double generate = maps.stream().mapToDouble(TdHYGFInverterTotalGenerate::getGenerate).sum();
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("fullhour",fullhour); map.put("fullhour",fullhour);
......
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