From 1dee25442751eb21db9680f617e8962d6eb8c1e5 Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Wed, 5 Apr 2023 13:35:05 +0500 Subject: [PATCH] TelemetryDataSaubService.GetTelemetryDataStatAsync(..) Add filterBy modes to query. --- .../Services/SAUB/TelemetryDataSaubService.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/AsbCloudInfrastructure/Services/SAUB/TelemetryDataSaubService.cs b/AsbCloudInfrastructure/Services/SAUB/TelemetryDataSaubService.cs index 6d9a140b..8bf021b8 100644 --- a/AsbCloudInfrastructure/Services/SAUB/TelemetryDataSaubService.cs +++ b/AsbCloudInfrastructure/Services/SAUB/TelemetryDataSaubService.cs @@ -36,6 +36,7 @@ namespace AsbCloudInfrastructure.Services.SAUB { var timezone = telemetryService.GetTimezone(idTelemetry); var timezoneOffset = TimeSpan.FromHours(timezone.Hours); + int[] modes = new int[] { 0, 1, 3 }; var query = db.Set() .Where(t => t.IdTelemetry == idTelemetry) @@ -43,6 +44,7 @@ namespace AsbCloudInfrastructure.Services.SAUB .Where(t => t.WellDepth > 0.0001) .Where(t => t.WellDepth - t.BitDepth < 0.01) .Where(t => t.Mode != null) + .Where(t => modes.Contains(t.Mode.Value)) .GroupBy(t => new { t.DateTime.Hour, WellDepthX10 = Math.Truncate(t.WellDepth!.Value * 10), @@ -51,7 +53,7 @@ namespace AsbCloudInfrastructure.Services.SAUB .Select(g => new TelemetryDataSaubStatDto { Count = g.Count(), - Mode = g.Key.Mode??0, + IdMode = g.Key.Mode??0, IdFeedRegulator = g.Key.IdFeedRegulator, DateMin = DateTime.SpecifyKind(g.Min(t => t.DateTime.UtcDateTime) + timezoneOffset, DateTimeKind.Unspecified),