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 SignalType : BaseDAL_Sorter_TagName
{
///
///
///
public override ConnectionConfig ConnectionConfig
{
get { return ConfigHelper.DefaultConnectionConfig; }
}
///
/// 通过 GroupID 获取
///
public List GetByGroupID(long GroupID)
{
using (var db = new SqlSugarClient(ConnectionConfig))
{
return db.Queryable()
.Where(x => x.GroupID == GroupID).ToList();
}
}
///
/// 更新 GroupID
///
public bool UpdateGroupID(long ID,long GroupID)
{
using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
{
return db.Updateable()
.SetColumns(x => x.GroupID == GroupID)
.Where(x => x.ID == ID)
.ExecuteCommand() > 0;
}
}
///
/// 通过 GroupID 删除
///
public bool DeleteByGroupID(long GroupID)
{
using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
{
return db.Deleteable()
.Where(x => x.GroupID == GroupID)
.ExecuteCommand() > 0;
}
}
}
}