From 81e53108fddd9dc43327adfdb51d6fc84d759a3c Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Wed, 4 Dec 2024 15:05:46 +0800 Subject: [PATCH] Synchronized code --- .../SqlSugar/Realization/Kdbndp/DbBind/KdbndpBind.cs | 6 ++++++ .../Realization/Kdbndp/DbMaintenance/KdbndpDbMaintenance.cs | 2 +- .../Kdbndp/SqlBuilder/KdbndpExpressionContext.cs | 5 +++++ Src/Asp.NetCore2/SqlSugar/SqlSugarForCore.nuspec | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Src/Asp.Net/SqlSugar/Realization/Kdbndp/DbBind/KdbndpBind.cs b/Src/Asp.Net/SqlSugar/Realization/Kdbndp/DbBind/KdbndpBind.cs index f0b7e607d..8c046bb84 100644 --- a/Src/Asp.Net/SqlSugar/Realization/Kdbndp/DbBind/KdbndpBind.cs +++ b/Src/Asp.Net/SqlSugar/Realization/Kdbndp/DbBind/KdbndpBind.cs @@ -111,7 +111,10 @@ namespace SqlSugar new KeyValuePair("varcharbyte varying",CSharpDataType.@string), new KeyValuePair("bpcharbyte",CSharpDataType.@string), new KeyValuePair("nvarchar",CSharpDataType.@string), + new KeyValuePair("characterbyte",CSharpDataType.@string), + new KeyValuePair("information_schema.character_data",CSharpDataType.@string), new KeyValuePair("uuid",CSharpDataType.Guid), + new KeyValuePair("uniqueidentifier",CSharpDataType.Guid), new KeyValuePair("xml",CSharpDataType.@string), new KeyValuePair("json",CSharpDataType.@string), new KeyValuePair("rowid",CSharpDataType.@string), @@ -122,6 +125,8 @@ namespace SqlSugar new KeyValuePair("macaddr",CSharpDataType.@decimal), new KeyValuePair("money",CSharpDataType.@decimal), new KeyValuePair("timestamp",CSharpDataType.DateTime), + new KeyValuePair("datetime2",CSharpDataType.DateTime), + new KeyValuePair("datetime",CSharpDataType.DateTime), new KeyValuePair("timestamp with time zone",CSharpDataType.DateTime), new KeyValuePair("timestamptz",CSharpDataType.DateTime), new KeyValuePair("timestamp without time zone",CSharpDataType.DateTime), @@ -135,6 +140,7 @@ namespace SqlSugar new KeyValuePair("blob",CSharpDataType.byteArray), new KeyValuePair("bit varying",CSharpDataType.byteArray), new KeyValuePair("varbit",CSharpDataType.@byte), + new KeyValuePair("rowversion",CSharpDataType.byteArray), new KeyValuePair("regclass",CSharpDataType.@object) }; diff --git a/Src/Asp.Net/SqlSugar/Realization/Kdbndp/DbMaintenance/KdbndpDbMaintenance.cs b/Src/Asp.Net/SqlSugar/Realization/Kdbndp/DbMaintenance/KdbndpDbMaintenance.cs index 4a35174b5..ac48bb56f 100644 --- a/Src/Asp.Net/SqlSugar/Realization/Kdbndp/DbMaintenance/KdbndpDbMaintenance.cs +++ b/Src/Asp.Net/SqlSugar/Realization/Kdbndp/DbMaintenance/KdbndpDbMaintenance.cs @@ -411,7 +411,7 @@ WHERE tgrelid = '" + tableName + "'::regclass"); var sql = $"select count(*) from information_schema.tables where UPPER(table_schema)=UPPER('{GetSchema()}') and UPPER(table_type)=UPPER('BASE TABLE') and UPPER(table_name)=UPPER('{tableName.ToUpper(IsUpper)}')"; if (IsSqlServerModel()) { - sql = $"select count(*) from information_schema.tables where pg_catalog.UPPER(table_name)=pg_catalog.UPPER('{tableName.ToUpper(IsUpper)}')"; + sql = $"select count(*) from information_schema.tables where UPPER(table_schema)=UPPER('{GetSchema()}') and pg_catalog.UPPER(table_name)=pg_catalog.UPPER('{tableName.ToUpper(IsUpper)}')"; } return this.Context.Ado.GetInt(sql)>0; } diff --git a/Src/Asp.Net/SqlSugar/Realization/Kdbndp/SqlBuilder/KdbndpExpressionContext.cs b/Src/Asp.Net/SqlSugar/Realization/Kdbndp/SqlBuilder/KdbndpExpressionContext.cs index dc851d5ec..bda42b503 100644 --- a/Src/Asp.Net/SqlSugar/Realization/Kdbndp/SqlBuilder/KdbndpExpressionContext.cs +++ b/Src/Asp.Net/SqlSugar/Realization/Kdbndp/SqlBuilder/KdbndpExpressionContext.cs @@ -130,6 +130,11 @@ namespace SqlSugar } public override string DateDiff(MethodCallExpressionModel model) { + if (IsSqlServerModel(model)) + { + return base.DateDiff(model); + } + var parameter = (DateType)(Enum.Parse(typeof(DateType), model.Args[0].MemberValue.ObjToString())); var begin = model.Args[1].MemberName; var end = model.Args[2].MemberName; diff --git a/Src/Asp.NetCore2/SqlSugar/SqlSugarForCore.nuspec b/Src/Asp.NetCore2/SqlSugar/SqlSugarForCore.nuspec index c5e1484cc..77b529d7a 100644 --- a/Src/Asp.NetCore2/SqlSugar/SqlSugarForCore.nuspec +++ b/Src/Asp.NetCore2/SqlSugar/SqlSugarForCore.nuspec @@ -2,7 +2,7 @@ SqlSugarCore - 5.1.4.171-preview28 + 5.1.4.171-preview29 sunkaixuan 果糖大数据科技 http://www.apache.org/licenses/LICENSE-2.0.html