namespace Yw.DAL
|
{
|
/// <summary>
|
/// 泵曲线
|
/// </summary>
|
public partial class PumpCurve : BaseDAL<Entity.PumpCurve>
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public override ConnectionConfig ConnectionConfig
|
{
|
get { return ConfigHelper.DefaultConnectionConfig; }
|
|
}
|
|
|
/// <summary>
|
/// 更新 CurveInfo
|
/// </summary>
|
public bool UpdateCurveInfo(long ID, string CurveInfo, long UpdateUserID, DateTime UpdateTime)
|
{
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Updateable<Entity.PumpCurve>()
|
.SetColumns(x => x.CurveInfo == CurveInfo)
|
.SetColumns(x => x.UpdateUserID == UpdateUserID)
|
.SetColumns(x => x.UpdateTime == UpdateTime)
|
.Where(x => x.ID == ID).ExecuteCommandHasChange();
|
}
|
}
|
|
/// <summary>
|
/// 更新 CoordParas
|
/// </summary>
|
public bool UpdateCoordParas(long ID, string CoordParas, long UpdateUserID, DateTime UpdateTime)
|
{
|
using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Updateable<Entity.PumpCurve>()
|
.SetColumns(x => x.CoordParas == CoordParas)
|
.SetColumns(x => x.UpdateUserID == UpdateUserID)
|
.SetColumns(x => x.UpdateTime == UpdateTime)
|
.Where(x => x.ID == ID).ExecuteCommandHasChange();
|
}
|
}
|
|
/// <summary>
|
/// 更新可信度
|
/// </summary>
|
public bool UpdateReliabilityStatus(long ID, int ReliabilityStatus, long UpdateUserID, DateTime UpdateTime)
|
{
|
using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Updateable<Entity.PumpCurve>()
|
.SetColumns(x => x.ReliabilityStatus == ReliabilityStatus)
|
.SetColumns(x => x.UpdateUserID == UpdateUserID)
|
.SetColumns(x => x.UpdateTime == UpdateTime)
|
.Where(x => x.ID == ID).ExecuteCommandHasChange();
|
}
|
}
|
|
/// <summary>
|
/// 通过 ID 删除 同时删除映射
|
/// </summary>
|
public bool DeleteExByID(long ID)
|
{
|
using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
|
{
|
try
|
{
|
db.BeginTran();
|
var bol = db.Deleteable<Entity.PumpCurve>().Where(x => x.ID == ID).ExecuteCommand() > 0;
|
if (!bol)
|
{
|
db.RollbackTran();
|
return default;
|
}
|
db.Deleteable<Entity.PumpCurveMapping>().Where(x => x.CurveID == ID).ExecuteCommand();
|
db.CommitTran();
|
return true;
|
}
|
catch
|
{
|
db.RollbackTran();
|
throw;
|
}
|
}
|
}
|
|
|
|
|
}
|
}
|