using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace IStation.Service
|
{
|
/// <summary>
|
/// 监测波动记录(一个信号只能有一条)
|
/// </summary>
|
public partial class MonitorFluctRecord
|
{
|
private readonly DAL.MonitorFluctRecord _dal = new DAL.MonitorFluctRecord();
|
|
/// <summary>
|
/// 通过 MonitorPointID 获取
|
/// </summary>
|
public List<Model.MonitorFluctRecord> GetByMonitorPointID(long CorpID, long MonitorPointID)
|
{
|
var entity_list = _dal.GetByMonitorPointID(CorpID, MonitorPointID);
|
var model_list = Entity2Models(entity_list);
|
return model_list;
|
}
|
|
/// <summary>
|
/// 通过 SignalID 获取
|
/// </summary>
|
public Model.MonitorFluctRecord GetBySignalID(long CorpID, long MonitorPointID, long SignalID)
|
{
|
var entity = _dal.GetBySignalID(CorpID, MonitorPointID, SignalID);
|
var model = Entity2Model(entity);
|
return model;
|
}
|
|
/// <summary>
|
/// 通过 SignalID 判断是否存在
|
/// </summary>
|
public bool IsExistBySignalID(long CorpID, long MonitorPointID, long SignalID)
|
{
|
return _dal.IsExistBySignalID(CorpID, MonitorPointID, SignalID);
|
}
|
|
/// <summary>
|
/// 通过 MonitorPointID 判断是否存在
|
/// </summary>
|
public bool IsExistByMonitorPointID(long CorpID, long MonitorPointID)
|
{
|
return _dal.IsExistByMonitorPointID(CorpID,MonitorPointID);
|
}
|
|
/// <summary>
|
/// 插入或更新
|
/// </summary>
|
public bool InsertOrUpdate(Model.MonitorFluctRecord model)
|
{
|
if (model == null)
|
return false;
|
var entity = Model2Entity(model);
|
return _dal.InsertOrUpdate(entity);
|
}
|
|
}
|
}
|