forked from ddrilling/AsbCloudServer
CS2-66: Added well depth filter to .GetOperationsAsync()
This commit is contained in:
parent
31fd4bda1a
commit
a0856fad25
@ -17,6 +17,8 @@ namespace AsbCloudApp.Services
|
|||||||
IEnumerable<int> operationCategoryIds = null,
|
IEnumerable<int> operationCategoryIds = null,
|
||||||
DateTime begin = default,
|
DateTime begin = default,
|
||||||
DateTime end = default,
|
DateTime end = default,
|
||||||
|
double minDepth = double.MinValue,
|
||||||
|
double maxDepth = double.MaxValue,
|
||||||
int skip = 0,
|
int skip = 0,
|
||||||
int take = 32,
|
int take = 32,
|
||||||
CancellationToken token = default);
|
CancellationToken token = default);
|
||||||
|
@ -38,6 +38,8 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
IEnumerable<int> operationCategoryIds = default,
|
IEnumerable<int> operationCategoryIds = default,
|
||||||
DateTime begin = default,
|
DateTime begin = default,
|
||||||
DateTime end = default,
|
DateTime end = default,
|
||||||
|
double minDepth = double.MinValue,
|
||||||
|
double maxDepth = double.MaxValue,
|
||||||
int skip = 0,
|
int skip = 0,
|
||||||
int take = 32,
|
int take = 32,
|
||||||
CancellationToken token = default)
|
CancellationToken token = default)
|
||||||
@ -56,6 +58,12 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
if (operationCategoryIds != default && operationCategoryIds.Any())
|
if (operationCategoryIds != default && operationCategoryIds.Any())
|
||||||
query = query.Where(e => operationCategoryIds.Contains(e.IdCategory));
|
query = query.Where(e => operationCategoryIds.Contains(e.IdCategory));
|
||||||
|
|
||||||
|
if (minDepth != double.MinValue)
|
||||||
|
query = query.Where(e => e.WellDepth >= minDepth);
|
||||||
|
|
||||||
|
if (maxDepth != double.MaxValue)
|
||||||
|
query = query.Where(e => e.WellDepth <= maxDepth);
|
||||||
|
|
||||||
if (begin != default)
|
if (begin != default)
|
||||||
query = query.Where(e => e.StartDate >= begin);
|
query = query.Where(e => e.StartDate >= begin);
|
||||||
|
|
||||||
|
@ -48,6 +48,8 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="operationCategoryIds">фильтр по списку id категорий операции</param>
|
/// <param name="operationCategoryIds">фильтр по списку id категорий операции</param>
|
||||||
/// <param name="begin">фильтр по началу операции</param>
|
/// <param name="begin">фильтр по началу операции</param>
|
||||||
/// <param name="end">фильтр по окончанию операции</param>
|
/// <param name="end">фильтр по окончанию операции</param>
|
||||||
|
/// <param name="minDepth">фильтр по минимальной глубине скважины</param>
|
||||||
|
/// <param name="maxDepth">фильтр по максимальной глубине скважины</param>
|
||||||
/// <param name="skip"></param>
|
/// <param name="skip"></param>
|
||||||
/// <param name="take"></param>
|
/// <param name="take"></param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
@ -61,6 +63,8 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
[FromQuery] IEnumerable<int> operationCategoryIds = default,
|
[FromQuery] IEnumerable<int> operationCategoryIds = default,
|
||||||
DateTime begin = default,
|
DateTime begin = default,
|
||||||
DateTime end = default,
|
DateTime end = default,
|
||||||
|
double minDepth = double.MinValue,
|
||||||
|
double maxDepth = double.MaxValue,
|
||||||
int skip = 0,
|
int skip = 0,
|
||||||
int take = 32,
|
int take = 32,
|
||||||
CancellationToken token = default)
|
CancellationToken token = default)
|
||||||
@ -75,6 +79,8 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
operationCategoryIds,
|
operationCategoryIds,
|
||||||
begin,
|
begin,
|
||||||
end,
|
end,
|
||||||
|
minDepth,
|
||||||
|
maxDepth,
|
||||||
skip,
|
skip,
|
||||||
take,
|
take,
|
||||||
token)
|
token)
|
||||||
|
Loading…
Reference in New Issue
Block a user