Ejemplo n.º 1
0
 public OpExpression(OpExpression left,OpExpression right,JoinOP joinOp)
 {
     this.Left = left;
     this.Right = right;
     this.joinOp = joinOp;
     this.Condition = null;
 }
Ejemplo n.º 2
0
 public OpExpression(OpExpression left, OpExpression right, JoinOP joinOp)
 {
     this.Left      = left;
     this.Right     = right;
     this.joinOp    = joinOp;
     this.Condition = null;
 }
Ejemplo n.º 3
0
        private string MakeWhereStr(OpExpression opExpression)
        {
            if (opExpression == null)
            {
                return "";
            }
            StringBuilder sb=new StringBuilder();

            switch ((int)opExpression.joinOp)
            {
                //叶子
                case 0:
                    sb.Append(opExpression.Condition.key)
              .Append(GetOpStr((int)opExpression.Condition.op))
              .Append(ToSqlString(opExpression.Condition.value));
                    break;
                case 1:
                    sb.Append(" ( ").Append(MakeWhereStr(opExpression.Left)).Append(" And ").Append(MakeWhereStr(opExpression.Right)).Append(" ) ");
                    break;
                case 2:
                    sb.Append(" ( ").Append(MakeWhereStr(opExpression.Left)).Append(" Or ").Append(MakeWhereStr(opExpression.Right)).Append(" ) ");
                    break;

            }
            return sb.ToString();
        }