HdUnBindRecordService.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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(IHdUnBindRecordService), ServiceLifetime = LifeTime.Transient)]
  14. public class HdUnBindRecordService : BaseService<HdUnBindRecord>, IHdUnBindRecordService
  15. {
  16. /// <summary>
  17. /// 好哒终端解绑记录-列表
  18. /// </summary>
  19. /// <param name="param">参数请求体</param>
  20. /// <param name="page">分页参数</param>
  21. /// <returns>列表</returns>
  22. public PagedInfo<GetHdUnBindRecordListVo> getHdUnBindRecordList([FromQuery] PagerInfo page, [FromQuery] HdUnBindRecord param)
  23. {
  24. //拼装查询条件
  25. var predicate = Expressionable.Create<HdUnBindRecord>();
  26. predicate = predicate.AndIF(!string.IsNullOrEmpty(param.snNo), m => m.snNo.Contains(param.snNo));
  27. predicate = predicate.AndIF(!string.IsNullOrEmpty(param.mchtNo), m => m.mchtNo.Contains(param.mchtNo));
  28. predicate = predicate.AndIF(!string.IsNullOrEmpty(param.oprTime), m => m.oprTime.Contains(param.oprTime));
  29. predicate = predicate.AndIF(!string.IsNullOrEmpty(param.deviceType), m => m.deviceType.Contains(param.deviceType));
  30. var response = Queryable()
  31. .Where(predicate.ToExpression())
  32. .OrderByDescending(m => m.id)
  33. .ToPage<HdUnBindRecord, GetHdUnBindRecordListVo>(page);
  34. return response;
  35. }
  36. }
  37. }