示例#1
0
 private QWhereCondition AddCondition(QCondition condition, WhereType type)
 {
     if (whereType == WhereType.None)
     {
         if (condition is QWhereCondition)
         {
             return((QWhereCondition)condition);
         }
         whereType     = WhereType.Single;
         leftCondition = condition;
         return(this);
     }
     if (whereType == WhereType.Single)
     {
         whereType      = type;
         rightCondition = condition;
         if (rightCondition is QWhereCondition)
         {
             rightHasOr = ((QWhereCondition)rightCondition).whereType == WhereType.Or;
         }
         return(this);
     }
     var where            = new QWhereCondition();
     where.whereType      = type;
     where.leftCondition  = this;
     where.rightCondition = condition;
     where.leftHasOr      = this.whereType == WhereType.Or;
     if (rightCondition is QWhereCondition)
     {
         where.rightHasOr = ((QWhereCondition)rightCondition).whereType == WhereType.Or;
     }
     return(where);
 }
示例#2
0
 public void Where(QCondition @where)
 {
     if (_jump)
     {
         _jump = false; return;
     }
     whereCondition = whereCondition.And(@where);
 }
示例#3
0
        public void Having(QCondition having)
        {
            if (_jump)
            {
                _jump = false; return;
            }

            _having.Add(having);
        }
示例#4
0
 internal QWhereCondition And(QCondition condition)
 {
     return(AddCondition(condition, WhereType.And));
 }
示例#5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="c1"></param>
 /// <param name="whereType"></param>
 /// <param name="c2"></param>
 internal QWhereCondition(QCondition c1, WhereType whereType, QCondition c2)
 {
     leftCondition  = c1;
     this.whereType = whereType;
     rightCondition = c2;
 }
示例#6
0
 internal QWhereCondition Or(QCondition condition)
 {
     return(AddCondition(condition, WhereType.Or));
 }
示例#7
0
 public QWhereCondition Or(QCondition condition)
 {
     return(AddCondition(condition, WhereType.Or));
 }
示例#8
0
 public QWhereCondition And(QCondition condition)
 {
     return(AddCondition(condition, WhereType.And));
 }