mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Update query filter
This commit is contained in:
parent
9d1e7c6487
commit
77b3455b36
@ -460,7 +460,7 @@ namespace SqlSugar
|
||||
if (isSameName||ChildType.IsInterface)
|
||||
{
|
||||
var mysql = GetSql(exp, isSingle);
|
||||
if (ChildType.IsInterface)
|
||||
if (ChildType.IsInterface&&item.IsJoinQuery==true)
|
||||
{
|
||||
foreach (var joinInfoItem in this.JoinQueryInfos.Where(it => it.EntityType.GetInterfaces().Any(z=>z==ChildType)))
|
||||
{
|
||||
@ -469,6 +469,15 @@ namespace SqlSugar
|
||||
joinInfoItem.JoinWhere += (" AND " + Regex.Replace(addSql, "^ (WHERE|AND) ", ""));
|
||||
}
|
||||
}
|
||||
else if (ChildType.IsInterface && item.IsJoinQuery == false)
|
||||
{
|
||||
foreach (var joinInfoItem in this.JoinQueryInfos.Where(it => it.EntityType.GetInterfaces().Any(z => z == ChildType)))
|
||||
{
|
||||
var addSql = mysql.Replace(itName, this.Builder.GetTranslationColumnName(joinInfoItem.ShortName) + ".");
|
||||
addSql = ReplaceFilterColumnName(addSql, joinInfoItem.EntityType, joinInfoItem.ShortName);
|
||||
this.WhereInfos.Add (" AND " + Regex.Replace(addSql, "^ (WHERE|AND) ", ""));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var joinInfoItem in this.JoinQueryInfos.Where(it => it.TableName == entityInfo.DbTableName))
|
||||
|
Loading…
Reference in New Issue
Block a user