From 8d43b4697068b5f5ea93c643be7421644374c1f1 Mon Sep 17 00:00:00 2001 From: H Vs Date: Thu, 13 Jul 2023 11:09:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=87=AA=E5=8A=A8=E5=BB=BA?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Resolver/BloodpressResolver.cs | 70 ++----------------- 1 file changed, 4 insertions(+), 66 deletions(-) diff --git a/HealthMonitor.Service/Resolver/BloodpressResolver.cs b/HealthMonitor.Service/Resolver/BloodpressResolver.cs index ed5a1be..66cd51c 100644 --- a/HealthMonitor.Service/Resolver/BloodpressResolver.cs +++ b/HealthMonitor.Service/Resolver/BloodpressResolver.cs @@ -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 }