This commit is contained in:
sunkaixuan
2017-11-18 01:44:17 +08:00
parent eb182b15bc
commit 91815b6b8e
3 changed files with 11 additions and 3 deletions

View File

@@ -124,6 +124,14 @@ namespace OrmTest.UnitTest
new SugarParameter("@Id0",1),
new SugarParameter("@Const1",1)
}, t13.Key, t13.Value, "single t13 error ");
var t14 = db.Queryable<Student>()
.Where(it => it.Name == "a" && SqlFunc.HasValue(it.Name)).ToSql();
base.Check("SELECT [ID],[SchoolId],[Name],[CreateTime] FROM [STudent] WHERE (( [Name] = @Name0 ) AND ( [Name]<>'' AND [Name] IS NOT NULL ))",
new List<SugarParameter>() {
new SugarParameter("@Name0","a")
}, t14.Key, t14.Value, "single t14 error ");
}
}
}

View File

@@ -209,7 +209,7 @@ namespace SqlSugar
model.Args.AddRange(appendArgs);
}
var methodValue = GetMdthodValue(name, model);
if (parameter.BaseExpression is BinaryExpression && parameter.OppsiteExpression.Type == UtilConstants.BoolType&&name=="HasValue") {
if (parameter.BaseExpression is BinaryExpression && parameter.OppsiteExpression.Type == UtilConstants.BoolType&&name=="HasValue"&&!(parameter.OppsiteExpression is BinaryExpression)) {
methodValue = this.Context.DbMehtods.CaseWhen(new List<KeyValuePair<string, string>>() {
new KeyValuePair<string, string>("IF",methodValue.ObjToString()),
new KeyValuePair<string, string>("Return","1"),

View File

@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.6.0.5")]
[assembly: AssemblyFileVersion("4.6.0.5")]
[assembly: AssemblyVersion("4.6.0.6")]
[assembly: AssemblyFileVersion("4.6.0.6")]