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
{
///
/// 对象地图信息
///
public partial class ObjectMapInfo : CorpDAL
{
///
///
///
public override ConnectionConfig ConnectionConfig
{
get { return ConfigHelper.DefaultConnectionConfig; }
}
///
/// 更新 ObjectName
///
public bool UpdateObjectName(long CorpID, long ID, string ObjectName)
{
using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
{
return db.Updateable()
.SetColumns(x => x.ObjectName == ObjectName)
.Where(x => x.CorpID == CorpID && x.ID == ID)
.ExecuteCommand() > 0;
}
}
///
/// 更新位置信息
///
public bool UpdatePosition(long CorpID, long ID, string Position)
{
using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
{
return db.Updateable()
.SetColumns(x => x.Position == Position)
.Where(x => x.CorpID == CorpID && x.ID == ID)
.ExecuteCommand() > 0;
}
}
///
/// 通过 ObjectType 和 ObjectID 获取
///
public List GetByObjectTypeAndObjectID(long CorpID, string ObjectType, long ObjectID)
{
using (var db = new SqlSugarClient(ConnectionConfig))
{
return db.Queryable()
.Where(x => x.CorpID == CorpID && x.ObjectType == ObjectType && x.ObjectID == ObjectID).ToList();
}
}
}
}