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