using System;
|
using System.Collections.Generic;
|
using System.Data;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using System.Transactions;
|
using SqlSugar;
|
|
namespace IStation.DAL
|
{
|
/// <summary>
|
/// 对象地图信息
|
/// </summary>
|
public partial class ObjectMapInfo : CorpDAL<Entity.ObjectMapInfo>
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public override ConnectionConfig ConnectionConfig
|
{
|
get { return ConfigHelper.DefaultConnectionConfig; }
|
|
}
|
|
/// <summary>
|
/// 更新 ObjectName
|
/// </summary>
|
public bool UpdateObjectName(long CorpID, long ID, string ObjectName)
|
{
|
using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Updateable<Entity.ObjectMapInfo>()
|
.SetColumns(x => x.ObjectName == ObjectName)
|
.Where(x => x.CorpID == CorpID && x.ID == ID)
|
.ExecuteCommand() > 0;
|
}
|
}
|
|
/// <summary>
|
/// 更新位置信息
|
/// </summary>
|
public bool UpdatePosition(long CorpID, long ID, string Position)
|
{
|
using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Updateable<Entity.ObjectMapInfo>()
|
.SetColumns(x => x.Position == Position)
|
.Where(x => x.CorpID == CorpID && x.ID == ID)
|
.ExecuteCommand() > 0;
|
}
|
}
|
|
/// <summary>
|
/// 通过 ObjectType 和 ObjectID 获取
|
/// </summary>
|
public List<Entity.ObjectMapInfo> GetByObjectTypeAndObjectID(long CorpID, string ObjectType, long ObjectID)
|
{
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Queryable<Entity.ObjectMapInfo>()
|
.Where(x => x.CorpID == CorpID && x.ObjectType == ObjectType && x.ObjectID == ObjectID).ToList();
|
}
|
}
|
|
|
|
}
|
}
|