mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-22 20:13:41 +08:00
Synchronization code
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
@@ -299,8 +300,8 @@ namespace SqlSugar
|
||||
{
|
||||
inValue1 = $"(NULL)";
|
||||
}
|
||||
if (inArray.Length == 1)
|
||||
{
|
||||
if (inArray.Length == 1&& inValue1 != "(null)")
|
||||
{
|
||||
builder.AppendFormat(temp, type, item.FieldName.ToSqlFilter(), "=", inValue1.TrimStart('(').TrimEnd(')'));
|
||||
}
|
||||
else
|
||||
@@ -331,13 +332,24 @@ namespace SqlSugar
|
||||
builder.AppendFormat(temp, type, "", " ", inValue1);
|
||||
}
|
||||
|
||||
private static string In_GetInValue(ConditionalModel item,string[] inArray)
|
||||
private string In_GetInValue(ConditionalModel item,string[] inArray)
|
||||
{
|
||||
string inValue1;
|
||||
if (item.CSharpTypeName.EqualCase("string") || item.CSharpTypeName == null)
|
||||
{
|
||||
inValue1 = ("(" + inArray.Distinct().ToArray().ToJoinSqlInVals() + ")");
|
||||
}
|
||||
if (item.CSharpTypeName.EqualCase("bool") || item.CSharpTypeName.EqualCase("Boolean"))
|
||||
{
|
||||
var lam=InstanceFactory.GetLambdaExpressions(this.Context.CurrentConnectionConfig);
|
||||
lam.Context = this.Context;
|
||||
var value= lam.DbMehtods.TrueValue();
|
||||
inValue1 = ("(" +string.Join(",", inArray.Distinct().ToArray() )+ ")");
|
||||
if (value.EqualCase( "true"))
|
||||
{
|
||||
inValue1=inValue1.Replace("1", "true").Replace("0", "false");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
inValue1 = ("(" + inArray.Select(it => it == "" ? "null" : it).Distinct().ToArray().ToJoinSqlInVals() + ")");
|
||||
|
Reference in New Issue
Block a user