123456789101112131415161718192021222324252627282930313233343536 |
- using Hotline.Orders;
- using Hotline.Repository.SqlSugar.DataPermissions;
- using Hotline.Snapshot;
- using Hotline.Snapshot.Interfaces;
- using SqlSugar;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using XF.Domain.Dependency;
- namespace Hotline.Repository.SqlSugar.Snapshot;
- public class IndustryRepository : BaseRepository<Industry>, IIndustryRepository, IScopeDependency
- {
- public IndustryRepository(ISugarUnitOfWork<HotlineDbContext> uow, IDataPermissionFilterBuilder dataPermissionFilterBuilder, IServiceProvider serviceProvider) : base(uow, dataPermissionFilterBuilder, serviceProvider)
- {
- }
- public async Task<IList<dynamic>> GetDataBaseAsync()
- {
- var result = await Queryable()
- .Select(m => new { m.Id, m.Name })
- .ToListAsync();
- return result.Cast<dynamic>().ToList();
- }
- public async Task<double> GetIntervalTimeAsync(string industryId, double defaultValue, CancellationToken cancellationToken)
- {
- var time = await Queryable().Where(m => m.Id == industryId).Select(m => m.IntervalTime).FirstAsync(cancellationToken);
- if (time <= 0)
- return defaultValue;
- return time;
- }
- }
|