Esempio n. 1
0
 /// <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);
 }
Esempio n. 2
0
 /// <summary>
 /// SubQueryGreaterOrEqual   子查询
 /// </summary>
 /// <param name="from"></param>
 /// <returns></returns>
 public WhereClip SubQueryGreaterOrEqual(LambdaQueryHelper from)
 {
     return(subQuery(this, from, QueryOperator.GreaterOrEqual));
 }
Esempio n. 3
0
 /// <summary>
 /// SubQueryLess   子查询
 /// </summary>
 /// <param name="from"></param>
 /// <returns></returns>
 public WhereClip SubQueryLess(LambdaQueryHelper from)
 {
     return(subQuery(this, from, QueryOperator.Less));
 }
Esempio n. 4
0
 /// <summary>
 /// SubQueryNotEqual   子查询
 /// </summary>
 /// <param name="from"></param>
 /// <returns></returns>
 public WhereClip SubQueryNotEqual(LambdaQueryHelper from)
 {
     return(subQuery(this, from, QueryOperator.NotEqual));
 }
Esempio n. 5
0
 /// <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)));
 }
Esempio n. 6
0
 /// <summary>
 /// SubQueryNotIn   子查询
 /// </summary>
 /// <param name="from"></param>
 /// <returns></returns>
 public WhereClip SubQueryNotIn(LambdaQueryHelper from)
 {
     return(subQuery(this, from, selectNotInString));
 }
Esempio n. 7
0
 /// <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()));
 }