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