添加项目文件。
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
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<AlarmData>
|
||||
{
|
||||
List<AlarmData> GetAlarmDataByTime(string startTime, string endTime);
|
||||
|
||||
List<AlarmData> GetAlarmCacheData();
|
||||
|
||||
int DeleteAlarmCacheData();
|
||||
}
|
||||
|
||||
public class AlarmDataService : Service<AlarmData>, IAlarmDataService
|
||||
{
|
||||
public AlarmDataService(IRepository<AlarmData> repository) : base(repository)
|
||||
{
|
||||
}
|
||||
|
||||
public List<AlarmData> GetAlarmDataByTime(string startTime, string endTime)
|
||||
{
|
||||
return _repository.GetList(x => x.StartTime >= Convert.ToDateTime(startTime) && x.StartTime <= Convert.ToDateTime(endTime));
|
||||
}
|
||||
|
||||
public List<AlarmData> GetAlarmCacheData()
|
||||
{
|
||||
return _repository.GetList(x => x.Flag == 0);
|
||||
}
|
||||
|
||||
public int DeleteAlarmCacheData()
|
||||
{
|
||||
return _repository.Delete(x => x.Flag == 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user