2d3ecf2c 张雷

奥体项目接口修改(添加曲线最大最小值)

1 个父辈 2018bbf1
......@@ -12,9 +12,6 @@ import com.skua.modules.monitor.service.IFmPgQueryService;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.YearMonth;
import java.time.format.DateTimeFormatter;
import java.util.*;
/**
......@@ -23,6 +20,8 @@ import java.util.*;
@Service
public class FmPgQueryServiceImpl implements IFmPgQueryService {
private static String COUNT_TABLENAME = "a01a21a03_count";//奥体项目计算表
@Override
public List<Map<String, Object>> queryFactoryMonitorFromRealTimeData(String factoryId, String fields) {
String[] factoryIdArray = factoryId.split(",");
......@@ -365,7 +364,6 @@ public class FmPgQueryServiceImpl implements IFmPgQueryService {
List<Map<String, Object>> dataList = new ArrayList<>();
//获取数据采集pg数据库,实时数据获取统一从数据采集pg库获取
JdbcTemplate pgDB = (JdbcTemplate)SpringContextUtils.getBean("pg-db");
String countTableName = "a01a21a03_count";
//获取要查询的指标
String fieldSqlPart = "";
String[] fieldsArr = fields.split(",");
......@@ -381,7 +379,7 @@ public class FmPgQueryServiceImpl implements IFmPgQueryService {
String sql = "SELECT nm, " +
" LEFT(TO_CHAR(TO_TIMESTAMP(CAST(ts AS INTEGER)), 'YYYY-MM-DD HH24:MI:SS'), "+strCount+") AS time, " +
" SUM(v::numeric) AS value " +
" FROM " + countTableName +
" FROM " + COUNT_TABLENAME +
" WHERE nm in ("+fieldSqlPart+")" +
" AND type = 'def'" +
" AND ts >= ? AND ts < ? " +
......@@ -399,7 +397,6 @@ public class FmPgQueryServiceImpl implements IFmPgQueryService {
List<Map<String, Object>> dataList = new ArrayList<>();
//获取数据采集pg数据库,实时数据获取统一从数据采集pg库获取
JdbcTemplate pgDB = (JdbcTemplate)SpringContextUtils.getBean("pg-db");
String countTableName = "a01a21a03_count";
//获取要查询的指标
String fieldSqlPart = "";
String[] fieldsArr = fields.split(",");
......@@ -416,7 +413,7 @@ public class FmPgQueryServiceImpl implements IFmPgQueryService {
"SELECT nm, " +
" LEFT(TO_CHAR(TO_TIMESTAMP(CAST(ts AS INTEGER)), 'YYYY-MM-DD HH24:MI:SS'), 7) AS time, " +
" SUM(v::numeric) AS value " +
" FROM " + countTableName +
" FROM " + COUNT_TABLENAME +
" WHERE nm in ("+fieldSqlPart+")" +
" AND type = 'def'" +
" AND ts >= ? AND ts < ? " +
......@@ -436,7 +433,6 @@ public class FmPgQueryServiceImpl implements IFmPgQueryService {
List<Map<String, Object>> dataList = new ArrayList<>();
//获取数据采集pg数据库,实时数据获取统一从数据采集pg库获取
JdbcTemplate pgDB = (JdbcTemplate)SpringContextUtils.getBean("pg-db");
String countTableName = "a01a21a03_count";
//获取要查询的指标
String fieldSqlPart = "";
String[] fieldsArr = fields.split(",");
......@@ -452,7 +448,7 @@ public class FmPgQueryServiceImpl implements IFmPgQueryService {
String sql = "SELECT nm, " +
" LEFT(TO_CHAR(TO_TIMESTAMP(CAST(ts AS INTEGER)), 'YYYY-MM-DD HH24:MI:SS'), 4) AS time, " +
" SUM(v::numeric) AS value " +
" FROM " + countTableName +
" FROM " + COUNT_TABLENAME +
" WHERE nm in ("+fieldSqlPart+")" +
" AND type = 'def'" +
" AND ts >= ? AND ts < ? " +
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!