ningshuxia
2022-12-12 4f1314cb69a47c22e52f1efdc4b4be6c1d55143d
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
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
 
namespace IStation.DAL
{
    /// <summary>
    ///  
    /// </summary>
    public partial class SpecialProperty : CorpTraceDAL_Sorter<Entity.SpecialProperty> 
    {
        /// <summary>
        /// 
        /// </summary>
        public override ConnectionConfig ConnectionConfig
        {
            get { return ConfigHelper.DefaultConnectionConfig; }
 
        }
 
        /// <summary>
        /// 通过 GroupID 获取
        /// </summary>
        public List<Entity.SpecialProperty> GetByGroupID(long CorpID, long GroupID)
        {
            using (var db = new SqlSugarClient(ConnectionConfig))
            {
                return db.Queryable<Entity.SpecialProperty>().Where(x => x.CorpID == CorpID && x.GroupID == GroupID).ToList();
            }
        }
 
 
        /// <summary>
        /// 更新 GroupID
        /// </summary>
        public bool UpdateGroupID(long CorpID, long ID, long GroupID, long UpdateUserID, DateTime UpdateTime)
        {
            using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
            {
                return db.Updateable<Entity.SpecialProperty>()
                    .SetColumns(x => x.GroupID == GroupID)
                    .SetColumns(x => x.UpdateUserID == UpdateUserID)
                    .SetColumns(x => x.UpdateTime == UpdateTime)
                    .Where(x => x.CorpID == CorpID && x.ID == ID)
                    .ExecuteCommand() > 0;
            }
        }
 
 
    }
}