|
@@ -78,7 +78,7 @@ public class TaosHistoryDao implements IHistoryDao {
|
|
|
|
|
|
try {
|
|
try {
|
|
Statement st = connect.createStatement();
|
|
Statement st = connect.createStatement();
|
|
- String point = tsQuery.getTsPoint().getId();
|
|
|
|
|
|
+ String point = tsQuery.getTsPoint().getId().replace(".","_");
|
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("select avg(value_double),max(value_double),min(value_double) from ").append(point);
|
|
sb.append("select avg(value_double),max(value_double),min(value_double) from ").append(point);
|
|
@@ -117,7 +117,7 @@ public class TaosHistoryDao implements IHistoryDao {
|
|
sb.append("insert into ");
|
|
sb.append("insert into ");
|
|
for (TsPointData obj : dataList) {
|
|
for (TsPointData obj : dataList) {
|
|
long time = obj.getTsData().getTs();
|
|
long time = obj.getTsData().getTs();
|
|
- String point = obj.getTagName();
|
|
|
|
|
|
+ String point = obj.getTagName().replace(".","_");
|
|
double value = obj.getTsData().getDoubleValue().get();
|
|
double value = obj.getTsData().getDoubleValue().get();
|
|
// sb.append(TaosCovertUtil.coverStationPrefix(point)).append(".");
|
|
// sb.append(TaosCovertUtil.coverStationPrefix(point)).append(".");
|
|
sb.append(point).append(" values (");
|
|
sb.append(point).append(" values (");
|
|
@@ -288,7 +288,7 @@ public class TaosHistoryDao implements IHistoryDao {
|
|
* @throws WisdomException
|
|
* @throws WisdomException
|
|
*/
|
|
*/
|
|
private String getHistory(TsQuery tsQuery) throws WisdomException {
|
|
private String getHistory(TsQuery tsQuery) throws WisdomException {
|
|
- String point = tsQuery.getTsPoint().getId();
|
|
|
|
|
|
+ String point = tsQuery.getTsPoint().getId().replace(".","_");
|
|
StringBuilder sb = new StringBuilder();
|
|
StringBuilder sb = new StringBuilder();
|
|
if (tsQuery.getInterpolation() == Interpolation.RAW) {
|
|
if (tsQuery.getInterpolation() == Interpolation.RAW) {
|
|
sb.append("select * from ").append(point);
|
|
sb.append("select * from ").append(point);
|
|
@@ -323,9 +323,9 @@ public class TaosHistoryDao implements IHistoryDao {
|
|
*/
|
|
*/
|
|
private String getSectionSql(String tag, long ts) {
|
|
private String getSectionSql(String tag, long ts) {
|
|
// String point = TaosCovertUtil.coverStationPrefix(tag) + "." + tag.replace(".", "_");
|
|
// String point = TaosCovertUtil.coverStationPrefix(tag) + "." + tag.replace(".", "_");
|
|
-
|
|
|
|
|
|
+ String point = tag.replace(".", "_");
|
|
StringBuilder sb = new StringBuilder();
|
|
StringBuilder sb = new StringBuilder();
|
|
- sb.append("select last_row(*) from ").append(tag);
|
|
|
|
|
|
+ sb.append("select last_row(*) from ").append(point);
|
|
sb.append(" where point_time>='");
|
|
sb.append(" where point_time>='");
|
|
sb.append(DateFormatUtils.format(ts - half_year_time, "yyyy-MM-dd HH:mm:ss:SSS") + "'");
|
|
sb.append(DateFormatUtils.format(ts - half_year_time, "yyyy-MM-dd HH:mm:ss:SSS") + "'");
|
|
sb.append(" and point_time <='" + DateFormatUtils.format(ts, "yyyy-MM-dd HH:mm:ss:SSS") + "'");
|
|
sb.append(" and point_time <='" + DateFormatUtils.format(ts, "yyyy-MM-dd HH:mm:ss:SSS") + "'");
|