From f2f254d0cc7b6a3456e0182aa7dae99b1da00a92 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 10 Dec 2024 12:34:02 +0800 Subject: [PATCH] =?UTF-8?q?Update=20=E8=BE=BE=E6=A2=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SqlSugar.XuguCore/SqlSugar.OdbcCore.nuspec | 2 +- Src/Asp.NetCore2/SqlSugar/Realization/Dm/DmProvider.cs | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Src/Asp.NetCore2/SqlSugar.XuguCore/SqlSugar.OdbcCore.nuspec b/Src/Asp.NetCore2/SqlSugar.XuguCore/SqlSugar.OdbcCore.nuspec index b7eb4282c..1da7f3ee2 100644 --- a/Src/Asp.NetCore2/SqlSugar.XuguCore/SqlSugar.OdbcCore.nuspec +++ b/Src/Asp.NetCore2/SqlSugar.XuguCore/SqlSugar.OdbcCore.nuspec @@ -2,7 +2,7 @@ SqlSugar.XuguCoreNew - 5.1.4.173 + 5.1.4.174 sunkaixuan 果糖大数据 http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/Src/Asp.NetCore2/SqlSugar/Realization/Dm/DmProvider.cs b/Src/Asp.NetCore2/SqlSugar/Realization/Dm/DmProvider.cs index 43ede2089..70558fd04 100644 --- a/Src/Asp.NetCore2/SqlSugar/Realization/Dm/DmProvider.cs +++ b/Src/Asp.NetCore2/SqlSugar/Realization/Dm/DmProvider.cs @@ -183,10 +183,20 @@ namespace SqlSugar { sqlParameter.DmSqlType = DmDbType.Cursor; } + if (IsSpOutPutParameter(sqlParameter)) + { + sqlParameter.ParameterName = sqlParameter.ParameterName.Replace("@", ":"); + } ++index; } return result; } + + private bool IsSpOutPutParameter(DmParameter sqlParameter) + { + return sqlParameter.Direction == ParameterDirection.Output && this.CommandType == CommandType.StoredProcedure; + } + private static string[] KeyWord =new string []{ "@month", ":month", ":day","@day","@group", ":group",":index", "@index", "@order", ":order", "@user", "@level", ":user", ":level",":type","@type", ":year", "@year" }; private static string ReplaceKeyWordParameterName(string sql, SugarParameter[] parameters) {