Commit 7c179c48 authored by 朱晨阳's avatar 朱晨阳

Merge remote-tracking branch 'origin/developer' into developer

parents 730b91b4 a68fca63
...@@ -33,6 +33,7 @@ import io.swagger.annotations.ApiOperation; ...@@ -33,6 +33,7 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...@@ -455,7 +456,13 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -455,7 +456,13 @@ public class IdxBizFanHealthIndexController extends BaseController {
List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, orgCode); List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, orgCode);
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("value",Double.parseDouble(df.format(Double.parseDouble(fanHealthIndexDays.get(0).getValue())))); //预防查询结果为空
if(CollectionUtils.isEmpty(fanHealthIndexDays)){
map.put("value",0);
}else{
map.put("value",Double.parseDouble(df.format(Double.parseDouble(fanHealthIndexDays.get(0).getValue()))));
}
return ResponseHelper.buildResponse(map); return ResponseHelper.buildResponse(map);
} }
......
...@@ -29,7 +29,7 @@ public interface FanHealthIndexHourMapper extends BaseMapper<FanHealthIndexHour> ...@@ -29,7 +29,7 @@ public interface FanHealthIndexHourMapper extends BaseMapper<FanHealthIndexHour>
List<FanHealthIndexHour> selectData(@Param("healthLevel") String healthLevel, @Param("area") String area, @Param("equipmentName") String equipmentName, @Param("subSystem") String subSystem, @Param("analysisType") String analysisType, @Param("analysisObjType") String analysisObjType, @Param("station") String station, @Param("pointName") String pointName, @Param("indexAddress") String indexAddress, @Param("startTimeTop") String startTimeTop, @Param("endTimeTop") String endTimeTop, @Param("current") Integer current, @Param("size") Integer size, @Param("orgCode") String orgCode); List<FanHealthIndexHour> selectData(@Param("healthLevel") String healthLevel, @Param("area") String area, @Param("equipmentName") String equipmentName, @Param("subSystem") String subSystem, @Param("analysisType") String analysisType, @Param("analysisObjType") String analysisObjType, @Param("station") String station, @Param("pointName") String pointName, @Param("indexAddress") String indexAddress, @Param("startTimeTop") String startTimeTop, @Param("endTimeTop") String endTimeTop, @Param("current") Integer current, @Param("size") Integer size, @Param("orgCode") String orgCode);
@Select("<script>" + @Select("<script>" +
"SELECT distinct `health_index` AS healthIndex,anomaly,rec_date as recDate, `health_index` AS `value`, substr(analysis_time,1,10) as analysisTime, station,equipment_name AS equipmentName,point_name as pointName, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status FROM analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null" + "SELECT distinct `health_index` AS healthIndex,anomaly,rec_date as recDate, `health_index` AS `value`, substr(analysis_time,1,10) as analysisTime, station,equipment_name AS equipmentName,point_name as pointName, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status FROM analysis_data.fan_health_index_hour WHERE analysis_obj_type = #{analysisObjType} and org_code is not null" +
"<if test='endTimeTop!= null'> and rec_date &lt;= #{endTimeTop} </if> " + "<if test='endTimeTop!= null'> and rec_date &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and rec_date &gt;= #{startTimeTop} </if> " + "<if test='startTimeTop!= null'> and rec_date &gt;= #{startTimeTop} </if> " +
"<if test='area!= null'> AND area = #{area} </if> " + "<if test='area!= null'> AND area = #{area} </if> " +
......
...@@ -28,7 +28,7 @@ public interface FanHealthIndexMomentMapper extends BaseMapper<FanHealthIndexMom ...@@ -28,7 +28,7 @@ public interface FanHealthIndexMomentMapper extends BaseMapper<FanHealthIndexMom
List<FanHealthIndexMoment> selectData(@Param("healthLevel") String healthLevel, @Param("area") String area, @Param("equipmentName") String equipmentName, @Param("subSystem") String subSystem, @Param("analysisType") String analysisType, @Param("analysisObjType") String analysisObjType, @Param("station") String station, @Param("pointName") String pointName, @Param("indexAddress") String indexAddress, @Param("startTimeTop") String startTimeTop, @Param("endTimeTop") String endTimeTop, @Param("current") Integer current, @Param("size") Integer size, @Param("orgCode") String orgCode); List<FanHealthIndexMoment> selectData(@Param("healthLevel") String healthLevel, @Param("area") String area, @Param("equipmentName") String equipmentName, @Param("subSystem") String subSystem, @Param("analysisType") String analysisType, @Param("analysisObjType") String analysisObjType, @Param("station") String station, @Param("pointName") String pointName, @Param("indexAddress") String indexAddress, @Param("startTimeTop") String startTimeTop, @Param("endTimeTop") String endTimeTop, @Param("current") Integer current, @Param("size") Integer size, @Param("orgCode") String orgCode);
@Select("<script>" + @Select("<script>" +
"SELECT distinct `health_index` AS healthIndex,anomaly,rec_date as recDate, `health_index` AS `value`, substr(analysis_time,1,10) as analysisTime, station,equipment_name AS equipmentName,point_name as pointName, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status FROM analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null" + "SELECT distinct `health_index` AS healthIndex,anomaly,rec_date as recDate, `health_index` AS `value`, substr(analysis_time,1,10) as analysisTime, station,equipment_name AS equipmentName,point_name as pointName, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status FROM analysis_data.fan_health_index_moment WHERE analysis_obj_type = #{analysisObjType} and org_code is not null" +
"<if test='endTimeTop!= null'> and rec_date &lt;= #{endTimeTop} </if> " + "<if test='endTimeTop!= null'> and rec_date &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and rec_date &gt;= #{startTimeTop} </if> " + "<if test='startTimeTop!= null'> and rec_date &gt;= #{startTimeTop} </if> " +
"<if test='area!= null'> AND area = #{area} </if> " + "<if test='area!= null'> AND area = #{area} </if> " +
......
...@@ -49,7 +49,7 @@ public interface PvHealthIndexHourMapper extends BaseMapper<PvHealthIndexHour> { ...@@ -49,7 +49,7 @@ public interface PvHealthIndexHourMapper extends BaseMapper<PvHealthIndexHour> {
@Select("<script>" + @Select("<script>" +
"SELECT distinct `health_index` AS healthIndex,rec_date as recDate, `health_index` AS `value`, rec_date AS recDate, anomaly, substr(analysis_time,1,10) as analysisTime,station,equipment_name AS equipmentName, point_name as pointName, index_address as indexAddress, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status" + "SELECT distinct `health_index` AS healthIndex,rec_date as recDate, `health_index` AS `value`, rec_date AS recDate, anomaly, substr(analysis_time,1,10) as analysisTime,station,equipment_name AS equipmentName, point_name as pointName, index_address as indexAddress, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status" +
" FROM analysis_data.pv_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null" + " FROM analysis_data.pv_health_index_hour WHERE analysis_obj_type = #{analysisObjType} and org_code is not null" +
"<if test='endTimeTop!= null'> and rec_date &lt;= #{endTimeTop} </if> " + "<if test='endTimeTop!= null'> and rec_date &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and rec_date &gt;= #{startTimeTop} </if> " + "<if test='startTimeTop!= null'> and rec_date &gt;= #{startTimeTop} </if> " +
"<if test='area!= null '> AND area = #{area} </if> " + "<if test='area!= null '> AND area = #{area} </if> " +
......
...@@ -49,7 +49,7 @@ public interface PvHealthIndexMomentMapper extends BaseMapper<PvHealthIndexMomen ...@@ -49,7 +49,7 @@ public interface PvHealthIndexMomentMapper extends BaseMapper<PvHealthIndexMomen
@Select("<script>" + @Select("<script>" +
"SELECT distinct `health_index` AS healthIndex,rec_date as recDate, `health_index` AS `value`, rec_date AS recDate, anomaly, substr(analysis_time,1,10) as analysisTime,station,equipment_name AS equipmentName, point_name as pointName, index_address as indexAddress, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status" + "SELECT distinct `health_index` AS healthIndex,rec_date as recDate, `health_index` AS `value`, rec_date AS recDate, anomaly, substr(analysis_time,1,10) as analysisTime,station,equipment_name AS equipmentName, point_name as pointName, index_address as indexAddress, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status" +
" FROM analysis_data.pv_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null" + " FROM analysis_data.pv_health_index_moment WHERE analysis_obj_type = #{analysisObjType} and org_code is not null" +
"<if test='endTimeTop!= null'> and rec_date &lt;= #{endTimeTop} </if> " + "<if test='endTimeTop!= null'> and rec_date &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and rec_date &gt;= #{startTimeTop} </if> " + "<if test='startTimeTop!= null'> and rec_date &gt;= #{startTimeTop} </if> " +
"<if test='area!= null '> AND area = #{area} </if> " + "<if test='area!= null '> AND area = #{area} </if> " +
......
...@@ -91,16 +91,16 @@ public class GFDZSBJCServiceImpl implements IJXDZService { ...@@ -91,16 +91,16 @@ public class GFDZSBJCServiceImpl implements IJXDZService {
if (flag) { if (flag) {
String pointName = (String) map.get("pointName"); String pointName = (String) map.get("pointName");
if (pointName.contains("日发电量")) { if (pointName.contains("日发电量")) {
pvDeviceDataVO.setGenerationDaily(result.getDouble("value")); pvDeviceDataVO.setGenerationDaily(result.getDouble("value")/100000);
} }
if (pointName.contains("月发电量")) { if (pointName.contains("月发电量")) {
pvDeviceDataVO.setGenerationMonth(result.getDouble("value")); pvDeviceDataVO.setGenerationMonth(result.getDouble("value")/10000);
} }
if (pointName.contains("年发电量")) { if (pointName.contains("年发电量")) {
pvDeviceDataVO.setGenerationYear(result.getDouble("value")/10000); pvDeviceDataVO.setGenerationYear(result.getDouble("value")/100000000);
} }
if (pointName.contains("总发电量")) { if (pointName.contains("总发电量")) {
pvDeviceDataVO.setGenerationGross(result.getDouble("value")/10000); pvDeviceDataVO.setGenerationGross(result.getDouble("value")/100000000);
} }
} }
} }
......
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