forked from ddrilling/AsbCloudServer
Исправление группировки по подсистемам
This commit is contained in:
parent
17c7392542
commit
22136824ac
@ -187,18 +187,18 @@ namespace AsbCloudInfrastructure.Services.Subsystems
|
|||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public async Task<DatesRangeDto?> GetDateRangeOperationTimeAsync(SubsystemOperationTimeRequest request, CancellationToken token)
|
public async Task<DatesRangeDto?> GetDateRangeOperationTimeAsync(SubsystemOperationTimeRequest request, CancellationToken token)
|
||||||
{
|
{
|
||||||
var query = BuildQuery(request);
|
var query = BuildQuery(request);
|
||||||
if (query is not null)
|
if (query is not null)
|
||||||
{
|
{
|
||||||
var result = await query
|
var result = await query
|
||||||
.GroupBy(o => o.IdSubsystem)
|
.GroupBy(o => o.IdTelemetry)
|
||||||
.Select(g => new DatesRangeDto
|
.Select(g => new DatesRangeDto
|
||||||
{
|
{
|
||||||
From = g.Min(o => o.DateStart).DateTime,
|
From = g.Min(o => o.DateStart).DateTime,
|
||||||
To = g.Max(o => o.DateEnd).DateTime
|
To = g.Max(o => o.DateEnd).DateTime
|
||||||
})
|
})
|
||||||
.FirstOrDefaultAsync(token);
|
.FirstOrDefaultAsync(token);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user