SetDataRepository.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. 
  2. using OASystem.Domain;
  3. using OASystem.Domain.Dtos.UserDto;
  4. using OASystem.Domain.Entities.System;
  5. using OASystem.Domain.ViewModels.System;
  6. namespace OASystem.Infrastructure.Repositories.System
  7. {
  8. public class SetDataRepository : BaseRepository<Sys_SetData, SetDataView>
  9. {
  10. public SetDataRepository(SqlSugarClient sqlSugar) : base(sqlSugar)
  11. {
  12. }
  13. /// <summary>
  14. /// 获取所有系统模块
  15. /// </summary>
  16. /// <param name="_SetData"></param>
  17. /// <returns></returns>
  18. public async Task<Result> GetSySDefultModule(SetDataRepository _SetData)
  19. {
  20. Result result = new Result();
  21. string sql = "select * from Sys_SetData where STid = 5 and isdel = 0";
  22. var DBdata = await _SetData.GetListBySqlWithNolockAsync(sql);
  23. if (DBdata == null || DBdata.Count == 0)
  24. {
  25. return result;
  26. }
  27. result.Data = DBdata.Select(x=> new SetDataView
  28. {
  29. Name = x.Name,
  30. STid = x.STid,
  31. Id = x.Id,
  32. });
  33. result.Code = 0;
  34. result.Msg = "成功!";
  35. return result;
  36. }
  37. }
  38. }