forked from ddrilling/AsbCloudServer
TelemetryDataSaubService.GetTelemetryDataStatAsync(..) Add filterBy modes to query.
This commit is contained in:
parent
0457f8dd98
commit
1dee254427
@ -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<TelemetryDataSaub>()
|
||||
.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),
|
||||
|
Loading…
Reference in New Issue
Block a user