oralce同步到influxDB
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
package com.njcn.influx.config;
|
||||
|
||||
import com.njcn.influx.bo.po.PqLineBak;
|
||||
import com.njcn.influx.mapper.PqLineBakMapper;
|
||||
import com.njcn.influx.service.PqLineBakService;
|
||||
import io.swagger.v3.oas.annotations.servers.Server;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2024/1/17 14:36【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Component
|
||||
public class IdMappingCache {
|
||||
|
||||
@Autowired
|
||||
private PqLineBakService pqLineBakService;
|
||||
|
||||
public static Map<String, String> IdMapping = new HashMap<>();
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
List<PqLineBak> resultList = pqLineBakService.list();
|
||||
for (PqLineBak row : resultList) {
|
||||
String id = row.getId();
|
||||
String line_id = row.getLineId();
|
||||
IdMapping.put(line_id,id );
|
||||
}
|
||||
}
|
||||
|
||||
public String getDataById(String id) {
|
||||
return IdMapping.get(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user