mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 20:38:16 +08:00
- 优化 RawJoin 支持 FULL JOIN 等自定义联表映射;
This commit is contained in:
@ -302,6 +302,11 @@ namespace FreeSql.Internal.CommonProvider
|
||||
{
|
||||
if (string.IsNullOrEmpty(sql)) return this as TSelect;
|
||||
_join.Append(" \r\n").Append(sql);
|
||||
|
||||
//fsql.Select<User1, UserGroup>().RawJoin("FULL JOIN UserGroup b ON b.id = a.GroupId").ToSql((a, b) => new { user = a, group = b });
|
||||
foreach (var tb in _tables)
|
||||
if (sql.Contains($" {tb.Table.DbName} ") || sql.Contains($" {_commonUtils.QuoteSqlName(tb.Table.DbName)} "))
|
||||
tb.Type = SelectTableInfoType.RawJoin;
|
||||
return this as TSelect;
|
||||
}
|
||||
|
||||
|
@ -24,5 +24,5 @@ namespace FreeSql.Internal.Model
|
||||
|
||||
public string Cascade { get; set; }
|
||||
}
|
||||
public enum SelectTableInfoType { From, LeftJoin, InnerJoin, RightJoin, Parent }
|
||||
public enum SelectTableInfoType { From, LeftJoin, InnerJoin, RightJoin, RawJoin, Parent }
|
||||
}
|
||||
|
Reference in New Issue
Block a user