/// <summary> /// 组合 子查询 TODO /// </summary> /// <param name="field"></param> /// <param name="from"></param> /// <param name="join"></param> /// <returns></returns> private WhereClip subQuery(Field field, LambdaQueryHelper from, string join) { if (Field.IsNullOrEmpty(field)) { return(null); } //if (from.DbProvider.dbType == dbType.MySql) //{ // return new WhereClip(string.Concat(field.TableFieldName, join, "(SELECT * FROM (", from.getPagedFromSection().SqlString, ") AS TEMP" + DataUtils.GetNewParamCount() + ")"), from.Parameters.ToArray()); //} //return new WhereClip(string.Concat(field.TableFieldName, join, "(", from.getPagedFromSection().SqlString, ")"), from.Parameters.ToArray()); return(null); }
/// <summary> /// EXISTS /// </summary> /// <param name="lambdaHelper"></param> /// <returns></returns> public static WhereClip Exists(LambdaQueryHelper lambdaHelper) { return(new WhereClip(string.Concat(" EXISTS (", lambdaHelper.GetSqlString(), ") "), lambdaHelper.Parameters.Values.ToArray())); }
/// <summary> /// SubQueryGreaterOrEqual 子查询 /// </summary> /// <param name="from"></param> /// <returns></returns> public WhereClip SubQueryGreaterOrEqual(LambdaQueryHelper from) { return(subQuery(this, from, QueryOperator.GreaterOrEqual)); }
/// <summary> /// SubQueryLess 子查询 /// </summary> /// <param name="from"></param> /// <returns></returns> public WhereClip SubQueryLess(LambdaQueryHelper from) { return(subQuery(this, from, QueryOperator.Less)); }
/// <summary> /// SubQueryNotEqual 子查询 /// </summary> /// <param name="from"></param> /// <returns></returns> public WhereClip SubQueryNotEqual(LambdaQueryHelper from) { return(subQuery(this, from, QueryOperator.NotEqual)); }
/// <summary> /// 组合 子查询 /// </summary> /// <param name="field"></param> /// <param name="from"></param> /// <param name="oper"></param> /// <returns></returns> private WhereClip subQuery(Field field, LambdaQueryHelper from, QueryOperator oper) { return(subQuery(field, from, DataUtils.ToString(oper))); }
/// <summary> /// SubQueryNotIn 子查询 /// </summary> /// <param name="from"></param> /// <returns></returns> public WhereClip SubQueryNotIn(LambdaQueryHelper from) { return(subQuery(this, from, selectNotInString)); }