optimize
wet 2 years ago
parent e2a387d796
commit 7913fdb552

@ -30,20 +30,22 @@ namespace Myshipping.Core.Service
/// <summary>
/// 获取列表
/// </summary>
/// <param name="KeyWord"></param>
/// <returns></returns>
[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).
WhereIF(!string.IsNullOrWhiteSpace(KeyWord), x => x.Vessel.Contains(KeyWord)
|| x.CARRIER.Contains(KeyWord) || x.Voyno.Contains(KeyWord) || x.PortLoading.Contains(KeyWord) || x.PortTransit.Contains(KeyWord) ||
x.PortDischarge.Contains(KeyWord) || x.VoynoInside.Contains(KeyWord)
).ToListAsync();
return await _rep.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID)
.WhereIF(!string.IsNullOrWhiteSpace(CARRIER), x => x.CARRIER.Contains(CARRIER))
.WhereIF(!string.IsNullOrWhiteSpace(Vessel), x => x.Vessel.Contains(Vessel))
.WhereIF(!string.IsNullOrWhiteSpace(VoynoInside), x => x.VoynoInside.Contains(VoynoInside))
.WhereIF(!string.IsNullOrWhiteSpace(Voyno), x => x.Voyno.Contains(Voyno))
.WhereIF(StartETD!=null, x => x.ETD>=StartETD)
.WhereIF(EndETD != null, x => x.ETD <= EndETD)
.ToListAsync();
}
/// <summary>
/// 获取列表分页
/// </summary>

Loading…
Cancel
Save