mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-18 17:48:11 +08:00
Update TDengine
This commit is contained in:
@@ -12,7 +12,7 @@ namespace SqlSugar.TDengine
|
|||||||
{
|
{
|
||||||
protected override void Execute(Type entityType, EntityInfo entityInfo)
|
protected override void Execute(Type entityType, EntityInfo entityInfo)
|
||||||
{
|
{
|
||||||
var attr = entityInfo.Type.GetCustomAttribute<STableAttribute>();
|
var attr =GetCommonSTableAttribute( entityInfo.Type.GetCustomAttribute<STableAttribute>());
|
||||||
if (attr?.STableName!=null&&attr?.Tag1!=null)
|
if (attr?.STableName!=null&&attr?.Tag1!=null)
|
||||||
{
|
{
|
||||||
entityInfo.DbTableName = attr.STableName;
|
entityInfo.DbTableName = attr.STableName;
|
||||||
@@ -98,7 +98,7 @@ namespace SqlSugar.TDengine
|
|||||||
var tableName = GetTableName(entityInfo);
|
var tableName = GetTableName(entityInfo);
|
||||||
var dbColumns = this.Context.DbMaintenance.GetColumnInfosByTableName(tableName, false);
|
var dbColumns = this.Context.DbMaintenance.GetColumnInfosByTableName(tableName, false);
|
||||||
ConvertColumns(dbColumns);
|
ConvertColumns(dbColumns);
|
||||||
var attr = entityInfo.Type.GetCustomAttribute<STableAttribute>();
|
var attr =GetCommonSTableAttribute( entityInfo.Type.GetCustomAttribute<STableAttribute>());
|
||||||
var entityColumns = entityInfo.Columns.Where(it => it.IsIgnore == false).ToList();
|
var entityColumns = entityInfo.Columns.Where(it => it.IsIgnore == false).ToList();
|
||||||
if (attr != null && attr.Tag1 != null)
|
if (attr != null && attr.Tag1 != null)
|
||||||
{
|
{
|
||||||
@@ -222,7 +222,7 @@ namespace SqlSugar.TDengine
|
|||||||
var addItem = EntityColumnToDbColumn(entityInfo, entityInfo.DbTableName, item);
|
var addItem = EntityColumnToDbColumn(entityInfo, entityInfo.DbTableName, item);
|
||||||
dbColumns.Add(addItem);
|
dbColumns.Add(addItem);
|
||||||
}
|
}
|
||||||
var attr = entityInfo.Type.GetCustomAttribute<STableAttribute>();
|
var attr =GetCommonSTableAttribute( entityInfo.Type.GetCustomAttribute<STableAttribute>());
|
||||||
var oldTableName = entityInfo.DbTableName;
|
var oldTableName = entityInfo.DbTableName;
|
||||||
if (attr != null)
|
if (attr != null)
|
||||||
{
|
{
|
||||||
@@ -249,7 +249,11 @@ namespace SqlSugar.TDengine
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private STableAttribute GetCommonSTableAttribute(STableAttribute sTableAttribute)
|
||||||
|
{
|
||||||
|
return sTableAttribute;
|
||||||
|
}
|
||||||
public string GetDatabaseTypeName(string typeName)
|
public string GetDatabaseTypeName(string typeName)
|
||||||
{
|
{
|
||||||
switch (typeName.ToLower())
|
switch (typeName.ToLower())
|
||||||
|
@@ -473,7 +473,7 @@ namespace SqlSugar.TDengine
|
|||||||
public override void AddDefaultValue(EntityInfo entityInfo)
|
public override void AddDefaultValue(EntityInfo entityInfo)
|
||||||
{
|
{
|
||||||
var talbeName = entityInfo.DbTableName;
|
var talbeName = entityInfo.DbTableName;
|
||||||
var attr = entityInfo.Type.GetCustomAttribute<STableAttribute>();
|
var attr = GetCommonSTableAttribute(entityInfo.Type.GetCustomAttribute<STableAttribute>());
|
||||||
if (attr?.Tag1 != null)
|
if (attr?.Tag1 != null)
|
||||||
{
|
{
|
||||||
talbeName = attr.STableName;
|
talbeName = attr.STableName;
|
||||||
@@ -493,6 +493,11 @@ namespace SqlSugar.TDengine
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private STableAttribute GetCommonSTableAttribute(STableAttribute sTableAttribute)
|
||||||
|
{
|
||||||
|
return sTableAttribute;
|
||||||
|
}
|
||||||
|
|
||||||
public override List<DbColumnInfo> GetColumnInfosByTableName(string tableName, bool isCache = true)
|
public override List<DbColumnInfo> GetColumnInfosByTableName(string tableName, bool isCache = true)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@@ -124,5 +124,10 @@ namespace SqlSugar
|
|||||||
});
|
});
|
||||||
return groups;
|
return groups;
|
||||||
}
|
}
|
||||||
|
private STableAttribute GetCommonSTableAttribute(STableAttribute sTableAttribute)
|
||||||
|
{
|
||||||
|
return sTableAttribute;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user