private static string GetJoinSql(DataTable chainRoot, SqlDefinition exp) { StringBuilder sql = new StringBuilder(); using (var temp = TempIndex.Borrow()) { var index = temp.Item; FillJoinSql(chainRoot, chainRoot, exp, sql, index); } return(sql.ToString()); }
/// <summary> /// 获取表<paramref name="chainRoot"/>需要查询的select字段 /// </summary> /// <param name="chainRoot"></param> /// <param name="exp"></param> /// <param name="chain">可以为输出的字段前置对象链</param> /// <returns></returns> private static string GetSelectFieldsSql(DataTable chainRoot, SqlDefinition exp) { StringBuilder sql = new StringBuilder(); sql.Append(GetChainRootSelectFieldsSql(chainRoot, exp).Trim()); using (var temp = TempIndex.Borrow()) { var index = temp.Item; sql.Append(GetSlaveSelectFieldsSql(chainRoot, chainRoot, exp, index).Trim()); } sql.Length--;//移除最后一个逗号 return(sql.ToString()); }