using SqlSugar;
|
using System;
|
using System.Collections.Generic;
|
using System.Data;
|
using System.Linq;
|
|
namespace IStation.DAL
|
{
|
/// <summary>
|
/// 建筑物
|
/// </summary>
|
public partial class Building : CorpTraceDAL_Sorter_UseStatus_TagName_TerminalId<Entity.Building>
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public override ConnectionConfig ConnectionConfig
|
{
|
get { return ConfigHelper.DefaultConnectionConfig; }
|
|
}
|
|
/// <summary>
|
/// 更新类型
|
/// </summary>
|
public bool UpdateType(long CorpID, long ID, string Type,long UpdateUserID,DateTime UpdateTime)
|
{
|
using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Updateable<Entity.Building>()
|
.SetColumns(x => x.Type == Type)
|
.SetColumns(x=>x.UpdateUserID==UpdateUserID)
|
.SetColumns(x=>x.UpdateTime==UpdateTime)
|
.Where(x => x.CorpID == CorpID && x.ID == ID)
|
.ExecuteCommand() > 0;
|
}
|
}
|
|
/// <summary>
|
/// 通过 BelongType 和BelongID 获取
|
/// </summary>
|
public List<Entity.Building> GetByBelongTypeAndBelongID(long CorpID, string BelongType, long BelongID)
|
{
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Queryable<Entity.Building>()
|
.Where(x => x.CorpID == CorpID && x.BelongType == BelongType && x.BelongID == BelongID).ToList();
|
}
|
}
|
|
|
|
|
|
}
|
}
|