Browse Source

Update Core

pull/18/head
sunkaixuan 3 years ago
parent
commit
10cebe4823
  1. 4
      Src/Asp.NetCore2/SqlSugar/Abstract/EntityMaintenance/EntityMaintenance.cs
  2. 12
      Src/Asp.NetCore2/SqlSugar/Abstract/SqlBuilderProvider/SqlBuilderProvider.cs

4
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;

12
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;

Loading…
Cancel
Save