namespace Yw.DAL
{
///
/// Dma分区
///
public partial class DmaArea : BaseTraceDAL_Sorter_Paras_Flags_TagName
{
///
///
///
public override ConnectionConfig ConnectionConfig
{
get { return ConfigHelper.DefaultConnectionConfig; }
}
///
/// 通过 BelongType 和 BelongID 获取
///
public List GetByBelongTypeAndBelongID(string BelongType, long BelongID)
{
using (var db = new SqlSugarClient(ConnectionConfig))
{
return db.Queryable()
.Where(x => x.BelongType == BelongType && x.BelongID == BelongID)
.OrderBy(x => x.SortCode).ToList();
}
}
///
/// 更新 Code
///
public bool UpdateCode(long ID, string Code, long UpdateUserID, DateTime UpdateTime, string UpdateUserName)
{
using (var db = new SqlSugarClient(ConnectionConfig))
{
return db.Updateable()
.SetColumns(x => x.Code == Code)
.SetColumns(x => x.UpdateUserID == UpdateUserID)
.SetColumns(x => x.UpdateTime == UpdateTime)
.SetColumns(x => x.UpdateUserName == UpdateUserName)
.Where(x => x.ID == ID)
.ExecuteCommandHasChange();
}
}
}
}