using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using SqlSugar; namespace IStation.DAL { /// /// Dma点位映射关系 /// public partial class DmaSiteMapping : CorpDAL { /// /// /// public override ConnectionConfig ConnectionConfig { get { return ConfigHelper.DefaultConnectionConfig; } } /// /// 通过 DmaAreaID 获取 /// public List GetByDmaAreaID(long CorpID, long DmaAreaID) { using (var db = new SqlSugarClient(ConnectionConfig)) { return db.Queryable() .Where(x => x.CorpID == CorpID && x.DmaAreaID == DmaAreaID).ToList(); } } /// /// 通过 DmaSiteID 获取 /// public List GetByDmaSiteID(long CorpID, long DmaSiteID) { using (var db = new SqlSugarClient(ConnectionConfig)) { return db.Queryable() .Where(x => x.CorpID == CorpID && x.DmaSiteID == DmaSiteID).ToList(); } } /// /// 更新方向 /// public bool UpdateDirection(long CorpID, long ID, int Direction) { using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig)) { return db.Updateable() .SetColumns(x => x.Direction == Direction).Where(x => x.CorpID == CorpID && x.ID == ID) .ExecuteCommand() > 0; } } } }