暂态事件查询事件

This commit is contained in:
huangzj
2023-09-06 14:19:55 +08:00
parent 3035011064
commit 1d6b39609b
15 changed files with 91 additions and 15 deletions

View File

@@ -3,6 +3,7 @@ package com.njcn.influx.imapper;
import com.njcn.influx.base.InfluxDbBaseMapper;
import com.njcn.influx.pojo.dto.EventDataSetDTO;
import com.njcn.influx.pojo.po.cs.EntData;
import com.njcn.influx.query.InfluxQueryWrapper;
@@ -20,4 +21,6 @@ public interface EvtDataMapper extends InfluxDbBaseMapper<EntData> {
List<EntData> getEventData(InfluxQueryWrapper influxQueryWrapper);
EventDataSetDTO getEventDataSet(InfluxQueryWrapper influxQueryWrapper);
}

View File

@@ -162,7 +162,7 @@ public interface InfluxDBTableConstant {
String CL_DID = "cl_did";
/**
* 逻辑子设备id
* 逻辑子设备id/暂态事件号
*/
String UUID = "uuid";

View File

@@ -0,0 +1,23 @@
package com.njcn.influx.pojo.dto;
import lombok.Data;
import java.util.List;
/**
* Description:
* Date: 2023/9/6 9:52【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
public class EventDataSetDTO {
private String name;
private String value;
private String type;
private String unit;
private String showName;
}

View File

@@ -12,6 +12,7 @@ import java.util.List;
* @version V1.0.0
*/
@Data
@Deprecated
public class EventQueryDTO {
private String devId;
private List<String> lineIds;

View File

@@ -17,6 +17,7 @@ import java.time.Instant;
*/
@Data
@Measurement(name = "evt_data")
@Deprecated
public class EntData {
@Column(name = "time")

View File

@@ -1,5 +1,6 @@
package com.njcn.influx.service;
import com.njcn.influx.pojo.dto.EventDataSetDTO;
import com.njcn.influx.pojo.dto.EventQueryDTO;
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
import com.njcn.influx.pojo.po.cs.EntData;
@@ -24,5 +25,8 @@ public interface EvtDataService {
* @Author: clam
* @Date: 2023/8/30
*/
@Deprecated
List<EntData> getEventData(EventQueryDTO eventQueryDTO);
EventDataSetDTO getEventDataSet(String tableName,String uuid,String columnName );
}

View File

@@ -3,6 +3,7 @@ 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.EventDataSetDTO;
import com.njcn.influx.pojo.dto.EventQueryDTO;
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
import com.njcn.influx.pojo.po.cs.EntData;
@@ -26,6 +27,7 @@ import java.util.List;
public class EvtDataServiceImpl implements EvtDataService {
private final EvtDataMapper commonMapper;
@Override
@Deprecated
public List<EntData> getEventData(EventQueryDTO eventQueryDTO) {
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper("evt_data", EntData.class);
influxQueryWrapper.select(EntData::getLineId,EntData::getTarget,EntData::getTime,EntData::getTime,
@@ -38,4 +40,14 @@ public class EvtDataServiceImpl implements EvtDataService {
return commonMapper.getEventData(influxQueryWrapper);
}
@Override
public EventDataSetDTO getEventDataSet(String tableName, String uuid, String columnName) {
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(tableName, EventDataSetDTO.class);
influxQueryWrapper.select(columnName,InfluxDBTableConstant.VALUE)
.eq(InfluxDBTableConstant.UUID,uuid);
return commonMapper.getEventDataSet(influxQueryWrapper);
}
}