查询组织列表增加条件参数

This commit is contained in:
2023-04-20 16:59:21 +08:00
parent 95cc47ebac
commit d9ad2fd345
6 changed files with 45 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
using JNPF.Common.Core.Manager;
using System.Linq.Expressions;
using JNPF.Common.Core.Manager;
using JNPF.Common.Enums;
using JNPF.Common.Extension;
using JNPF.Common.Filter;
@@ -626,9 +627,10 @@ public class OrganizeService : IOrganizeService, IDynamicApiController, ITransie
/// </summary>
/// <returns></returns>
[NonAction]
public async Task<List<OrganizeEntity>> GetListAsync()
public async Task<List<OrganizeEntity>> GetListAsync(Expression<Func<OrganizeEntity, bool>> expression = null)
{
return await _repository.AsQueryable().Where(t => t.EnabledMark == 1 && t.DeleteMark == null).OrderBy(o => o.SortCode).OrderBy(a => a.CreatorTime, OrderByType.Desc).ToListAsync();
var query = _repository.AsQueryable().Where(t => t.EnabledMark == 1 && t.DeleteMark == null).WhereIF(expression!=null, expression);
return await query.OrderBy(o => o.SortCode).OrderBy(a => a.CreatorTime, OrderByType.Desc).ToListAsync();
}
/// <summary>