PriRecursionStartConditionService.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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(IPriRecursionStartConditionService), ServiceLifetime = LifeTime.Transient)]
  14. public class PriRecursionStartConditionService : BaseService<PriRecursionStartCondition>, IPriRecursionStartConditionService
  15. {
  16. /// <summary>
  17. /// 递归开始条件-列表
  18. /// </summary>
  19. /// <param name="param">参数请求体</param>
  20. /// <param name="page">分页参数</param>
  21. /// <returns>列表</returns>
  22. public PagedInfo<GetPriRecursionStartConditionListVo> getPriRecursionStartConditionList([FromQuery] PagerInfo page, [FromQuery] PriRecursionStartCondition param)
  23. {
  24. //拼装查询条件
  25. var predicate = Expressionable.Create<PriRecursionStartCondition>();
  26. predicate = predicate.AndIF(param.loopSetId > 0, m => m.loopSetId == param.loopSetId);
  27. predicate = predicate.AndIF(!string.IsNullOrEmpty(param.fieldQueryModel), m => m.fieldQueryModel.Contains(param.fieldQueryModel));
  28. var response = Queryable()
  29. .Where(predicate.ToExpression())
  30. .OrderByDescending(m => m.id)
  31. .ToPage<PriRecursionStartCondition, GetPriRecursionStartConditionListVo>(page);
  32. return response;
  33. }
  34. }
  35. }