媒体库列表添加过滤条件航线id

main
陈伟 4 weeks ago
parent 82e228c7cf
commit 9bff4f2573

@ -408,7 +408,7 @@ namespace OpenAuth.App.ServiceApp
#endregion #endregion
public async Task<Response<PageInfo<List<LasaMediaFile>>>> GetMediaFile(string taskId, string device, public async Task<Response<PageInfo<List<LasaMediaFile>>>> GetMediaFile(string taskId, string airId,string device,
string picname, DateTime? startTime, DateTime? endTime, int page, int limit, string parentKey,int? objectKeyExist) string picname, DateTime? startTime, DateTime? endTime, int page, int limit, string parentKey,int? objectKeyExist)
{ {
RefAsync<int> totalCount = 0; RefAsync<int> totalCount = 0;
@ -417,15 +417,16 @@ namespace OpenAuth.App.ServiceApp
Console.WriteLine(startTime.ToString()); Console.WriteLine(startTime.ToString());
var list = await db.LasaMediaFile.AsQueryable() var list = await db.LasaMediaFile.AsQueryable()
.LeftJoin<LasaTask>((x, b) => x.FlightId == b.FlightId) .LeftJoin<LasaTask>((x, b) => x.FlightId == b.FlightId)
.WhereIF(!string.IsNullOrEmpty(device), x => x.DroneModelKey == device) .WhereIF(!string.IsNullOrEmpty(device), (x, b) => x.DroneModelKey == device)
.WhereIF(!string.IsNullOrEmpty(picname), x => x.Name.Contains(picname)) .WhereIF(!string.IsNullOrEmpty(picname), (x, b) => x.Name.Contains(picname))
.WhereIF(objectKeyExist is 0,x=> x.ObjectKey == null) .WhereIF(!string.IsNullOrEmpty(airId), (x, b) => b.AirLineId == airId)
.WhereIF(objectKeyExist is 1,x=> x.ObjectKey != null) .WhereIF(objectKeyExist is 0,(x, b)=> x.ObjectKey == null)
.WhereIF(!"0001/1/1 0:00:00".Equal(startTime.ToString()), x => x.CreateTime >= startTime) .WhereIF(objectKeyExist is 1,(x, b)=> x.ObjectKey != null)
.WhereIF(!"0001/1/1 0:00:00".Equal(endTime.ToString()), x => x.CreateTime <= endTime) .WhereIF(!"0001/1/1 0:00:00".Equal(startTime.ToString()), (x, b) => x.CreateTime >= startTime)
.WhereIF(!string.IsNullOrEmpty(parentKey), x => x.ParentKey == parentKey) .WhereIF(!"0001/1/1 0:00:00".Equal(endTime.ToString()), (x, b) => x.CreateTime <= endTime)
.WhereIF(!string.IsNullOrEmpty(taskId), x => x.TaskId == taskId) .WhereIF(!string.IsNullOrEmpty(parentKey), (x, b) => x.ParentKey == parentKey)
.OrderBy(x => x.CreateTime, OrderByType.Desc) .WhereIF(!string.IsNullOrEmpty(taskId), (x, b) => x.TaskId == taskId)
.OrderBy((x, b) => x.CreateTime, OrderByType.Desc)
.Select((x,b) => new LasaMediaFile .Select((x,b) => new LasaMediaFile
{ {
Id = x.Id, Id = x.Id,

@ -692,12 +692,12 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
[HttpGet] [HttpGet]
public async Task<Response<PageInfo<List<LasaMediaFile>>>> GetMediaFile(string taskId,string device,string picname, DateTime startTime, DateTime endTime, int page, int limit,string parentKey,int? objectKeyExist) public async Task<Response<PageInfo<List<LasaMediaFile>>>> GetMediaFile(string taskId,string airId,string device,string picname, DateTime startTime, DateTime endTime, int page, int limit,string parentKey,int? objectKeyExist)
{ {
var result = new Response<PageInfo<List<LasaMediaFile>>>(); var result = new Response<PageInfo<List<LasaMediaFile>>>();
try try
{ {
result = await _app.GetMediaFile(taskId,device, picname,startTime, endTime, page, limit,parentKey,objectKeyExist); result = await _app.GetMediaFile(taskId,airId,device, picname,startTime, endTime, page, limit,parentKey,objectKeyExist);
} }
catch (Exception ex) catch (Exception ex)
{ {

Loading…
Cancel
Save