/// <summary> /// 获取列名列表 /// </summary> /// <param name="dialect">Sql方言</param> /// <param name="register">实体别名注册器</param> public string ToSql(IDialect dialect, IEntityAliasRegister register) { if (Raw || IsAggregation) { return(dialect.GetColumn(Name, dialect.GetSafeName(ColumnAlias))); } var result = new SqlItem(Name, GetTableAlias(register), ColumnAlias, isResolve: false); return(result.ToSql(dialect)); }
/// <summary> /// 初始化一个<see cref="OnItem"/>类型的实例 /// </summary> /// <param name="left">左表列名</param> /// <param name="right">右表列名</param> /// <param name="operator">条件运算符</param> public OnItem(SqlItem left, SqlItem right, Operator @operator) { Left = left; Right = right; Operator = @operator; }
/// <summary> /// 初始化一个<see cref="JoinItem"/>类型的实例 /// </summary> /// <param name="joinType">连接类型</param> /// <param name="table">表</param> /// <param name="conditions">连接条件列表</param> public JoinItem(string joinType, SqlItem table, List <List <OnItem> > conditions) { JoinType = joinType; Table = table; Conditions = conditions; }
/// <summary> /// 初始化一个<see cref="OnItem"/>类型的实例 /// </summary> /// <param name="left">左表列名</param> /// <param name="right">右表列名</param> /// <param name="operator">条件运算符</param> public OnItem(string left, string right, Operator @operator) { Left = new SqlItem(left); Right = new SqlItem(right); Operator = @operator; }