using SqlSugar; using System; using System.Collections.Generic; using System.Data; using System.Linq; namespace IStation.DAL { /// /// 建筑物 /// public partial class Building : CorpTraceDAL_Sorter_UseStatus_TagName_TerminalId { /// /// /// public override ConnectionConfig ConnectionConfig { get { return ConfigHelper.DefaultConnectionConfig; } } /// /// 更新类型 /// public bool UpdateType(long CorpID, long ID, string Type,long UpdateUserID,DateTime UpdateTime) { using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig)) { return db.Updateable() .SetColumns(x => x.Type == Type) .SetColumns(x=>x.UpdateUserID==UpdateUserID) .SetColumns(x=>x.UpdateTime==UpdateTime) .Where(x => x.CorpID == CorpID && x.ID == ID) .ExecuteCommand() > 0; } } /// /// 通过 BelongType 和BelongID 获取 /// public List GetByBelongTypeAndBelongID(long CorpID, string BelongType, long BelongID) { using (var db = new SqlSugarClient(ConnectionConfig)) { return db.Queryable() .Where(x => x.CorpID == CorpID && x.BelongType == BelongType && x.BelongID == BelongID).ToList(); } } } }