Commit ebfe0a54 authored by hezhuozhi's avatar hezhuozhi

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

parents b1f02415 64b846bd
......@@ -32,6 +32,8 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
......@@ -63,7 +65,9 @@ import java.util.stream.Collectors;
@RequestMapping(value = "/idx-biz-fan-health-index")
public class IdxBizFanHealthIndexController extends BaseController {
@Autowired
private static final Logger logger = LoggerFactory.getLogger(IdxBizFanHealthIndexController.class);
@Autowired
IdxBizFanHealthIndexServiceImpl idxBizFanHealthIndexServiceImpl;
@Autowired
......@@ -405,8 +409,13 @@ public class IdxBizFanHealthIndexController extends BaseController {
List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size, orgCode);
int total = fanHealthIndexDayMapper.selectDataTotal(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,orgCode);
if(CollectionUtils.isEmpty(fanHealthIndexDays)){
fanHealthIndexDays = fanHealthIndexDayMapper.selectLatestData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, null, null,0,1, orgCode);
total = 1;
fanHealthIndexDays = fanHealthIndexDayMapper.selectLatestData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, null, null,(current-1)*size,size, orgCode);
if(CollectionUtils.isEmpty(fanHealthIndexDays)){
logger.warn("根据条件:area:{},station:{},equipmentName:{},subSystem:{},pointName:{},analysisObjType:{}获取最新的数据为空",area,station,equipmentName,subSystem,pointName,analysisObjType);
total = 0;
}else{
total = fanHealthIndexDays.size();
}
}
fanHealthIndexDays.forEach(item -> {
double roundedNumber = Double.parseDouble(df.format(item.getHealthIndex()));
......@@ -415,7 +424,6 @@ public class IdxBizFanHealthIndexController extends BaseController {
page.setRecords(fanHealthIndexDays);
page.setTotal(total);
// page.setTotal(Long.valueOf(fanHealthIndexDays.size()));
return ResponseHelper.buildResponse(page);
}
......
......@@ -22,6 +22,8 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.*;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
......@@ -50,7 +52,9 @@ import java.util.stream.Collectors;
@RequestMapping(value = "/idx-biz-pv-health-index")
public class IdxBizPvHealthIndexController extends BaseController {
@Autowired
private static final Logger logger = LoggerFactory.getLogger(IdxBizPvHealthIndexController.class);
@Autowired
IdxBizPvHealthIndexServiceImpl idxBizPvHealthIndexServiceImpl;
@Autowired
PvHealthIndexDayMapper pvHealthIndexDayMapper;
......@@ -283,8 +287,13 @@ public class IdxBizPvHealthIndexController extends BaseController {
int total = pvHealthIndexDayMapper.selectDataTotal(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName, orgCode);
if(CollectionUtils.isEmpty(fanHealthIndexDays)){
fanHealthIndexDays = pvHealthIndexDayMapper.selectLatestData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, null, null, equipmentName, 0,1,orgCode);
total = 1;
fanHealthIndexDays = pvHealthIndexDayMapper.selectLatestData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, null, null, equipmentName, (current-1)*size,size,orgCode);
if(CollectionUtils.isEmpty(fanHealthIndexDays)){
logger.warn("根据条件:area:{},station:{},equipmentName:{},subarray:{},pointName:{},analysisObjType:{}获取最新的数据为空",area,station,equipmentName,subarray,pointName,analysisObjType);
total = 0;
}else{
total = fanHealthIndexDays.size();
}
}
fanHealthIndexDays.forEach(item -> {
item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex())));
......@@ -304,8 +313,13 @@ public class IdxBizPvHealthIndexController extends BaseController {
List<PvHealthIndexHour> fanHealthIndexHours = pvHealthIndexHourMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size, orgCode);
int total = pvHealthIndexHourMapper.selectDataTotal(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, orgCode);
if(CollectionUtils.isEmpty(fanHealthIndexHours)){
fanHealthIndexHours = pvHealthIndexHourMapper.selectLatestData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, null, null, equipmentName, 0,1,orgCode);
total = 1;
fanHealthIndexHours = pvHealthIndexHourMapper.selectLatestData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, null, null, equipmentName, (current-1)*size,size,orgCode);
if(CollectionUtils.isEmpty(fanHealthIndexHours)){
logger.warn("根据条件:area:{},station:{},equipmentName:{},subarray:{},pointName:{},analysisObjType:{}获取最新的数据为空",area,station,equipmentName,subarray,pointName,analysisObjType);
total = 0;
}else{
total = fanHealthIndexHours.size();
}
}
fanHealthIndexHours.forEach(item -> {
item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex())));
......@@ -325,8 +339,13 @@ public class IdxBizPvHealthIndexController extends BaseController {
List<PvHealthIndexMoment> fanHealthIndexMoments = pvHealthIndexMomentMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size, orgCode);
int total = pvHealthIndexMomentMapper.selectDataTotal(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, orgCode);
if(CollectionUtils.isEmpty(fanHealthIndexMoments)){
fanHealthIndexMoments = pvHealthIndexMomentMapper.selectLatestData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, null, null, equipmentName, 0,1,orgCode);
total = 1;
fanHealthIndexMoments = pvHealthIndexMomentMapper.selectLatestData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, null, null, equipmentName, (current-1)*size,size,orgCode);
if(CollectionUtils.isEmpty(fanHealthIndexMoments)){
logger.warn("根据条件:area:{},station:{},equipmentName:{},subarray:{},pointName:{},analysisObjType:{}获取最新的数据为空",area,station,equipmentName,subarray,pointName,analysisObjType);
total = 0;
}else{
total = fanHealthIndexMoments.size();
}
}
fanHealthIndexMoments.forEach(item -> {
item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex())));
......
......@@ -157,8 +157,8 @@ public class TDBigScreenAnalyseController extends BaseController {
wrapper.eq(FanHealthIndex::getAnalysisType, "按10分钟");
if (CharSequenceUtil.isNotEmpty(stationCode)) {
StationBasic stationBasic = stationBasicMapper.selectById(stationCode);
stationCode = stationBasic.getFanGatewayId();
if ("FDZ".equals(stationBasic.getStationType())) {
stationCode = stationBasic.getFanGatewayId();
wrapper.eq(FanHealthIndex::getAnalysisObjType, "场站");
wrapper.eq(FanHealthIndex::getGatewayId, stationCode);
FanHealthIndex fanHealthIndex = fanHealthIndexMapper.selectOne(wrapper);
......@@ -342,7 +342,7 @@ public class TDBigScreenAnalyseController extends BaseController {
} else {
LambdaQueryWrapper<PvHealthIndex> pvwrapper = new LambdaQueryWrapper<PvHealthIndex>();
pvwrapper.eq(PvHealthIndex::getAnalysisObjType, "场站");
pvwrapper.eq(PvHealthIndex::getGatewayId, stationCode);
pvwrapper.eq(PvHealthIndex::getGatewayId, finalStationCode);
pvwrapper.orderByDesc(PvHealthIndex::getTs);
pvwrapper.last("limit 15");
List<PvHealthIndex> pvHealthIndexList = pvHealthIndexMapper.selectList(pvwrapper);
......
......@@ -88,19 +88,41 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
@Param("orgCode") String orgCode
);
@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" +
"<if test='endTimeTop!= null'> and ts &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and ts &gt;= #{startTimeTop} </if> " +
"<if test='area!= null'> AND area = #{area} </if> " +
"<if test='indexAddress!= null'> AND index_address = #{indexAddress} </if> " +
"<if test='pointName!= null'>AND point_name = #{pointName} </if> " +
"<if test='station!= null'>AND station = #{station} </if>" +
"<if test='healthLevel!= null'>AND health_level = #{healthLevel} </if>" +
@Select("<script>"+
"SELECT distinct d.`health_index` AS healthIndex,d.rec_date as recDate, d.`health_index` AS `value`, d.anomaly, substr(d.analysis_time,1,10) as analysisTime,d.station,d.equipment_name AS equipmentName, d.point_name as pointName, ( CASE d.HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status" +
" FROM analysis_data.fan_health_index_day d" +
" INNER JOIN (SELECT last(ts) as maxTs " +
"<if test='area!= null '> ,area </if> " +
"<if test='station!= null'>, station </if>" +
"<if test='subSystem!= null'>, sub_system </if> " +
"<if test='equipmentName!= null'>, equipment_name </if>" +
"<if test='pointName!= null '>, point_name </if> " +
" FROM analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType} " +
" GROUP BY " +
"<if test='area!= null '> area </if> " +
"<if test='station!= null'>, station </if>" +
"<if test='subSystem!= null'>, sub_system </if> " +
"<if test='equipmentName!= null'>, equipment_name </if>" +
"<if test='pointName!= null '>, point_name </if> " +
" ORDER BY ts ASC ) as c " +
" on d.ts = c.maxTs" +
"<if test='area!= null '> and d.area = c.area </if> " +
"<if test='station!= null'> and d.station = c.station </if>" +
"<if test='subSystem!= null'> and d.sub_system = c.sub_system </if> " +
"<if test='equipmentName!= null'> and d.equipment_name = c.equipment_name </if>" +
"<if test='pointName!= null '> and d.point_name = c.point_name </if> " +
"WHERE d.analysis_obj_type = #{analysisObjType} and d.org_code is not null" +
"<if test='endTimeTop!= null'> and d.ts &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and d.ts &gt;= #{startTimeTop} </if> " +
"<if test='area!= null '> AND d.area = #{area} </if> " +
"<if test='indexAddress!= null '> AND d.index_address = #{indexAddress} </if> " +
"<if test='pointName!= null '>AND d.point_name = #{pointName} </if> " +
"<if test='station!= null'>AND d.station = #{station} </if>" +
"<if test='healthLevel!= null '>AND d.health_level = #{healthLevel} </if>" +
"<if test='subSystem!= null'>AND sub_system = #{subSystem} </if> " +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" +
"<if test='orgCode!= null'>AND org_code like '${orgCode}' </if>" +
"order by ts " +
"<if test='equipmentName!= null'>AND d.equipment_name = #{equipmentName} </if>" +
"<if test='orgCode!= null'>AND d.org_code like '${orgCode}' </if>" +
"order by d.ts DESC "+
"<if test='current != null and size != null'>limit ${current},${size} </if>" +
"</script>")
List<FanHealthIndexDay> selectLatestData(@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,
......
......@@ -111,19 +111,40 @@ public interface PvHealthIndexDayMapper extends BaseMapper<PvHealthIndexDay> {
@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" +
" FROM analysis_data.pv_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null" +
"<if test='endTimeTop!= null'> and ts &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and ts &gt;= #{startTimeTop} </if> " +
"<if test='area!= null '> AND area = #{area} </if> " +
"<if test='indexAddress!= null '> AND index_address = #{indexAddress} </if> " +
"<if test='pointName!= null '>AND point_name = #{pointName} </if> " +
"<if test='station!= null'>AND station = #{station} </if>" +
"<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>" +
"<if test='subarray!= null'>AND subarray = #{subarray} </if> " +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" +
"<if test='orgCode!= null'>AND org_code like '${orgCode}' </if>" +
"order by health_index "+
"SELECT distinct d.`health_index` AS healthIndex,d.rec_date as recDate, d.`health_index` AS `value`, d.anomaly, substr(d.analysis_time,1,10) as analysisTime,d.station,d.equipment_name AS equipmentName, d.point_name as pointName, d.index_address as indexAddress, ( CASE d.HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status" +
" FROM analysis_data.pv_health_index_day d" +
" INNER JOIN (SELECT last(ts) as maxTs " +
"<if test='area!= null '> ,area </if> " +
"<if test='station!= null'>, station </if>" +
"<if test='subarray!= null'>, subarray </if> " +
"<if test='equipmentName!= null'>, equipment_name </if>" +
"<if test='pointName!= null '>, point_name </if> " +
" FROM analysis_data.pv_health_index_day WHERE analysis_obj_type = #{analysisObjType} " +
" GROUP BY " +
"<if test='area!= null '> area </if> " +
"<if test='station!= null'>, station </if>" +
"<if test='subarray!= null'>, subarray </if> " +
"<if test='equipmentName!= null'>, equipment_name </if>" +
"<if test='pointName!= null '>, point_name </if> " +
" ORDER BY ts ASC ) as c " +
" on d.ts = c.maxTs" +
"<if test='area!= null '> and d.area = c.area </if> " +
"<if test='station!= null'> and d.station = c.station </if>" +
"<if test='subarray!= null'> and d.subarray = c.subarray </if> " +
"<if test='equipmentName!= null'> and d.equipment_name = c.equipment_name </if>" +
"<if test='pointName!= null '> and d.point_name = c.point_name </if> " +
"WHERE d.analysis_obj_type = #{analysisObjType} and d.org_code is not null" +
"<if test='endTimeTop!= null'> and d.ts &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and d.ts &gt;= #{startTimeTop} </if> " +
"<if test='area!= null '> AND d.area = #{area} </if> " +
"<if test='indexAddress!= null '> AND d.index_address = #{indexAddress} </if> " +
"<if test='pointName!= null '>AND d.point_name = #{pointName} </if> " +
"<if test='station!= null'>AND d.station = #{station} </if>" +
"<if test='healthLevel!= null '>AND d.health_level = #{healthLevel} </if>" +
"<if test='subarray!= null'>AND d.subarray = #{subarray} </if> " +
"<if test='equipmentName!= null'>AND d.equipment_name = #{equipmentName} </if>" +
"<if test='orgCode!= null'>AND d.org_code like '${orgCode}' </if>" +
"order by d.ts DESC "+
"<if test='current != null and size != null'>limit ${current},${size} </if>" +
"</script>")
List<PvHealthIndexDay> selectLatestData(@Param("station")String station,
......
......@@ -79,19 +79,40 @@ public interface PvHealthIndexHourMapper extends BaseMapper<PvHealthIndexHour> {
@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" +
" FROM analysis_data.pv_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null" +
"<if test='endTimeTop!= null'> and ts &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and ts &gt;= #{startTimeTop} </if> " +
"<if test='area!= null '> AND area = #{area} </if> " +
"<if test='indexAddress!= null '> AND index_address = #{indexAddress} </if> " +
"<if test='pointName!= null '>AND point_name = #{pointName} </if> " +
"<if test='station!= null'>AND station = #{station} </if>" +
"<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>" +
"<if test='subarray!= null'>AND subarray = #{subarray} </if> " +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" +
"<if test='orgCode!= null'>AND org_code like '${orgCode}' </if>" +
"order by health_index "+
"SELECT distinct d.`health_index` AS healthIndex,d.rec_date as recDate, d.`health_index` AS `value`, d.anomaly, substr(d.analysis_time,1,10) as analysisTime,d.station,d.equipment_name AS equipmentName, d.point_name as pointName, d.index_address as indexAddress, ( CASE d.HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status" +
" FROM analysis_data.pv_health_index_hour d" +
" INNER JOIN (SELECT last(ts) as maxTs " +
"<if test='area!= null '> ,area </if> " +
"<if test='station!= null'>, station </if>" +
"<if test='subarray!= null'>, subarray </if> " +
"<if test='equipmentName!= null'>, equipment_name </if>" +
"<if test='pointName!= null '>, point_name </if> " +
" FROM analysis_data.pv_health_index_hour WHERE analysis_obj_type = #{analysisObjType} " +
" GROUP BY " +
"<if test='area!= null '> area </if> " +
"<if test='station!= null'>, station </if>" +
"<if test='subarray!= null'>, subarray </if> " +
"<if test='equipmentName!= null'>, equipment_name </if>" +
"<if test='pointName!= null '>, point_name </if> " +
" ORDER BY ts ASC ) as c " +
" on d.ts = c.maxTs" +
"<if test='area!= null '> and d.area = c.area </if> " +
"<if test='station!= null'> and d.station = c.station </if>" +
"<if test='subarray!= null'> and d.subarray = c.subarray </if> " +
"<if test='equipmentName!= null'> and d.equipment_name = c.equipment_name </if>" +
"<if test='pointName!= null '> and d.point_name = c.point_name </if> " +
"WHERE d.analysis_obj_type = #{analysisObjType} and d.org_code is not null" +
"<if test='endTimeTop!= null'> and d.ts &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and d.ts &gt;= #{startTimeTop} </if> " +
"<if test='area!= null '> AND d.area = #{area} </if> " +
"<if test='indexAddress!= null '> AND d.index_address = #{indexAddress} </if> " +
"<if test='pointName!= null '>AND d.point_name = #{pointName} </if> " +
"<if test='station!= null'>AND d.station = #{station} </if>" +
"<if test='healthLevel!= null '>AND d.health_level = #{healthLevel} </if>" +
"<if test='subarray!= null'>AND d.subarray = #{subarray} </if> " +
"<if test='equipmentName!= null'>AND d.equipment_name = #{equipmentName} </if>" +
"<if test='orgCode!= null'>AND d.org_code like '${orgCode}' </if>" +
"order by d.ts DESC "+
"<if test='current != null and size != null'>limit ${current},${size} </if>" +
"</script>")
List<PvHealthIndexHour> selectLatestData(@Param("station")String station,
......
......@@ -78,19 +78,40 @@ public interface PvHealthIndexMomentMapper extends BaseMapper<PvHealthIndexMomen
, @Param("current") Integer current, @Param("size") Integer size, @Param("orgCode") String orgCode);
@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" +
" FROM analysis_data.pv_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null" +
"<if test='endTimeTop!= null'> and ts &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and ts &gt;= #{startTimeTop} </if> " +
"<if test='area!= null '> AND area = #{area} </if> " +
"<if test='indexAddress!= null '> AND index_address = #{indexAddress} </if> " +
"<if test='pointName!= null '>AND point_name = #{pointName} </if> " +
"<if test='station!= null'>AND station = #{station} </if>" +
"<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>" +
"<if test='subarray!= null'>AND subarray = #{subarray} </if> " +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" +
"<if test='orgCode!= null'>AND org_code like '${orgCode}' </if>" +
"order by health_index "+
"SELECT distinct d.`health_index` AS healthIndex,d.rec_date as recDate, d.`health_index` AS `value`, d.anomaly, substr(d.analysis_time,1,10) as analysisTime,d.station,d.equipment_name AS equipmentName, d.point_name as pointName, d.index_address as indexAddress, ( CASE d.HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status" +
" FROM analysis_data.pv_health_index_moment d" +
" INNER JOIN (SELECT last(ts) as maxTs " +
"<if test='area!= null '> ,area </if> " +
"<if test='station!= null'>, station </if>" +
"<if test='subarray!= null'>, subarray </if> " +
"<if test='equipmentName!= null'>, equipment_name </if>" +
"<if test='pointName!= null '>, point_name </if> " +
" FROM analysis_data.pv_health_index_moment WHERE analysis_obj_type = #{analysisObjType} " +
" GROUP BY " +
"<if test='area!= null '> area </if> " +
"<if test='station!= null'>, station </if>" +
"<if test='subarray!= null'>, subarray </if> " +
"<if test='equipmentName!= null'>, equipment_name </if>" +
"<if test='pointName!= null '>, point_name </if> " +
" ORDER BY ts ASC ) as c " +
" on d.ts = c.maxTs" +
"<if test='area!= null '> and d.area = c.area </if> " +
"<if test='station!= null'> and d.station = c.station </if>" +
"<if test='subarray!= null'> and d.subarray = c.subarray </if> " +
"<if test='equipmentName!= null'> and d.equipment_name = c.equipment_name </if>" +
"<if test='pointName!= null '> and d.point_name = c.point_name </if> " +
"WHERE d.analysis_obj_type = #{analysisObjType} and d.org_code is not null" +
"<if test='endTimeTop!= null'> and d.ts &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and d.ts &gt;= #{startTimeTop} </if> " +
"<if test='area!= null '> AND d.area = #{area} </if> " +
"<if test='indexAddress!= null '> AND d.index_address = #{indexAddress} </if> " +
"<if test='pointName!= null '>AND d.point_name = #{pointName} </if> " +
"<if test='station!= null'>AND d.station = #{station} </if>" +
"<if test='healthLevel!= null '>AND d.health_level = #{healthLevel} </if>" +
"<if test='subarray!= null'>AND d.subarray = #{subarray} </if> " +
"<if test='equipmentName!= null'>AND d.equipment_name = #{equipmentName} </if>" +
"<if test='orgCode!= null'>AND d.org_code like '${orgCode}' </if>" +
"order by d.ts DESC "+
"<if test='current != null and size != null'>limit ${current},${size} </if>" +
"</script>")
List<PvHealthIndexMoment> selectLatestData(@Param("station")String station,
......
......@@ -504,8 +504,8 @@ FROM (
<select id="getFanInfoByPage" resultType="java.util.Map">
SELECT
EQUIPMENT_NAME as equipmentName,
INDEX_ADDRESS as indexAddress,
STATION as station
max(INDEX_ADDRESS) as indexAddress,
max(STATION) as station
FROM
idx_biz_fan_point_process_variable_classification
<where>
......@@ -539,7 +539,7 @@ FROM (
<select id="getSumSystemListByEquipment" resultType="java.util.Map">
SELECT
SUB_SYSTEM as subSystem,
INDEX_ADDRESS as indexAddress
max(INDEX_ADDRESS) as indexAddress
FROM
idx_biz_fan_point_process_variable_classification
<where>
......@@ -737,8 +737,8 @@ FROM (
<select id="getPvPointNameListBySumSystem" resultType="java.util.Map">
SELECT
POINT_NAME as pointName,
INDEX_ADDRESS as indexAddress,
STATION AS station
MAX(INDEX_ADDRESS) as indexAddress,
MAX(STATION) AS station
FROM
idx_biz_pv_point_process_variable_classification
<where>
......
......@@ -211,6 +211,6 @@
area_code = #{areaCode}
and
is_delete = 0
ORDER BY sequence_nbr ASC
</select>
</mapper>
......@@ -11,13 +11,20 @@
FROM
(
SELECT
DATE_FORMAT( DATE_ADD(( DATE( DATE_ADD( now(), INTERVAL - 7 DAY ))), INTERVAL @s DAY ), '%Y-%m-%d' ) AS date,
@s := @s + 1 AS `index`
FROM
mysql.help_topic,
( SELECT @s := 1 ) temp
WHERE
DATEDIFF( now(), DATE( DATE_ADD( now(), INTERVAL - 7 DAY )) ) >= @s ) a
DATE_FORMAT(get_time_sub(6,'DAY'), '%Y-%m-%d' ) AS date UNION ALL
SELECT
DATE_FORMAT(get_time_sub(5,'DAY'), '%Y-%m-%d' ) AS date UNION ALL
SELECT
DATE_FORMAT(get_time_sub(4,'DAY'), '%Y-%m-%d' ) AS date UNION ALL
SELECT
DATE_FORMAT(get_time_sub(3,'DAY'), '%Y-%m-%d' ) AS date UNION ALL
SELECT
DATE_FORMAT(get_time_sub(2,'DAY'), '%Y-%m-%d' ) AS date UNION ALL
SELECT
DATE_FORMAT(get_time_sub(1,'DAY'), '%Y-%m-%d' ) AS date UNION ALL
SELECT
DATE_FORMAT( CURDATE(), '%Y-%m-%d' ) AS date
) a
LEFT JOIN
( SELECT * FROM station_qr_code_statistics
<where>
......
......@@ -845,11 +845,12 @@ public class MonitorFanIdxController extends BaseController {
SimpleDateFormat myFmt2 = new SimpleDateFormat("yyyy");
String monthy = myFmt2.format(new Date());
QueryWrapper<StationPlan> wrapper = new QueryWrapper<>();
wrapper.select(" monthly ,sum(value) value ");
wrapper.select(" monthly ,sum(value) as data_value ");
wrapper.eq("year", monthy);
wrapper.eq("station_basic_id", stationBasic.getSequenceNbr());
wrapper.groupBy("monthly");
List<Map<String, Object>> list1 = StationPlanMapper.selectMaps(wrapper);
Double sumValue = list1 != null && !list1.isEmpty() ? (Double) list1.get(0).get("value") : 0;
Double sumValue = list1 != null && !list1.isEmpty() ? (Double) list1.get(0).get("data_value") : 0;
columnMap.put("年发电量完成率(%)", String.format("%.2f", Double.parseDouble(columnMap.get("年发电量").toString()) / sumValue * 100));
......
......@@ -1208,6 +1208,10 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
public void getListByFJ(String gatewayId, String werks, String stationId) {
if(werks==null||StringUtils.isEmpty(werks))
{
return;
}
HashMap<String, String> fanstatutsHashMap = new HashMap<>();
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
Map<String, List<String>> queryCondtion = new HashMap<>();
......
......@@ -61,7 +61,7 @@
B.FSB
</select>
<select id="getStationInfoMapByStationGFWerksNew" resultType="com.yeejoin.amos.boot.module.jxiop.biz.entity.SjglZsjZsbtz">
<select id="getStationInfoMapByStationGFWerksNew" resultType="map">
SELECT
REPLACE(sjgl_zsj_zsbtz.SBMC, '光伏阵区系统', '') as equipNum,
......
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