From 10cebe482320055d26800b6b89880113b33d4f17 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Thu, 21 Apr 2022 15:18:58 +0800 Subject: [PATCH] Update Core --- .../Abstract/EntityMaintenance/EntityMaintenance.cs | 4 ++-- .../SqlBuilderProvider/SqlBuilderProvider.cs | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/EntityMaintenance/EntityMaintenance.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/EntityMaintenance/EntityMaintenance.cs index 155cb3e77..bd8414099 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/EntityMaintenance/EntityMaintenance.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/EntityMaintenance/EntityMaintenance.cs @@ -33,7 +33,7 @@ namespace SqlSugar { var sugarTable = (SugarTable)sugarAttributeInfo; result.DbTableName = sugarTable.TableName; - result.TableDescription = sugarTable.TableDescription; + result.TableDescription = sugarTable.TableDescription.ToSqlFilter(); result.IsDisabledUpdateAll = sugarTable.IsDisabledUpdateAll; result.IsDisabledDelete = sugarTable.IsDisabledDelete; } @@ -257,7 +257,7 @@ namespace SqlSugar column.DbColumnName = sugarColumn.ColumnName.IsNullOrEmpty() ? property.Name : sugarColumn.ColumnName; column.IsPrimarykey = sugarColumn.IsPrimaryKey; column.IsIdentity = sugarColumn.IsIdentity; - column.ColumnDescription = sugarColumn.ColumnDescription; + column.ColumnDescription = sugarColumn.ColumnDescription.ToSqlFilter(); column.IsNullable = sugarColumn.IsNullable; column.Length = sugarColumn.Length; column.OldDbColumnName = sugarColumn.OldColumnName; diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/SqlBuilderProvider/SqlBuilderProvider.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/SqlBuilderProvider/SqlBuilderProvider.cs index e0504e160..4fef2b78a 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/SqlBuilderProvider/SqlBuilderProvider.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/SqlBuilderProvider/SqlBuilderProvider.cs @@ -188,7 +188,15 @@ namespace SqlSugar break; case ConditionalType.In: if (item.FieldValue == null) item.FieldValue = string.Empty; - var inValue1 = ("(" + item.FieldValue.Split(',').ToJoinSqlInVals() + ")"); + var inValue1 = string.Empty; + if (item.CSharpTypeName.EqualCase("string")|| item.CSharpTypeName==null) + { + inValue1 = ("(" + item.FieldValue.Split(',').Distinct().ToArray().ToJoinSqlInVals() + ")"); + } + else + { + inValue1 = ("(" + item.FieldValue.Split(',').Select(it=>it==""?"null":it).Distinct().ToArray().ToJoinSqlInVals() + ")"); + } if (item.CSharpTypeName.HasValue()&&UtilMethods.IsNumber(item.CSharpTypeName)) { inValue1= inValue1.Replace("'",""); @@ -210,7 +218,7 @@ namespace SqlSugar inValue1 = $"(NULL)"; } builder.AppendFormat(temp, type, item.FieldName.ToSqlFilter(), "IN", inValue1); - parameters.Add(new SugarParameter(parameterName, item.FieldValue)); + //parameters.Add(new SugarParameter(parameterName, item.FieldValue)); break; case ConditionalType.NotIn: if (item.FieldValue == null) item.FieldValue = string.Empty;