Commit e5c2a2ae authored by lilongyang's avatar lilongyang

1、解决风电/光伏监测,查询左侧列表结果为空,默认获取当前最新的一条数据

parent 452273cb
......@@ -405,7 +405,7 @@ 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);
fanHealthIndexDays = fanHealthIndexDayMapper.selectLatestData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, null, null,(current-1)*size,size, orgCode);
total = 1;
}
fanHealthIndexDays.forEach(item -> {
......
......@@ -283,7 +283,7 @@ 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);
fanHealthIndexDays = pvHealthIndexDayMapper.selectLatestData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, null, null, equipmentName, (current-1)*size,size,orgCode);
total = 1;
}
fanHealthIndexDays.forEach(item -> {
......@@ -304,7 +304,7 @@ 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);
fanHealthIndexHours = pvHealthIndexHourMapper.selectLatestData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, null, null, equipmentName, (current-1)*size,size,orgCode);
total = 1;
}
fanHealthIndexHours.forEach(item -> {
......@@ -325,7 +325,7 @@ 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);
fanHealthIndexMoments = pvHealthIndexMomentMapper.selectLatestData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, null, null, equipmentName, (current-1)*size,size,orgCode);
total = 1;
}
fanHealthIndexMoments.forEach(item -> {
......
......@@ -123,7 +123,7 @@ public interface PvHealthIndexDayMapper extends BaseMapper<PvHealthIndexDay> {
"<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 "+
"order by ts "+
"<if test='current != null and size != null'>limit ${current},${size} </if>" +
"</script>")
List<PvHealthIndexDay> selectLatestData(@Param("station")String station,
......
......@@ -91,7 +91,7 @@ public interface PvHealthIndexHourMapper extends BaseMapper<PvHealthIndexHour> {
"<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 "+
"order by ts "+
"<if test='current != null and size != null'>limit ${current},${size} </if>" +
"</script>")
List<PvHealthIndexHour> selectLatestData(@Param("station")String station,
......
......@@ -90,7 +90,7 @@ public interface PvHealthIndexMomentMapper extends BaseMapper<PvHealthIndexMomen
"<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 "+
"order by ts "+
"<if test='current != null and size != null'>limit ${current},${size} </if>" +
"</script>")
List<PvHealthIndexMoment> selectLatestData(@Param("station")String station,
......
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