|
@@ -56,7 +56,7 @@ public class TaosHistoryDao implements IHistoryDao {
|
|
|
|
|
|
Statement st = taosConfig.getInstance().createStatement();
|
|
Statement st = taosConfig.getInstance().createStatement();
|
|
String point = tsQuery.getTsPoint().getId();
|
|
String point = tsQuery.getTsPoint().getId();
|
|
- point = point.replaceFirst("\\.", "-");
|
|
|
|
|
|
+ point = point.replaceFirst("\\.", "__");
|
|
StringBuilder sb = new StringBuilder();
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("select avg(val),max(val),min(val) from ");
|
|
sb.append("select avg(val),max(val),min(val) from ");
|
|
sb.append(taosConfig.getTableName(point));
|
|
sb.append(taosConfig.getTableName(point));
|
|
@@ -82,7 +82,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().replaceFirst("\\.", "-");
|
|
|
|
|
|
+ String point = obj.getTagName().replaceFirst("\\.", "__");
|
|
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 (");
|
|
@@ -222,7 +222,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().replaceFirst("\\.", "-");
|
|
|
|
|
|
+ String point = tsQuery.getTsPoint().getId().replaceFirst("\\.", "__");
|
|
StringBuilder sb = new StringBuilder();
|
|
StringBuilder sb = new StringBuilder();
|
|
if (tsQuery.getInterpolation() == Interpolation.RAW) {
|
|
if (tsQuery.getInterpolation() == Interpolation.RAW) {
|
|
sb.append("select * from ");
|
|
sb.append("select * from ");
|
|
@@ -231,7 +231,8 @@ public class TaosHistoryDao implements IHistoryDao {
|
|
sb.append(" and ").append(tsQuery.getEndTs());
|
|
sb.append(" and ").append(tsQuery.getEndTs());
|
|
} else if (tsQuery.getInterpolation() == Interpolation.SNAP) {
|
|
} else if (tsQuery.getInterpolation() == Interpolation.SNAP) {
|
|
if (tsQuery.getDateArray() != null && tsQuery.getDateArray().length > 0) {
|
|
if (tsQuery.getDateArray() != null && tsQuery.getDateArray().length > 0) {
|
|
- sb.append("select _irowts,interp(val) from ");
|
|
|
|
|
|
+// sb.append("select _irowts,interp(val) from ");
|
|
|
|
+ sb.append("select interp(val) from ");
|
|
sb.append(taosConfig.getTableName(point));
|
|
sb.append(taosConfig.getTableName(point));
|
|
sb.append(" range(").append(tsQuery.getStartTs());
|
|
sb.append(" range(").append(tsQuery.getStartTs());
|
|
sb.append(",").append(tsQuery.getEndTs());
|
|
sb.append(",").append(tsQuery.getEndTs());
|