mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-23 12:33:44 +08:00
Synchronization code
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -299,7 +300,7 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
inValue1 = $"(NULL)";
|
inValue1 = $"(NULL)";
|
||||||
}
|
}
|
||||||
if (inArray.Length == 1)
|
if (inArray.Length == 1&& inValue1 != "(null)")
|
||||||
{
|
{
|
||||||
builder.AppendFormat(temp, type, item.FieldName.ToSqlFilter(), "=", inValue1.TrimStart('(').TrimEnd(')'));
|
builder.AppendFormat(temp, type, item.FieldName.ToSqlFilter(), "=", inValue1.TrimStart('(').TrimEnd(')'));
|
||||||
}
|
}
|
||||||
@@ -331,13 +332,24 @@ namespace SqlSugar
|
|||||||
builder.AppendFormat(temp, type, "", " ", inValue1);
|
builder.AppendFormat(temp, type, "", " ", inValue1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string In_GetInValue(ConditionalModel item,string[] inArray)
|
private string In_GetInValue(ConditionalModel item,string[] inArray)
|
||||||
{
|
{
|
||||||
string inValue1;
|
string inValue1;
|
||||||
if (item.CSharpTypeName.EqualCase("string") || item.CSharpTypeName == null)
|
if (item.CSharpTypeName.EqualCase("string") || item.CSharpTypeName == null)
|
||||||
{
|
{
|
||||||
inValue1 = ("(" + inArray.Distinct().ToArray().ToJoinSqlInVals() + ")");
|
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
|
else
|
||||||
{
|
{
|
||||||
inValue1 = ("(" + inArray.Select(it => it == "" ? "null" : it).Distinct().ToArray().ToJoinSqlInVals() + ")");
|
inValue1 = ("(" + inArray.Select(it => it == "" ? "null" : it).Distinct().ToArray().ToJoinSqlInVals() + ")");
|
||||||
|
Reference in New Issue
Block a user