/// <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()); }
/// <summary> /// AND /// </summary> /// <param name="expressions"></param> /// <returns></returns> public static WhereExpressionMySQL And(params WhereExpressionMySQL[] expressions) { WhereExpressionMySQL where = new WhereExpressionMySQL(); return where.And(expressions); }
/// <summary> /// NOT NULL /// </summary> /// <param name="fieldName"></param> /// <returns></returns> public static WhereExpressionMySQL NotNull(string fieldName) { WhereExpressionMySQL where = new WhereExpressionMySQL(); return where.NotNull(fieldName); }
/// <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); }
/// <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); }
/// <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); }
/// <summary> /// 空条件 /// </summary> /// <returns></returns> public static WhereExpressionMySQL Empty() { WhereExpressionMySQL where = new WhereExpressionMySQL(); return where.Empty(); }
/// <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); }
/// <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); }