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
namespace Yw.DAL
{
    /// <summary>
    /// Dma分区
    /// </summary>
    public partial class DmaArea : BaseTraceDAL_Sorter_Paras_Flags_TagName<Entity.DmaArea>
    {
        /// <summary>
        /// 
        /// </summary>
        public override ConnectionConfig ConnectionConfig
        {
            get { return ConfigHelper.DefaultConnectionConfig; }
 
        }
 
        /// <summary>
        /// 通过 BelongType 和 BelongID 获取
        /// </summary>
        public List<Entity.DmaArea> GetByBelongTypeAndBelongID(string BelongType, long BelongID)
        {
            using (var db = new SqlSugarClient(ConnectionConfig))
            {
                return db.Queryable<Entity.DmaArea>()
                    .Where(x => x.BelongType == BelongType && x.BelongID == BelongID)
                    .OrderBy(x => x.SortCode).ToList();
            }
        }
 
        /// <summary>
        /// 更新 Code
        /// </summary>
        public bool UpdateCode(long ID, string Code, long UpdateUserID, DateTime UpdateTime, string UpdateUserName)
        {
            using (var db = new SqlSugarClient(ConnectionConfig))
            {
                return db.Updateable<Entity.DmaArea>()
                        .SetColumns(x => x.Code == Code)
                        .SetColumns(x => x.UpdateUserID == UpdateUserID)
                        .SetColumns(x => x.UpdateTime == UpdateTime)
                        .SetColumns(x => x.UpdateUserName == UpdateUserName)
                        .Where(x => x.ID == ID)
                        .ExecuteCommandHasChange();
            }
        }
 
 
 
 
    }
}