using System.Collections.Generic;
|
using System.Data;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using SqlSugar;
|
|
|
namespace IStation.DAL
|
{
|
/// <summary>
|
/// 信号类型
|
/// </summary>
|
public partial class SignalType : BaseDAL_Sorter_TagName<Entity.SignalType>
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public override ConnectionConfig ConnectionConfig
|
{
|
get { return ConfigHelper.DefaultConnectionConfig; }
|
|
}
|
|
/// <summary>
|
/// 通过 GroupID 获取
|
/// </summary>
|
public List<Entity.SignalType> GetByGroupID(long GroupID)
|
{
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Queryable<Entity.SignalType>()
|
.Where(x => x.GroupID == GroupID).ToList();
|
}
|
}
|
|
/// <summary>
|
/// 更新 GroupID
|
/// </summary>
|
public bool UpdateGroupID(long ID,long GroupID)
|
{
|
using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Updateable<Entity.SignalType>()
|
.SetColumns(x => x.GroupID == GroupID)
|
.Where(x => x.ID == ID)
|
.ExecuteCommand() > 0;
|
}
|
}
|
|
/// <summary>
|
/// 通过 GroupID 删除
|
/// </summary>
|
public bool DeleteByGroupID(long GroupID)
|
{
|
using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Deleteable<Entity.SignalType>()
|
.Where(x => x.GroupID == GroupID)
|
.ExecuteCommand() > 0;
|
}
|
}
|
|
|
|
}
|
}
|