mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-06-28 13:34:32 +08:00
Update TDengine
This commit is contained in:
parent
9a5f4fe03d
commit
6522c5cb3d
@ -11,3 +11,9 @@ dotnet_diagnostic.CS8604.severity = none
|
|||||||
|
|
||||||
# CS8600: 将 null 字面量或可能为 null 的值转换为非 null 类型。
|
# CS8600: 将 null 字面量或可能为 null 的值转换为非 null 类型。
|
||||||
dotnet_diagnostic.CS8600.severity = none
|
dotnet_diagnostic.CS8600.severity = none
|
||||||
|
|
||||||
|
# IDE0058: 永远不会使用表达式值
|
||||||
|
dotnet_diagnostic.IDE0058.severity = silent
|
||||||
|
|
||||||
|
# CS8602: 解引用可能出现空引用。
|
||||||
|
dotnet_diagnostic.CS8602.severity = none
|
||||||
|
@ -80,9 +80,13 @@ namespace SqlSugar.TDengine
|
|||||||
return GetDbColumn(it, null);
|
return GetDbColumn(it, null);
|
||||||
}
|
}
|
||||||
object value = null;
|
object value = null;
|
||||||
if (it.Value is DateTime)
|
if (it?.Value is DateTime)
|
||||||
{
|
{
|
||||||
value = ((DateTime)it.Value).ToString("O");
|
value = it.Value.ObjToDate().ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
}
|
||||||
|
else if (it?.Value is bool)
|
||||||
|
{
|
||||||
|
value = value?.ToString()?.ToLower();
|
||||||
}
|
}
|
||||||
else if (it.Value is DateTimeOffset)
|
else if (it.Value is DateTimeOffset)
|
||||||
{
|
{
|
||||||
|
@ -16,6 +16,19 @@ namespace SqlSugar.TDengine
|
|||||||
{
|
{
|
||||||
public class UtilMethods
|
public class UtilMethods
|
||||||
{
|
{
|
||||||
|
public static long ToUnixTimestamp(DateTime dateTime)
|
||||||
|
{
|
||||||
|
// If the DateTime is Utc, use ToUnixTimeMilliseconds directly
|
||||||
|
if (dateTime.Kind == DateTimeKind.Utc)
|
||||||
|
{
|
||||||
|
return new DateTimeOffset(dateTime).ToUnixTimeMilliseconds();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Convert local DateTime to Utc before converting to Unix timestamp
|
||||||
|
return new DateTimeOffset(dateTime.ToUniversalTime()).ToUnixTimeMilliseconds();
|
||||||
|
}
|
||||||
|
}
|
||||||
internal static DateTime GetMinDate(ConnectionConfig currentConnectionConfig)
|
internal static DateTime GetMinDate(ConnectionConfig currentConnectionConfig)
|
||||||
{
|
{
|
||||||
if (currentConnectionConfig.MoreSettings == null)
|
if (currentConnectionConfig.MoreSettings == null)
|
||||||
|
@ -57,6 +57,31 @@ namespace OrmTest
|
|||||||
voltage = 11
|
voltage = 11
|
||||||
}).ExecuteCommand();
|
}).ExecuteCommand();
|
||||||
|
|
||||||
|
db.Insertable(new List<MyTable02>() {
|
||||||
|
new MyTable02()
|
||||||
|
{
|
||||||
|
ts = DateTime.Now,
|
||||||
|
current = Convert.ToSingle(1.1),
|
||||||
|
groupId = 1,
|
||||||
|
isdelete = true,
|
||||||
|
name = "haha",
|
||||||
|
location = "aa",
|
||||||
|
phase = Convert.ToSingle(1.1),
|
||||||
|
voltage = 11
|
||||||
|
},
|
||||||
|
new MyTable02()
|
||||||
|
{
|
||||||
|
ts = DateTime.Now,
|
||||||
|
current = Convert.ToSingle(1.1),
|
||||||
|
groupId = 1,
|
||||||
|
isdelete = true,
|
||||||
|
name = "haha",
|
||||||
|
location = "aa",
|
||||||
|
phase = Convert.ToSingle(1.1),
|
||||||
|
voltage = 11
|
||||||
|
}
|
||||||
|
}).ExecuteCommand();
|
||||||
|
|
||||||
|
|
||||||
//查询子表(主表字段也能查出来)
|
//查询子表(主表字段也能查出来)
|
||||||
var list = db.Queryable<MyTable02>().ToList();
|
var list = db.Queryable<MyTable02>().ToList();
|
||||||
|
Loading…
Reference in New Issue
Block a user