/// <summary> /// 添加到OrderBy子句 /// </summary> /// <param name="builder">Sql生成器</param> /// <param name="sql">Sql语句</param> /// <param name="condition">该值为true时添加Sql,否则忽略</param> public static ISqlBuilder AppendOrderBy(this ISqlBuilder builder, string sql, bool condition) { if (condition) { builder.AppendOrderBy(sql); } return(builder); }