DepartmentRepository.cs 871 B

1234567891011121314151617181920212223242526272829
  1. using OASystem.Domain;
  2. using OASystem.Domain.Entities.System;
  3. using OASystem.Domain.ViewModels.System;
  4. namespace OASystem.Infrastructure.Repositories.System
  5. {
  6. public class DepartmentRepository : BaseRepository<Sys_Department, DepartmentView>
  7. {
  8. public DepartmentRepository(SqlSugarClient sqlSugar) : base(sqlSugar)
  9. {
  10. }
  11. public Result QueryDepListByCompId(DepartmentRepository _DepartmentRepository,int companyid)
  12. {
  13. Result result = new Result();
  14. var DBdata = _DepartmentRepository.QueryDto<Sys_Department, DepartmentView>(x => x.CompanyId == companyid);
  15. if (DBdata != null && DBdata.Count() > 0)
  16. {
  17. result.Code = 0;
  18. result.Msg = "成功!";
  19. result.Data = DBdata;
  20. }
  21. return result;
  22. }
  23. }
  24. }