- 修复 JsonMap 进行 null 或非 null 查询;#1613

This commit is contained in:
2881099
2023-09-11 12:08:19 +08:00
parent f117b1452e
commit 265c2d3324
4 changed files with 25 additions and 112 deletions

View File

@ -842,10 +842,16 @@ namespace FreeSql.Internal
(int)(rightExp as ConstantExpression).Value == 0)
return ExpressionBinary(oper, leftExpCall.Arguments[0], leftExpCall.Arguments[1], tsc);
}
var exptb = _common.GetTableByEntity(leftExp.Type);
if (exptb?.Properties.Any() == true) leftExp = Expression.MakeMemberAccess(leftExp, exptb.Properties[(exptb.Primarys.FirstOrDefault() ?? exptb.Columns.FirstOrDefault().Value)?.CsName]);
exptb = _common.GetTableByEntity(leftExp.Type);
if (exptb?.Properties.Any() == true) rightExp = Expression.MakeMemberAccess(rightExp, exptb.Properties[(exptb.Primarys.FirstOrDefault() ?? exptb.Columns.FirstOrDefault().Value).CsName]);
if (Utils.dicExecuteArrayRowReadClassOrTuple.ContainsKey(leftExp.Type) == false && Utils.TypeHandlers.ContainsKey(leftExp.Type) == false)
{
var exptb = _common.GetTableByEntity(leftExp.Type);
if (exptb?.Properties.Any() == true) leftExp = Expression.MakeMemberAccess(leftExp, exptb.Properties[(exptb.Primarys.FirstOrDefault() ?? exptb.Columns.FirstOrDefault().Value)?.CsName]);
}
if (Utils.dicExecuteArrayRowReadClassOrTuple.ContainsKey(rightExp.Type) == false && Utils.TypeHandlers.ContainsKey(rightExp.Type) == false)
{
var exptb = _common.GetTableByEntity(rightExp.Type);
if (exptb?.Properties.Any() == true) rightExp = Expression.MakeMemberAccess(rightExp, exptb.Properties[(exptb.Primarys.FirstOrDefault() ?? exptb.Columns.FirstOrDefault().Value).CsName]);
}
break;
}