optimize
wet 2 years ago
parent e2a387d796
commit 7913fdb552

@ -30,17 +30,19 @@ namespace Myshipping.Core.Service
/// <summary> /// <summary>
/// 获取列表 /// 获取列表
/// </summary> /// </summary>
/// <param name="KeyWord"></param>
/// <returns></returns> /// <returns></returns>
[HttpGet("/DjyVesselInfoService/GetListPage")] [HttpGet("/DjyVesselInfoService/GetListPage")]
public async Task<dynamic> GetListPage([FromQuery] string KeyWord) public async Task<dynamic> GetListPage([FromQuery] string CARRIER,string Vessel,string VoynoInside,string Voyno,DateTime? StartETD,DateTime? EndETD)
{ {
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(KeyWord), x => x.Vessel.Contains(KeyWord) .WhereIF(!string.IsNullOrWhiteSpace(CARRIER), x => x.CARRIER.Contains(CARRIER))
|| x.CARRIER.Contains(KeyWord) || x.Voyno.Contains(KeyWord) || x.PortLoading.Contains(KeyWord) || x.PortTransit.Contains(KeyWord) || .WhereIF(!string.IsNullOrWhiteSpace(Vessel), x => x.Vessel.Contains(Vessel))
x.PortDischarge.Contains(KeyWord) || x.VoynoInside.Contains(KeyWord) .WhereIF(!string.IsNullOrWhiteSpace(VoynoInside), x => x.VoynoInside.Contains(VoynoInside))
).ToListAsync(); .WhereIF(!string.IsNullOrWhiteSpace(Voyno), x => x.Voyno.Contains(Voyno))
.WhereIF(StartETD!=null, x => x.ETD>=StartETD)
.WhereIF(EndETD != null, x => x.ETD <= EndETD)
.ToListAsync();
} }

Loading…
Cancel
Save