Example #1
0
 /// <summary>
 /// 或 OR
 /// </summary>
 /// <param name="where"></param>
 /// <param name="left"></param>
 /// <param name="right"></param>
 /// <returns></returns>
 public static WhereExpressionMySQL Or(this WhereExpressionMySQL where, WhereExpressionMySQL left, WhereExpressionMySQL right)
 {
     if (where == null)
     {
         return Or(left, right);
     }
     List<IDbDataParameter> list = new List<IDbDataParameter>();
     list.AddRange(left.GetParameters());
     list.AddRange(right.GetParameters());
     return where.AddExpression(string.Format("({0}) OR ({1})", left.GetExpression(), right.GetExpression()), list.ToArray());
 }
Example #2
0
 /// <summary>
 /// AND
 /// </summary>
 /// <param name="expressions"></param>
 /// <returns></returns>
 public static WhereExpressionMySQL And(params WhereExpressionMySQL[] expressions)
 {
     WhereExpressionMySQL where = new WhereExpressionMySQL();
     return where.And(expressions);
 }
Example #3
0
 /// <summary>
 /// NOT NULL
 /// </summary>
 /// <param name="fieldName"></param>
 /// <returns></returns>
 public static WhereExpressionMySQL NotNull(string fieldName)
 {
     WhereExpressionMySQL where = new WhereExpressionMySQL();
     return where.NotNull(fieldName);
 }
Example #4
0
 /// <summary>
 /// 或 OR
 /// </summary>
 /// <param name="left"></param>
 /// <param name="right"></param>
 /// <returns></returns>
 public static WhereExpressionMySQL Or(WhereExpressionMySQL left, WhereExpressionMySQL right)
 {
     WhereExpressionMySQL where = new WhereExpressionMySQL();
     return where.Or(left, right);
 }
Example #5
0
 /// <summary>
 /// NOT IN
 /// </summary>
 /// <param name="fieldName"></param>
 /// <param name="type"></param>
 /// <param name="values"></param>
 /// <returns></returns>
 public static WhereExpressionMySQL NotIn(string fieldName, DbType type, params object[] values)
 {
     WhereExpressionMySQL where = new WhereExpressionMySQL();
     return where.NotIn(fieldName, type, values);
 }
Example #6
0
 /// <summary>
 /// 不等于
 /// </summary>
 /// <param name="fieldName"></param>
 /// <param name="type"></param>
 /// <param name="value"></param>
 /// <returns></returns>
 public static WhereExpressionMySQL NotEqual(string fieldName, DbType type, object value)
 {
     WhereExpressionMySQL where = new WhereExpressionMySQL();
     return where.NotEqual(fieldName, type, value);
 }
Example #7
0
 /// <summary>
 /// 空条件
 /// </summary>
 /// <returns></returns>
 public static WhereExpressionMySQL Empty()
 {
     WhereExpressionMySQL where = new WhereExpressionMySQL();
     return where.Empty();
 }
Example #8
0
 /// <summary>
 /// LIKE % 左匹配
 /// </summary>
 /// <param name="fieldName"></param>
 /// <param name="value"></param>
 /// <returns></returns>
 public static WhereExpressionMySQL LikeLeft(string fieldName, string value)
 {
     WhereExpressionMySQL where = new WhereExpressionMySQL();
     return where.LikeLeft(fieldName, value);
 }
Example #9
0
 /// <summary>
 /// BETWEEN AND
 /// </summary>
 /// <param name="fieldName"></param>
 /// <param name="type"></param>
 /// <param name="leftValue"></param>
 /// <param name="rightValue"></param>
 /// <returns></returns>
 public static WhereExpressionMySQL Between(string fieldName, DbType type, object leftValue, object rightValue)
 {
     WhereExpressionMySQL where = new WhereExpressionMySQL();
     return where.Between(fieldName, type, leftValue, rightValue);
 }