转换提交

This commit is contained in:
2024-03-01 11:13:26 +08:00
parent d334bb01ec
commit 6f76a4f420
10 changed files with 471 additions and 10 deletions

View File

@@ -0,0 +1,168 @@
package com.njcn.influx.bo.po;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
/**
* data-migration
*
* @author cdf
* @date 2024/2/19
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("PQS_EVENTDETAIL")
public class OracleRmpEventDetailPO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 暂时事件ID
*/
@TableId(value = "EVENTDETAIL_INDEX",type = IdType.ASSIGN_ID)
private String eventId;
/**
* 监测点ID
*/
@TableField(value = "LINEID")
private String measurementPointId;
/**
* 统计指标类型
*/
@TableField(value = "WAVETYPE")
private String eventType;
/**
* 暂降原因字典表PQS_Dicdata
*/
@TableField(value = "EVENTREASON")
private String advanceReason;
/**
* 暂降类型字典表PQS_Dicdata
*/
@TableField(value = "EVENTTYPE")
private String advanceType;
/**
* 事件关联分析表Guid
*/
@TableField(value = "EVENTASS_INDEX")
private String eventassIndex;
@TableField(value = "DQTIME")
private Double dqTime;
/**
* 特征值计算更新时间外键PQS_Relevance的Time字段
*/
@TableField(value = "DEALTIME")
private Date dealTime;
/**
* 默认事件个数为0
*/
@TableField(value = "NUM")
private Integer num;
/**
* 波形文件是否从装置招到本地(0未招1已招)默认值为0
*/
@TableField(value = "FILEFLAG")
private Boolean fileFlag;
/**
* 特征值计算标志0未处理1已处理; 2已处理无结果;3计算失败默认值为0
*/
@TableField(value = "DEALFLAG")
private Boolean dealFlag;
/**
* 处理结果第一条事件发生时间(读comtra文件获取)
*/
@TableField(value = "FIRSTTIME")
private Date firstTime;
/**
* 处理结果第一条事件暂降类型字典表PQS_Dicdata
*/
@TableField(value = "FIRSTTYPE")
private String firstType;
/**
* 处理结果第一条事件发生时间毫秒(读comtra文件获取)
*/
@TableField(value = "FIRSTMS")
private BigDecimal firstMs;
/**
* 暂降能量
*/
@TableField(value = "ENERGY")
private Double energy;
/**
* 暂降严重度
*/
@TableField(value = "SEVERITY")
private Double severity;
/**
* 暂降源与监测位置关系 Upper:上游Lower :下游Unknown :未知;为空则是未计算
*/
@TableField(value = "SAGSOURCE")
private String sagsource;
/**
* 开始时间
*/
@TableField(value = "TIMEID")
private Date startTime;
/**
* 持续时间,单位秒
*/
@TableField(value = "PERSISTTIME")
private BigDecimal duration;
/**
* 特征幅值
*/
@TableField(value = "EVENTVALUE")
private BigDecimal featureAmplitude;
/**
* 相别
*/
@TableField(value = "PHASIC_TYPE")
private String phase;
/**
* 事件描述
*/
@TableField(value = "DESCRIBE")
private String eventDescribe;
/**
* 波形路径
*/
@TableField(value = "WAVENAME")
private String wavePath;
@TableField(value = "TRANSIENTVALUE")
private Double transientValue;
}

View File

@@ -0,0 +1,174 @@
package com.njcn.influx.bo.po;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
/**
* data-migration
*
* @author cdf
* @date 2024/2/19
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("r_mp_event_detail")
@ApiModel(value="RmpEventDetail对象", description="")
public class RmpEventDetailPO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 暂时事件ID
*/
@TableId(value = "event_id")
private String eventId;
/**
* 监测点ID
*/
@TableField(value = "measurement_point_id")
private String measurementPointId;
/**
* 统计指标类型
*/
@TableField(value = "event_type")
private String eventType;
/**
* 暂降原因字典表PQS_Dicdata
*/
@TableField(value = "advance_reason")
private String advanceReason;
/**
* 暂降类型字典表PQS_Dicdata
*/
@TableField(value = "advance_type")
private String advanceType;
/**
* 事件关联分析表Guid
*/
@TableField(value = "eventass_index")
private String eventassIndex;
@TableField(value = "dq_time")
private Double dqTime;
/**
* 特征值计算更新时间外键PQS_Relevance的Time字段
*/
@TableField(value = "deal_time")
private Date dealTime;
/**
* 默认事件个数为0
*/
@TableField(value = "num")
private Integer num;
/**
* 波形文件是否从装置招到本地(0未招1已招)默认值为0
*/
@TableField(value = "file_flag")
private Boolean fileFlag;
/**
* 特征值计算标志0未处理1已处理; 2已处理无结果;3计算失败默认值为0
*/
@TableField(value = "deal_flag")
private Boolean dealFlag;
/**
* 处理结果第一条事件发生时间(读comtra文件获取)
*/
@TableField(value = "first_time")
private Date firstTime;
/**
* 处理结果第一条事件暂降类型字典表PQS_Dicdata
*/
@TableField(value = "first_type")
private String firstType;
/**
* 处理结果第一条事件发生时间毫秒(读comtra文件获取)
*/
@TableField(value = "first_ms")
private BigDecimal firstMs;
/**
* 暂降能量
*/
@TableField(value = "energy")
private Double energy;
/**
* 暂降严重度
*/
@TableField(value = "severity")
private Double severity;
/**
* 暂降源与监测位置关系 Upper:上游Lower :下游Unknown :未知;为空则是未计算
*/
@TableField(value = "sagsource")
private String sagsource;
/**
* 开始时间
*/
@TableField(value = "start_time")
private Date startTime;
/**
* 持续时间,单位秒
*/
@TableField(value = "duration")
private BigDecimal duration;
/**
* 特征幅值
*/
@TableField(value = "feature_amplitude")
private BigDecimal featureAmplitude;
/**
* 相别
*/
@TableField(value = "phase")
private String phase;
/**
* 事件描述
*/
@TableField(value = "event_describe")
private String eventDescribe;
/**
* 波形路径
*/
@TableField(value = "wave_path")
private String wavePath;
/**
* 暂态事件上送时间
*/
@TableField(value = "create_time")
private Date createTime;
@TableField(value = "transient_value")
private Double transientValue;
}

View File

@@ -0,0 +1,17 @@
package com.njcn.influx.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.influx.base.InfluxDbBaseMapper;
import com.njcn.influx.bo.po.OracleRmpEventDetailPO;
/**
* data-migration
*
* @author cdf
* @date 2024/2/19
*/
@DS("master")
public interface OracleRmpEventDetailPOMapper extends BaseMapper<OracleRmpEventDetailPO> {
}

View File

@@ -0,0 +1,18 @@
package com.njcn.influx.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.influx.base.InfluxDbBaseMapper;
import com.njcn.influx.bo.po.OracleRmpEventDetailPO;
import com.njcn.influx.bo.po.RmpEventDetailPO;
/**
* data-migration
*
* @author cdf
* @date 2024/2/19
*/
@DS("target")
public interface RmpEventDetailPOMapper extends BaseMapper<RmpEventDetailPO> {
}

View File

@@ -0,0 +1,17 @@
package com.njcn.influx.service;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* data-migration
*
* @author cdf
* @date 2024/2/19
*/
public interface OracleEventDetailToMysqlService {
void eventBatch(LocalDateTime start, LocalDateTime end);
}

View File

@@ -0,0 +1,50 @@
package com.njcn.influx.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.njcn.influx.bo.po.OracleRmpEventDetailPO;
import com.njcn.influx.bo.po.RmpEventDetailPO;
import com.njcn.influx.mapper.OracleRmpEventDetailPOMapper;
import com.njcn.influx.mapper.RmpEventDetailPOMapper;
import com.njcn.influx.service.OracleEventDetailToMysqlService;
import com.njcn.influx.service.PqLineBakService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List;
/**
* data-migration
*
* @author cdf
* @date 2024/2/19
*/
@RequiredArgsConstructor
@Service
public class OracleEventDetailToMysqlServiceImpl implements OracleEventDetailToMysqlService {
private final PqLineBakService pqLineBakService;
private final OracleRmpEventDetailPOMapper oracleRmpEventDetailPOMapper;
private final RmpEventDetailPOMapper rmpEventDetailPOMapper;
@Override
public void eventBatch(LocalDateTime start, LocalDateTime end){
List<OracleRmpEventDetailPO> oracleRmpEventDetailPOList = oracleRmpEventDetailPOMapper.selectList(new LambdaQueryWrapper<OracleRmpEventDetailPO>().between(OracleRmpEventDetailPO::getStartTime,start,end));
List<RmpEventDetailPO> poList = BeanUtil.copyToList(oracleRmpEventDetailPOList, RmpEventDetailPO.class);
System.out.println("55555");
}
}