lixiaojun
2022-11-30 af918c1c2ebd53e4c9e1fee0da47e1a6c63a18bf
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
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using SqlSugar;
 
namespace IStation.DAL
{
    /// <summary>
    /// 客户字典值
    /// </summary>
    public partial class CorpDictData : CorpDAL_Sorter_UseStatus<Entity.CorpDictData>
    {
        /// <summary>
        ///  
        /// </summary>
        public override ConnectionConfig ConnectionConfig
        {
            get { return ConfigHelper.DefaultConnectionConfig; }
 
        }
 
        /// <summary>
        /// 通过 TypeID 获取
        /// </summary>
        public List<Entity.CorpDictData> GetByTypeID(long CorpID, long TypeID)
        {
            using (var db = new SqlSugarClient(ConnectionConfig))
            {
                return db.Queryable<Entity.CorpDictData>()
                    .Where(x => x.CorpID == CorpID && x.TypeID == TypeID)
                    .OrderBy(x => x.SortCode)
                    .ToList();
            }
        }
 
        /// <summary>
        /// 通过 TypeID 删除
        /// </summary>
        public bool DeleteByTypeID(long CorpID, long TypeID)
        {
            using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
            {
                return db.Deleteable<Entity.CorpDictData>()
                    .Where(x => x.CorpID == CorpID && x.TypeID == TypeID)
                    .ExecuteCommandHasChange();
            }
        }
 
 
 
 
    }
}