mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-02 20:02:47 +08:00
Update TDengine
This commit is contained in:
parent
86891dc07a
commit
62b67ea93a
@ -1,4 +1,4 @@
|
||||
using SqlSugar.TDengineAdo;
|
||||
using SqlSugar.TDengineAdo;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
|
@ -0,0 +1,29 @@
|
||||
using SqlSugar.TDengine;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
namespace SqlSugar
|
||||
{
|
||||
public static class SqlSugarExtensions
|
||||
{
|
||||
public static void MappingSTableName<T>(this ISqlSugarClient db,string newSTableName)
|
||||
{
|
||||
STableAttribute sTableAttribute = typeof(T).GetCustomAttribute<STableAttribute>();
|
||||
if (db.TempItems == null)
|
||||
{
|
||||
db.TempItems = new Dictionary<string, object>();
|
||||
}
|
||||
if (sTableAttribute != null)
|
||||
{
|
||||
var key = "GetCommonSTableAttribute_" + sTableAttribute.STableName;
|
||||
if (db.TempItems.ContainsKey(key))
|
||||
{
|
||||
db.TempItems.Remove(key);
|
||||
}
|
||||
db.TempItems.Add(key, newSTableName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -19,7 +19,12 @@ namespace SqlSugar.TDengine
|
||||
{
|
||||
public static STableAttribute GetCommonSTableAttribute(ISqlSugarClient db,STableAttribute sTableAttribute)
|
||||
{
|
||||
return sTableAttribute;
|
||||
var key = "GetCommonSTableAttribute_" + sTableAttribute?.STableName;
|
||||
if (db.TempItems?.ContainsKey(key) == true)
|
||||
{
|
||||
sTableAttribute.STableName = db.TempItems[key] +"";
|
||||
}
|
||||
return sTableAttribute!;
|
||||
}
|
||||
public static long ToUnixTimestamp(DateTime dateTime)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user