using Yw.DAL.PostgreSql;
|
|
namespace HStation.DAL.PostgreSql
|
{
|
/// <summary>
|
/// 泵曲线映射
|
/// </summary>
|
public partial class XhsPhartGraph : BaseDAL_Paras_Flags_Sorter<Entity.XhsPhartGraph>, IXhsPhartGraph
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public override ConnectionConfig ConnectionConfig
|
{
|
get { return Xhs.ConfigHelper.PostgreSqlConnectionConfig; }
|
}
|
|
/// <summary>
|
/// 通过 DiagramID 获取
|
/// </summary>
|
public List<Entity.XhsPhartGraph> GetByDiagramID(long DiagramID)
|
{
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Queryable<Entity.XhsPhartGraph>()
|
.Where(x => x.DiagramID == DiagramID)
|
.OrderBy(x => x.SortCode).ToList();
|
}
|
}
|
|
/// <summary>
|
/// 通过 DiagramIds 获取
|
/// </summary>
|
public List<Entity.XhsPhartGraph> GetByDiagramIds(List<long> DiagramIds)
|
{
|
if (DiagramIds == null || DiagramIds.Count < 1)
|
{
|
return default;
|
}
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Queryable<Entity.XhsPhartGraph>()
|
.Where(x => DiagramIds.Contains(x.DiagramID))
|
.OrderBy(x => x.SortCode).ToList();
|
}
|
}
|
|
/// <summary>
|
/// 更新 GraphParas
|
/// </summary>
|
public bool UpdateGraphParas(long ID, string GraphParas)
|
{
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Updateable<Entity.XhsPhartGraph>()
|
.SetColumns(x => x.GraphParas == GraphParas)
|
.Where(x => x.ID == ID)
|
.ExecuteCommandHasChange();
|
}
|
}
|
|
/// <summary>
|
/// 更新 GraphInfo
|
/// </summary>
|
public bool UpdateGraphInfo(long ID, string GraphInfo)
|
{
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Updateable<Entity.XhsPhartGraph>()
|
.SetColumns(x => x.GraphInfo == GraphInfo)
|
.Where(x => x.ID == ID)
|
.ExecuteCommandHasChange();
|
}
|
}
|
|
/// <summary>
|
/// 更新 GeometryParas
|
/// </summary>
|
public bool UpdateGeometryParas(long ID, string GeometryParas)
|
{
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Updateable<Entity.XhsPhartGraph>()
|
.SetColumns(x => x.GeometryParas == GeometryParas)
|
.Where(x => x.ID == ID)
|
.ExecuteCommandHasChange();
|
}
|
}
|
|
/// <summary>
|
/// 更新 GeometryInfo
|
/// </summary>
|
public bool UpdateGeometryInfo(long ID, string GeometryInfo)
|
{
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Updateable<Entity.XhsPhartGraph>()
|
.SetColumns(x => x.GeometryInfo == GeometryInfo)
|
.Where(x => x.ID == ID)
|
.ExecuteCommandHasChange();
|
}
|
}
|
|
/// <summary>
|
/// 更新 DispParas
|
/// </summary>
|
public bool UpdateDispParas(long ID, string DispParas)
|
{
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Updateable<Entity.XhsPhartGraph>()
|
.SetColumns(x => x.DispParas == DispParas)
|
.Where(x => x.ID == ID)
|
.ExecuteCommandHasChange();
|
}
|
}
|
|
/// <summary>
|
/// 更新 ExtraParas
|
/// </summary>
|
public bool UpdateExtraParas(long ID, string ExtraParas)
|
{
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Updateable<Entity.XhsPhartGraph>()
|
.SetColumns(x => x.ExtraParas == ExtraParas)
|
.Where(x => x.ID == ID)
|
.ExecuteCommandHasChange();
|
}
|
}
|
|
/// <summary>
|
/// 通过 DiagramID 删除
|
/// </summary>
|
public bool DeleteByDiagramID(long DiagramID)
|
{
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Deleteable<Entity.XhsPhartGraph>()
|
.Where(x => x.DiagramID == DiagramID)
|
.ExecuteCommandHasChange();
|
}
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
}
|