using OpenAuth.App.BaseApp.Base; using OpenAuth.Repository.Domain; using OpenAuth.Repository; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using OpenAuth.App.Interface; using SqlSugar; using Infrastructure; namespace OpenAuth.App.ServiceApp.DroneSsnydManage { public class DroneSsnyApp : SqlSugarBaseApp { public DroneSsnyApp(ISugarUnitOfWork unitWork, ISimpleClient repository, IAuth auth) : base(unitWork, repository, auth) { } /// /// 超期预警 /// /// /// /// public PageInfo> TimeoutWarning(int pageIndex, int pageSize) { int totalCount = 0; var endTime = DateTime.Now.AddMonths(2); var list = base.Repository.AsQueryable() .Where(a => a.end_time <= endTime&&a.end_time>DateTime.Now) .OrderBy(a => a.end_time, OrderByType.Desc) .ToPageList(pageIndex, pageSize, ref totalCount); return new PageInfo> { Items = list, Total = totalCount }; } /// /// 超期报警 /// /// /// /// public PageInfo> TimeOutAlarmList(int pageIndex, int pageSize) { int totalCount = 0; var endTime = DateTime.Now; var list = base.Repository.AsQueryable() .Where(a => a.end_time a.end_time, OrderByType.Desc) .ToPageList(pageIndex, pageSize, ref totalCount); return new PageInfo> { Items = list, Total = totalCount }; } } }