TelRepository.cs 752 B

123456789101112131415161718192021222324
  1. using Hotline.CallCenter.Tels;
  2. using SqlSugar;
  3. using XF.Domain.Dependency;
  4. namespace Hotline.Repository.SqlSugar.CallCenter
  5. {
  6. public class TelRepository : BaseRepository<Tel>, ITelRepository, IScopeDependency
  7. {
  8. public TelRepository(ISugarUnitOfWork<HotlineDbContext> uow) : base(uow)
  9. {
  10. }
  11. /// <summary>
  12. /// 分机是否正在休息
  13. /// </summary>
  14. /// <param name="telNo"></param>
  15. /// <param name="cancellationToken"></param>
  16. /// <returns></returns>
  17. public Task<bool> IsRestingAsync(string telNo, CancellationToken cancellationToken)
  18. {
  19. return Db.Queryable<TelRest>().AnyAsync(d => d.TelNo == telNo && !d.EndTime.HasValue);
  20. }
  21. }
  22. }