查询暂降事件
This commit is contained in:
@@ -0,0 +1,23 @@
|
|||||||
|
package com.njcn.influx.imapper;
|
||||||
|
|
||||||
|
|
||||||
|
import com.njcn.influx.base.InfluxDbBaseMapper;
|
||||||
|
|
||||||
|
import com.njcn.influx.pojo.po.cs.EntData;
|
||||||
|
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/5/5 14:39
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface EvtDataMapper extends InfluxDbBaseMapper<EntData> {
|
||||||
|
|
||||||
|
|
||||||
|
List<EntData> getEventData(InfluxQueryWrapper influxQueryWrapper);
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.njcn.influx.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/8/30 18:38【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EventQueryDTO {
|
||||||
|
private String devId;
|
||||||
|
private List<String> lineIds;
|
||||||
|
private List<String> target;
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.njcn.influx.pojo.po.cs;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.njcn.common.utils.serializer.InstantDateSerializer;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.influxdb.annotation.Column;
|
||||||
|
import org.influxdb.annotation.Measurement;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/4/7 10:00
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Measurement(name = "evt_data")
|
||||||
|
public class EntData {
|
||||||
|
|
||||||
|
@Column(name = "time")
|
||||||
|
@JsonSerialize(using = InstantDateSerializer.class)
|
||||||
|
private Instant time;
|
||||||
|
|
||||||
|
@Column(name = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@Column(name = "sec")
|
||||||
|
private String sec;
|
||||||
|
|
||||||
|
@Column(name = "target")
|
||||||
|
private String target;
|
||||||
|
|
||||||
|
@Column(name = "evt_vva")
|
||||||
|
private Double evtVva;
|
||||||
|
|
||||||
|
@Column(name = "evt_vvadepth")
|
||||||
|
private Double evtVvadepth;
|
||||||
|
|
||||||
|
@Column(name = "evt_vvaphase")
|
||||||
|
private String evtVvaphase;
|
||||||
|
|
||||||
|
@Column(name = "evt_vvatm")
|
||||||
|
private Double evtVvatm;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.njcn.influx.service;
|
||||||
|
|
||||||
|
import com.njcn.influx.pojo.dto.EventQueryDTO;
|
||||||
|
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
||||||
|
import com.njcn.influx.pojo.po.cs.EntData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/6/2 16:00【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface EvtDataService {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: getEventData
|
||||||
|
* @Param:
|
||||||
|
* @return: java.util.List<com.njcn.influx.pojo.po.cs.EntData>
|
||||||
|
* @Author: clam
|
||||||
|
* @Date: 2023/8/30
|
||||||
|
*/
|
||||||
|
List<EntData> getEventData(EventQueryDTO eventQueryDTO);
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.njcn.influx.service.impl;
|
||||||
|
|
||||||
|
import com.njcn.influx.imapper.CommonMapper;
|
||||||
|
import com.njcn.influx.imapper.EvtDataMapper;
|
||||||
|
import com.njcn.influx.pojo.constant.InfluxDBTableConstant;
|
||||||
|
import com.njcn.influx.pojo.dto.EventQueryDTO;
|
||||||
|
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
||||||
|
import com.njcn.influx.pojo.po.cs.EntData;
|
||||||
|
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||||
|
import com.njcn.influx.service.EvtDataService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/8/30 19:08【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class EvtDataServiceImpl implements EvtDataService {
|
||||||
|
private final EvtDataMapper commonMapper;
|
||||||
|
@Override
|
||||||
|
public List<EntData> getEventData(EventQueryDTO eventQueryDTO) {
|
||||||
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper("evt_data", EntData.class);
|
||||||
|
influxQueryWrapper.select(EntData::getLineId,EntData::getTarget,EntData::getTime,EntData::getTime,
|
||||||
|
EntData::getEvtVva,EntData::getSec,EntData::getEvtVvaphase,EntData::getEvtVvadepth,
|
||||||
|
EntData::getEvtVvatm)
|
||||||
|
.or(InfluxDBTableConstant.LINE_ID,eventQueryDTO.getLineIds())
|
||||||
|
.or("target",eventQueryDTO.getTarget());
|
||||||
|
|
||||||
|
|
||||||
|
return commonMapper.getEventData(influxQueryWrapper);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user