PriRecursionStartFieldService.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using Attribute;
  2. using Model;
  3. using Model.Base;
  4. using Repository;
  5. using Service;
  6. using Microsoft.AspNetCore.Mvc;
  7. using Vo.Admin;
  8. namespace Services
  9. {
  10. /// <summary>
  11. /// 递归开始条件字段Service业务层处理
  12. /// </summary>
  13. [AppService(ServiceType = typeof(IPriRecursionStartFieldService), ServiceLifetime = LifeTime.Transient)]
  14. public class PriRecursionStartFieldService : BaseService<PriRecursionStartField>, IPriRecursionStartFieldService
  15. {
  16. /// <summary>
  17. /// 递归开始条件字段-列表
  18. /// </summary>
  19. /// <param name="param">参数请求体</param>
  20. /// <param name="page">分页参数</param>
  21. /// <returns>列表</returns>
  22. public PagedInfo<GetPriRecursionStartFieldListVo> getPriRecursionStartFieldList([FromQuery] PagerInfo page, [FromQuery] PriRecursionStartField param)
  23. {
  24. //拼装查询条件
  25. var predicate = Expressionable.Create<PriRecursionStartField>();
  26. predicate = predicate.AndIF(!string.IsNullOrEmpty(param.fieldName), m => m.fieldName.Contains(param.fieldName));
  27. predicate = predicate.AndIF(!string.IsNullOrEmpty(param.fieldEnName), m => m.fieldEnName.Contains(param.fieldEnName));
  28. predicate = predicate.AndIF(param.objectTableId > 0, m => m.objectTableId == param.objectTableId);
  29. var response = Queryable()
  30. .Where(predicate.ToExpression())
  31. .OrderByDescending(m => m.id)
  32. .ToPage<PriRecursionStartField, GetPriRecursionStartFieldListVo>(page);
  33. return response;
  34. }
  35. }
  36. }