diff --git a/Src/Asp.NetCore2/SqlSugar.OdbcCore/GBase/SqlBuilder/GBaseBuilder.cs b/Src/Asp.NetCore2/SqlSugar.OdbcCore/GBase/SqlBuilder/GBaseBuilder.cs index 27ea1036f..f57bd034c 100644 --- a/Src/Asp.NetCore2/SqlSugar.OdbcCore/GBase/SqlBuilder/GBaseBuilder.cs +++ b/Src/Asp.NetCore2/SqlSugar.OdbcCore/GBase/SqlBuilder/GBaseBuilder.cs @@ -13,7 +13,24 @@ namespace SqlSugar.Odbc public override string SqlTranslationRight { get { return OdbcConfig.SqlTranslationRight; } } public override string GetNoTranslationColumnName(string name) { - return name; + if (name.Contains("=")) + { + name = name.Split('=').First(); + } + name = name.Trim(' '); + + if (string.IsNullOrEmpty(SqlTranslationLeft) || + !name.Contains(SqlTranslationLeft)) + { + return name; + } + + if (!name.Contains(".") && name.StartsWith(SqlTranslationLeft) && name.EndsWith(SqlTranslationRight)) + { + return name.TrimStart(Convert.ToChar(SqlTranslationLeft)).TrimEnd(Convert.ToChar(SqlTranslationRight)); + } + + return name == null ? string.Empty : Regex.Match(name, @".*" + "\\" + SqlTranslationLeft + "(.*?)" + "\\" + SqlTranslationRight + "").Groups[1].Value; } public override string SqlDateNow {