lixiaojun
2022-08-12 424d2d20a24b76850b73fae8ecc9bc98505be4f5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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);
        }
 
    }
}