|
@@ -407,10 +407,13 @@ namespace HealthMonitor.Service.Biz.db |
|
|
|
|
|
|
|
|
var result = await GernalRestSqlResTextAsync(sql); |
|
|
var result = await GernalRestSqlResTextAsync(sql); |
|
|
var res = JsonConvert.DeserializeObject<TDengineRestResBase>(result!); |
|
|
var res = JsonConvert.DeserializeObject<TDengineRestResBase>(result!); |
|
|
|
|
|
_logger.LogInformation($"最大小值:{sql}"); |
|
|
List<dynamic> data = res?.Data!; |
|
|
List<dynamic> data = res?.Data!; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var sqlAvg = $"SELECT AVG({field}) FROM {_configTDengineService.DB}.{tbName} WHERE {condition} AND {field} < { (data.Count.Equals(0)? 0: data[0][0]) } and {field} > {(data.Count.Equals(0) ? 0 : data[0][1])}"; |
|
|
var sqlAvg = $"SELECT AVG({field}) FROM {_configTDengineService.DB}.{tbName} WHERE {condition} AND {field} < { (data.Count.Equals(0)? 0: data[0][0]) } and {field} > {(data.Count.Equals(0) ? 0 : data[0][1])}"; |
|
|
result = await GernalRestSqlResTextAsync(sqlAvg); |
|
|
result = await GernalRestSqlResTextAsync(sqlAvg); |
|
|
|
|
|
_logger.LogInformation($"sqlAvg:{sql}"); |
|
|
res = JsonConvert.DeserializeObject<TDengineRestResBase>(result!); |
|
|
res = JsonConvert.DeserializeObject<TDengineRestResBase>(result!); |
|
|
data = res?.Data!; |
|
|
data = res?.Data!; |
|
|
|
|
|
|
|
|