|
|
|
|
@ -1167,7 +1167,7 @@ public class TDengineService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 默认限制条数(防止全表扫描)
|
|
|
|
|
int safeLimit = limit == null ? 100 : limit;
|
|
|
|
|
// int safeLimit = limit == null ? 100 : limit;
|
|
|
|
|
|
|
|
|
|
String tableName = "besure_server.d_" + deviceId;
|
|
|
|
|
|
|
|
|
|
@ -1182,7 +1182,10 @@ public class TDengineService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sqlBuilder.append(" ORDER BY ts DESC "); // 按时间倒序
|
|
|
|
|
sqlBuilder.append(" LIMIT ").append(safeLimit); // 限制条数
|
|
|
|
|
|
|
|
|
|
if(limit !=null ){
|
|
|
|
|
sqlBuilder.append(" LIMIT ").append(limit); // 限制条数
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String sql = sqlBuilder.toString();
|
|
|
|
|
|
|
|
|
|
|