Przeglądaj źródła

新增自动建表

td_orm
H Vs 1 rok temu
rodzic
commit
8d43b46970
1 zmienionych plików z 4 dodań i 66 usunięć
  1. +4
    -66
      HealthMonitor.Service/Resolver/BloodpressResolver.cs

+ 4
- 66
HealthMonitor.Service/Resolver/BloodpressResolver.cs Wyświetl plik

@@ -151,74 +151,11 @@ namespace HealthMonitor.Service.Resolver



// _logger.LogInformation($"health_monitor.hm_bp_stats_inc_{bp.Serialno.Substring(bp.Serialno.Length - 2)}");
//if (bp.MessageId.Equals("1674952622991276544"))
//{
// var aa = bp;
// var cc = aa;
//}

#region 插入BP增量值 hm_bloodpress_stats_inc
//var sql = $"INSERT INTO health_monitor.hm_bp_stats_inc_{bp.Serialno.Substring(bp.Serialno.Length - 2)} VALUES(" +
// $"{DateTimeUtil.ConvertToTimeStamp((DateTime)bp.LastUpdate)* 1000000}" +
// $"'{bp.BloodPressId}'," +
// $"'{bp.MessageId}'," +
// $"'{bp.Serialno}'," +
// $"{bp.SystolicValue}," +
// $"{systolicRefValue}," +
// $"{systolicAvg}," +
// $"{systolicMax}," +
// $"{systolicMin}," +
// $"{systolicAvgOffset}," +
// $"{systolicInc}," +
// $"{bp.DiastolicValue}," +
// $"{diastolicRefValue}," +
// $"{diastolicAvg}," +
// $"{diastolicMax}," +
// $"{diastolicMin}," +
// $"{diastolicAvgOffset}," +
// $"{diastolicInc}," +
// $"{gender}," +
// $"{age}," +
// $"{height}," +
// $"{weight}," +
// $"'{bp.LastUpdate:yyyy-MM-ddTHH:mm:ss.fffZ}'," +
// $"{duration}," +
// $"'{startTime:yyyy-MM-ddTHH:mm:ss.fffZ}'," +
// $"'{endTime:yyyy-MM-ddTHH:mm:ss.fffZ}'," +
// $"'{string.Empty}')";

//var sql = $"INSERT INTO health_monitor.hm_bp_stats_inc_{bp.Serialno.Substring(bp.Serialno.Length - 2)} VALUES(" +
// $"'{bp.LastUpdate:yyyy-MM-ddTHH:mm:ss.fffZ}'," +
// $"'{bp.BloodPressId}'," +
// $"'{bp.MessageId}'," +
// $"'{bp.Serialno}'," +
// $"{bp.SystolicValue}," +
// $"{systolicRefValue}," +
// $"{systolicAvg}," +
// $"{systolicMax}," +
// $"{systolicMin}," +
// $"{systolicAvgOffset}," +
// $"{systolicInc}," +
// $"{bp.DiastolicValue}," +
// $"{diastolicRefValue}," +
// $"{diastolicAvg}," +
// $"{diastolicMax}," +
// $"{diastolicMin}," +
// $"{diastolicAvgOffset}," +
// $"{diastolicInc}," +
// $"{gender}," +
// $"{age}," +
// $"{height}," +
// $"{weight}," +
// $"'{bp.LastUpdate:yyyy-MM-ddTHH:mm:ss.fffZ}'," +
// $"{duration}," +
// $"'{startTime:yyyy-MM-ddTHH:mm:ss.fffZ}'," +
// $"'{endTime:yyyy-MM-ddTHH:mm:ss.fffZ}'," +
// $"'{string.Empty}')";
//var res = await _serviceTDengine.GernalRestSql(sql);

var sql = $"INSERT INTO health_monitor.hm_bp_stats_inc_{bp.Serialno.Substring(bp.Serialno.Length - 2)} VALUES(" +
// 自动建表
var sql = $"INSERT INTO health_monitor.hm_bp_stats_inc_{bp.Serialno.Substring(bp.Serialno.Length - 2)} USING health_monitor.stb_hm_bloodpress_stats_inc TAGS ('{bp.Serialno.Substring(bp.Serialno.Length - 2)}') VALUES(" +
$"'{bp.LastUpdate:yyyy-MM-dd HH:mm:ss.fff}'," +
$"'{bp.BloodPressId}'," +
$"'{bp.MessageId}'," +
@@ -246,6 +183,7 @@ namespace HealthMonitor.Service.Resolver
$"'{startTime:yyyy-MM-dd HH:mm:ss.fff}'," +
$"'{endTime:yyyy-MM-dd HH:mm:ss.fff}'," +
$"'{string.Empty}')";

_serviceTDengine.ExecuteInsertSQL(sql);
#endregion
}


Ładowanie…
Anuluj
Zapisz