namespace Yw.DAL
|
{
|
/// <summary>
|
/// Dma点位映射关系
|
/// </summary>
|
public partial class DmaSiteMapping : BaseDAL<Entity.DmaSiteMapping>
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public override ConnectionConfig ConnectionConfig
|
{
|
get { return ConfigHelper.DefaultConnectionConfig; }
|
|
}
|
|
/// <summary>
|
/// 通过 AreaID 获取
|
/// </summary>
|
public List<Entity.DmaSiteMapping> GetByAreaID(long AreaID)
|
{
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Queryable<Entity.DmaSiteMapping>()
|
.Where(x => x.AreaID == AreaID).ToList();
|
}
|
}
|
|
/// <summary>
|
/// 通过 SiteID 获取
|
/// </summary>
|
public List<Entity.DmaSiteMapping> GetBySiteID(long SiteID)
|
{
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Queryable<Entity.DmaSiteMapping>()
|
.Where(x => x.SiteID == SiteID).ToList();
|
}
|
}
|
|
/// <summary>
|
/// 更新方向
|
/// </summary>
|
public bool UpdateDirection(long ID, int Direction)
|
{
|
using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Updateable<Entity.DmaSiteMapping>()
|
.SetColumns(x => x.Direction == Direction).Where(x => x.ID == ID)
|
.ExecuteCommandHasChange();
|
}
|
}
|
|
}
|
}
|