This commit is contained in:
wr
2024-09-29 16:23:39 +08:00
parent 20d3631efe
commit bc3a6f2fa2
10 changed files with 122 additions and 13 deletions

View File

@@ -101,4 +101,15 @@ public class LineDevGetDTO {
* 接线方式 0.星型 1.星三角 2.三角
*/
private String wiringMethod;
/**
* 监测点统计间隔(解决MySQL关键字问题)
*/
private Integer timeInterval;
public void setTimeInterval(Integer timeInterval) {
this.interval = timeInterval;
this.timeInterval = timeInterval;
}
}

View File

@@ -24,7 +24,7 @@
<if test="type == 1">
pq_dept_line.id unitId,
point.id pointId,
lineDetail.Time_Interval as interval,
lineDetail.Time_Interval as timeInterval,
lineDetail.load_type lineTag,
dic.id voltageLevel,
dev.id devId,

View File

@@ -56,7 +56,7 @@
<select id="getMonitorDetail" resultType="com.njcn.device.biz.pojo.dto.LineDevGetDTO">
select a.id pointId,a.name pointName,b.Time_Interval interval
select a.id pointId,a.name pointName,b.Time_Interval timeInterval
from pq_line a
inner join pq_line_detail b on a.id=b.id
where a.id = #{monitorId}

View File

@@ -1156,7 +1156,7 @@
<select id="getLineBySubStation" resultType="com.njcn.device.biz.pojo.dto.LineDevGetDTO">
SELECT
pq_line.id pointId,
lineDetail.Time_Interval interval,
lineDetail.Time_Interval timeInterval,
dev.id devId,
device.com_flag
FROM
@@ -1177,7 +1177,7 @@
</select>
<select id="getMonitorListDetail" resultType="com.njcn.device.biz.pojo.dto.LineDevGetDTO">
select line.id pointId,dev.id devId,0 type,1 lineType,lineDetail.Time_Interval as interval
select line.id pointId,dev.id devId,0 type,1 lineType,lineDetail.Time_Interval as timeInterval
from pq_line line
inner join pq_line_detail lineDetail on line.id = lineDetail.id
inner join pq_line subv on line.pid = subv.id

View File

@@ -188,6 +188,7 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
@Override
public CommunicateVO getComFlagInfoData(String id, String searchBeginTime, String searchEndTime) {
String devId = lineMapper.getDevIndex(id);
Device device = deviceMapper.selectById(devId);
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
List<PqsCommunicate> communicateList = getCommunicate(devId, searchBeginTime, searchEndTime);
CommunicateVO communicateVOList = new CommunicateVO();
@@ -208,6 +209,7 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
Long time = instant.toEpochMilli();
String timeText = df.format(time);
updateTime.add(timeText);
//取反(正常来时,有变动才会有数据)
if(CollUtil.isNotEmpty(communicateList)){
if(communicateList.get(0).getType()==0){
comType.add(1);
@@ -215,7 +217,7 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
comType.add(0);
}
}else{
comType.add(1);
comType.add(device.getComFlag());
}
}
@@ -248,7 +250,7 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
if(CollUtil.isNotEmpty(communicateList)){
comType.add(communicateList.get(communicateList.size()-1).getType());
}else{
comType.add(1);
comType.add(device.getComFlag());
}
}
communicateVOList.setUpdateTime(updateTime);