optimize
wet 2 years ago
parent 1a879e811a
commit fdefc20700

@ -55,11 +55,14 @@ namespace Myshipping.Core.Service
public async Task<dynamic> GetListPage([FromQuery] QueryDjyVesselInfoInput input) public async Task<dynamic> GetListPage([FromQuery] QueryDjyVesselInfoInput input)
{ {
return await _rep.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID). return await _rep.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID)
WhereIF(!string.IsNullOrWhiteSpace(input.KeyWord), x => x.Vessel.Contains(input.KeyWord) .WhereIF(!string.IsNullOrWhiteSpace(input.CARRIER), x => x.CARRIER.Contains(input.CARRIER))
|| x.CARRIER.Contains(input.KeyWord) || x.Voyno.Contains(input.KeyWord) || x.PortLoading.Contains(input.KeyWord) || x.PortTransit.Contains(input.KeyWord) || .WhereIF(!string.IsNullOrWhiteSpace(input.Vessel), x => x.Vessel.Contains(input.Vessel))
x.PortDischarge.Contains(input.KeyWord) || x.VoynoInside.Contains(input.KeyWord) .WhereIF(!string.IsNullOrWhiteSpace(input.VoynoInside), x => x.VoynoInside.Contains(input.VoynoInside))
).ToPagedListAsync(input.PageNo, input.PageSize); .WhereIF(!string.IsNullOrWhiteSpace(input.Voyno), x => x.Voyno.Contains(input.Voyno))
.WhereIF(input.StartETD != null, x => x.ETD >= input.StartETD)
.WhereIF(input.EndETD != null, x => x.ETD <= input.EndETD)
.ToPagedListAsync(input.PageNo, input.PageSize);
} }

@ -13,9 +13,34 @@ namespace Myshipping.Core.Service
/// <summary> /// <summary>
/// 关键字 /// 船公司
/// </summary> /// </summary>
public string KeyWord { get; set; } public string CARRIER { get; set; }
/// <summary>
/// 船名
/// </summary>
public string Vessel { get; set; }
/// <summary>
/// 内部航次
/// </summary>
public string VoynoInside { get; set; }
/// <summary>
/// 航次
/// </summary>
public string Voyno { get; set; }
/// <summary>
/// 航次
/// </summary>
public DateTime? StartETD { get; set; }
/// <summary>
/// 航次
/// </summary>
public DateTime? EndETD { get; set; }
} }
} }

Loading…
Cancel
Save