using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using SqlSugar; namespace IStation.DAL { /// /// 管路 /// public partial class PipeLine : CorpDAL_Sorter_UseStatus_TagName_TerminalId { /// /// /// public override ConnectionConfig ConnectionConfig { get { return ConfigHelper.DefaultConnectionConfig; } } /// /// 通过 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(); } } /// /// 更新 Position /// public bool UpdatePosition(long CorpID, long ID, string Position) { using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig)) { return db.Updateable() .SetColumns(x => x.Position == Position).Where(x => x.CorpID == CorpID && x.ID == ID) .ExecuteCommand() > 0; } } /// /// 更新 Flags /// public bool UpdateFlags(long CorpID, long ID, string Flags) { using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig)) { return db.Updateable() .SetColumns(x => x.Flags == Flags).Where(x => x.CorpID == CorpID && x.ID == ID) .ExecuteCommand() > 0; } } } }