lixiaojun
2024-01-27 96fa591001d50f6bd8d79c948045c8e1d79c8931
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
namespace Yw.DAL
{
    /// <summary>
    /// Dma点位映射关系
    /// </summary>
    public partial class DmaSiteMapping : BaseDAL<Entity.DmaSiteMapping>
    {
        /// <summary>
        /// 
        /// </summary>
        public override ConnectionConfig ConnectionConfig
        {
            get { return ConfigHelper.DefaultConnectionConfig; }
 
        }
 
        /// <summary>
        /// 通过 AreaID 获取
        /// </summary>
        public List<Entity.DmaSiteMapping> GetByAreaID(long AreaID)
        {
            using (var db = new SqlSugarClient(ConnectionConfig))
            {
                return db.Queryable<Entity.DmaSiteMapping>()
                    .Where(x => x.AreaID == AreaID).ToList();
            }
        }
 
        /// <summary>
        /// 通过 SiteID 获取
        /// </summary>
        public List<Entity.DmaSiteMapping> GetBySiteID(long SiteID)
        {
            using (var db = new SqlSugarClient(ConnectionConfig))
            {
                return db.Queryable<Entity.DmaSiteMapping>()
                    .Where(x => x.SiteID == SiteID).ToList();
            }
        }
 
        /// <summary>
        /// 更新方向
        /// </summary>
        public bool UpdateDirection(long ID, int Direction)
        {
            using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
            {
                return db.Updateable<Entity.DmaSiteMapping>()
                    .SetColumns(x => x.Direction == Direction).Where(x => x.ID == ID)
                    .ExecuteCommandHasChange();
            }
        }
 
    }
}