SysDictionaryDataService.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. 
  2. using Wms.Screen.SqlSugar.Model;
  3. using Wms.Screen.SqlSugar.Repository;
  4. using SqlSugar;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Linq.Expressions;
  9. using System.Text;
  10. using Wms.Screen.DataService.Interface;
  11. using Wms.Screen.SqlSugar.Dadihaiyang;
  12. namespace Wms.Screen.DataService.Impl
  13. {
  14. public class SysDictionaryDataService : BaseDataSetvice, ISysDictionaryDataService
  15. {
  16. private IRepository<SysDictionary> _repository;
  17. private SqlSugarClient _client;
  18. public SysDictionaryDataService(IRepository<SysDictionary> repository, SqlSugarClient client) : base(client)
  19. {
  20. _repository = repository;
  21. _client = client;
  22. }
  23. /// <summary>
  24. /// 获取字典列表
  25. /// </summary>
  26. /// <returns></returns>
  27. public List<SysDictionary> GetList()
  28. {
  29. return _repository.Queryable().Where(p => p.DicCode == EquipType.equip_type)
  30. .OrderBy(p=>p.SortIndex)
  31. .ToList();
  32. }
  33. public bool IsDictionaryCodeExist(string dictionaryCode)
  34. {
  35. return _repository.QueryableIncludeDelete()
  36. .Where(p => p.DicCode == dictionaryCode)
  37. .Any();
  38. }
  39. }
  40. }