冀北完整性功能重新开发
This commit is contained in:
@@ -1535,11 +1535,13 @@
|
||||
<select id="selectByIds" resultType="com.njcn.device.pq.pojo.vo.LineDetailVO$Detail">
|
||||
SELECT DISTINCT
|
||||
line.id as lineId,
|
||||
dept.`Name` deptName,
|
||||
area.name as areaId,
|
||||
gd.NAME gdName,
|
||||
substation.NAME subName,
|
||||
device.id devId,
|
||||
device.NAME devName,
|
||||
deviceDetail.Manufacturer manufacturer,
|
||||
line.NAME lineName,
|
||||
lineDetail.Time_Interval as timeInterval,
|
||||
lineDetail.PT_Type as ptType,
|
||||
@@ -1552,7 +1554,9 @@
|
||||
deviceDetail.ip ip,
|
||||
deviceDetail.Com_Flag as comFlag,
|
||||
vg.Scale as voltageLevel,
|
||||
voltage.name as volName
|
||||
voltage.name as volName,
|
||||
lineDetail.Power_Flag powerFlag,
|
||||
lineDetail.Run_Flag lineRunType
|
||||
FROM
|
||||
pq_line line,
|
||||
pq_line voltage,
|
||||
@@ -1562,9 +1566,13 @@
|
||||
pq_line area,
|
||||
pq_device deviceDetail,
|
||||
pq_line_detail lineDetail,
|
||||
pq_voltage vg
|
||||
pq_voltage vg,
|
||||
pq_dept_line deptLine,
|
||||
sys_dept dept
|
||||
<where>
|
||||
line.pid = voltage.id
|
||||
line.id = deptLine.Line_Id
|
||||
AND deptLine.Id = dept.Id
|
||||
AND line.pid = voltage.id
|
||||
AND voltage.pid = device.id
|
||||
AND device.pid = substation.id
|
||||
AND substation.pid = gd.id
|
||||
|
||||
@@ -528,6 +528,9 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
||||
//获取终端等级
|
||||
List<DictData> gradeType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_GRADE.getCode()).getData();
|
||||
Map<String, Integer> gradeMap = gradeType.stream().collect(Collectors.toMap(DictData::getId, DictData::getAlgoDescribe));
|
||||
//获取厂家
|
||||
List<DictData> manufacturerType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_MANUFACTURER.getCode()).getData();
|
||||
Map<String, String> manufacturerMap = manufacturerType.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
|
||||
|
||||
for (LineDetailVO.Detail detail : details) {
|
||||
//获取行政区域名称
|
||||
@@ -549,6 +552,10 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
||||
detail.setStatisValue(flowVo.getStatisValue());
|
||||
detail.setFlowProportion(flowVo.getFlowProportion() * 100);
|
||||
}
|
||||
//厂家
|
||||
if (manufacturerMap.containsKey(detail.getManufacturer())) {
|
||||
detail.setManufacturer(manufacturerMap.get(detail.getManufacturer()));
|
||||
}
|
||||
}
|
||||
}
|
||||
return details;
|
||||
|
||||
@@ -48,4 +48,12 @@ public interface RStatIntegrityDMapper extends MppBaseMapper<RStatIntegrityD> {
|
||||
* @Date: 2024/1/8 14:01
|
||||
*/
|
||||
Float selectTotalIntegrityByLineIds(@Param("param") LineBaseQueryParam param);
|
||||
|
||||
/**
|
||||
* 获取监测点数据完整性
|
||||
* @author xy
|
||||
* @date 2025/11/25
|
||||
*/
|
||||
List<RStatIntegrityVO> getLineIntegrityRateInfo(@Param("lineIds")List<String> lineIds,@Param("startTime")String startTime,@Param("endTime")String endTime);
|
||||
|
||||
}
|
||||
|
||||
@@ -86,4 +86,28 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getLineIntegrityRateInfo" resultType="RStatIntegrityVO">
|
||||
select line_index lineIndex,
|
||||
ROUND(sum( real_time )*1.0 / sum( due_time ) * 100,2) AS integrityRate,
|
||||
sum(real_time) realTime,
|
||||
sum(due_time) dueTime
|
||||
from r_stat_integrity_d
|
||||
<where>
|
||||
<if test="lineIds!=null and lineIds.size > 0">
|
||||
line_index in
|
||||
<foreach collection="lineIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test=" startTime != null and startTime !=''">
|
||||
AND time_id >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND time_id <= #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
group by line_index
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user