using System;
|
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 PipeLine : CorpDAL_Sorter_UseStatus_TagName_TerminalId<Entity.PipeLine>
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public override ConnectionConfig ConnectionConfig
|
{
|
get { return ConfigHelper.DefaultConnectionConfig; }
|
|
}
|
|
/// <summary>
|
/// 通过 BelongType 和 BelongID 获取
|
/// </summary>
|
public List<Entity.PipeLine> GetByBelongTypeAndBelongID(long CorpID, string BelongType, long BelongID)
|
{
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Queryable<Entity.PipeLine>()
|
.Where(x => x.CorpID == CorpID && x.BelongType == BelongType && x.BelongID == BelongID).ToList();
|
}
|
}
|
|
/// <summary>
|
/// 更新 Position
|
/// </summary>
|
public bool UpdatePosition(long CorpID, long ID, string Position)
|
{
|
using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Updateable<Entity.PipeLine>()
|
.SetColumns(x => x.Position == Position).Where(x => x.CorpID == CorpID && x.ID == ID)
|
.ExecuteCommand() > 0;
|
}
|
}
|
|
/// <summary>
|
/// 更新 Flags
|
/// </summary>
|
public bool UpdateFlags(long CorpID, long ID, string Flags)
|
{
|
using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Updateable<Entity.PipeLine>()
|
.SetColumns(x => x.Flags == Flags).Where(x => x.CorpID == CorpID && x.ID == ID)
|
.ExecuteCommand() > 0;
|
}
|
}
|
|
|
|
|
}
|
}
|