PriRecursionStartTableService.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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(IPriRecursionStartTableService), ServiceLifetime = LifeTime.Transient)]
  14. public class PriRecursionStartTableService : BaseService<PriRecursionStartTable>, IPriRecursionStartTableService
  15. {
  16. /// <summary>
  17. /// 递归开始条件对象表-列表
  18. /// </summary>
  19. /// <param name="param">参数请求体</param>
  20. /// <param name="page">分页参数</param>
  21. /// <returns>列表</returns>
  22. public PagedInfo<GetPriRecursionStartTableListVo> getPriRecursionStartTableList([FromQuery] PagerInfo page, [FromQuery] PriRecursionStartTable param)
  23. {
  24. //拼装查询条件
  25. var predicate = Expressionable.Create<PriRecursionStartTable>();
  26. predicate = predicate.AndIF(!string.IsNullOrEmpty(param.tableEnName), m => m.tableEnName.Contains(param.tableEnName));
  27. predicate = predicate.AndIF(param.listId > 0, m => m.listId == param.listId);
  28. var response = Queryable()
  29. .Where(predicate.ToExpression())
  30. .OrderByDescending(m => m.id)
  31. .ToPage<PriRecursionStartTable, GetPriRecursionStartTableListVo>(page);
  32. return response;
  33. }
  34. /// <summary>
  35. /// 递归开始条件对象表-下拉框数据
  36. /// </summary>
  37. /// <param name="page">分页参数</param>
  38. /// <returns>下拉框数据</returns>
  39. public PagedInfo<GetPriRecursionStartTableDicVo> getPriRecursionStartTableDic([FromQuery] PagerInfo page)
  40. {
  41. //拼装查询条件
  42. var predicate = Expressionable.Create<PriRecursionStartTable>();
  43. var response = Queryable()
  44. .Where(predicate.ToExpression())
  45. .OrderByDescending(m => m.id)
  46. .ToPage<PriRecursionStartTable, GetPriRecursionStartTableDicVo>(page);
  47. return response;
  48. }
  49. }
  50. }