|
@@ -182,8 +182,9 @@ public class TaosLatestDao implements ILatestDao {
|
|
// tsDataMap.put(tag, new DoubleTsData(rs.getTimestamp(1).getTime(), (short) 0, rs.getDouble(2)));
|
|
// tsDataMap.put(tag, new DoubleTsData(rs.getTimestamp(1).getTime(), (short) 0, rs.getDouble(2)));
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
+
|
|
String inString = Arrays.stream(tagNames).map(s -> "'" + s + "'").collect(Collectors.joining(","));
|
|
String inString = Arrays.stream(tagNames).map(s -> "'" + s + "'").collect(Collectors.joining(","));
|
|
- ResultSet rs = st.executeQuery("select last_row(*) from by_fdc.windturbine where point in (" + inString + ") group by tbname;");
|
|
|
|
|
|
+ ResultSet rs = st.executeQuery("select last_row(*) from by_fdc.windturbineai where point in (" + inString + ") group by tbname;");
|
|
|
|
|
|
while (rs.next()) {
|
|
while (rs.next()) {
|
|
tsDataMap.put(rs.getString(3).toUpperCase(), new DoubleTsData(rs.getTimestamp(1).getTime(), (short) 0, rs.getDouble(2)));
|
|
tsDataMap.put(rs.getString(3).toUpperCase(), new DoubleTsData(rs.getTimestamp(1).getTime(), (short) 0, rs.getDouble(2)));
|
|
@@ -207,11 +208,13 @@ public class TaosLatestDao implements ILatestDao {
|
|
public Map<String, TsData> getBooleanTsDataSnapshots (String...tagNames) throws Exception {
|
|
public Map<String, TsData> getBooleanTsDataSnapshots (String...tagNames) throws Exception {
|
|
Map<String, TsData> tsDataMap = new HashMap<>();
|
|
Map<String, TsData> tsDataMap = new HashMap<>();
|
|
Statement st = config.getInstance().createStatement();
|
|
Statement st = config.getInstance().createStatement();
|
|
|
|
+
|
|
for (String tag : tagNames) {
|
|
for (String tag : tagNames) {
|
|
String tableName = config.getTableName(tag);
|
|
String tableName = config.getTableName(tag);
|
|
ResultSet rs = st.executeQuery("select last_row(*) from " + tableName);
|
|
ResultSet rs = st.executeQuery("select last_row(*) from " + tableName);
|
|
while (rs.next()) {
|
|
while (rs.next()) {
|
|
- tsDataMap.put(tag, new BooleanTsData(rs.getTimestamp(1).getTime(), (short) 0, rs.getBoolean(2)));
|
|
|
|
|
|
+ tsDataMap.put(tag, new LongTsData(rs.getTimestamp(1).getTime(), (short) 0, rs.getLong(2)));
|
|
|
|
+ tsDataMap.put(rs.getString(3).toUpperCase(), new BooleanTsData(rs.getTimestamp(1).getTime(), (short) 0, rs.getBoolean(2)));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return tsDataMap;
|
|
return tsDataMap;
|