using JY.DAL.Repository; using JY.Model; using System; using System.Collections.Generic; using System.Linq.Expressions; namespace JY.DAL.Service { public interface IAlarmDataService : IService { List GetAlarmDataByTime(string startTime, string endTime); List GetAlarmCacheData(); int DeleteAlarmCacheData(); } public class AlarmDataService : Service, IAlarmDataService { public AlarmDataService(IRepository repository) : base(repository) { } public List GetAlarmDataByTime(string startTime, string endTime) { return _repository.GetList(x => x.StartTime >= Convert.ToDateTime(startTime) && x.StartTime <= Convert.ToDateTime(endTime)); } public List GetAlarmCacheData() { return _repository.GetList(x => x.Flag == 0); } public int DeleteAlarmCacheData() { return _repository.Delete(x => x.Flag == 0); } } }