schangxiang@126.com
2025-11-04 f5ed29dc26c7cd952d56ec5721a2efc43cd25992
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
using DataEntity.Device;
using DataRWDAL.Base;
using System.Collections.Generic;
 
namespace DataRWDAL.Device
{
    /// <summary>
    /// 设备点位表
    /// </summary>
    public class DeviceConfigPointDB : BaseDB
    {
        /// <summary>
        /// 获取设备点位列表
        /// </summary>
        /// <param name="projectId"></param>
        /// <returns></returns>
        public static List<DeviceConfigPointModel> GetDevicePointByProjectId(string projectId)
        {
            using (var db = GetInstance())
            {
                return db.Queryable<DeviceConfigPointModel>().Where(it => it.ProjectId.Equals(projectId)).OrderBy(it => it.PointName).ToList();
            }
        }
 
        /// <summary>
        /// 根据主键ID,设备点位信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static DeviceConfigPointModel GetDevicePointById(string id)
        {
            using (var db = GetInstance())
            {
                return db.Queryable<DeviceConfigPointModel>().Single(it => it.Id.Equals(id));
            }
        }
    }
}