Class WhereBodySet

All Implemented Interfaces:
Query, Logic

public final class WhereBodySet extends QueryLike<WhereBodySet> implements Logic
where 查询条件封装类
Version:
0.0.1
Author:
scx567888
  • Constructor Details

    • WhereBodySet

      public WhereBodySet(LogicType type)
      创建一个 Where 对象
  • Method Details

    • add2

      public WhereBodySet add2(String name, WhereType whereType, Object value1, Object value2, WhereOption... options)
      添加一个查询条件
      Parameters:
      name - 名称 (注意 : 默认为字段名称 , 不是数据库名称)
      whereType - where 类型
      value1 - 参数1
      value2 - 参数2
      options - 配置
      Returns:
      本身 , 方便链式调用
    • add1

      public WhereBodySet add1(String name, WhereType whereType, Object value1, WhereOption... options)
      添加一个查询条件
      Parameters:
      name - 名称 (注意 : 默认为字段名称 , 不是数据库名称)
      whereType - where 类型
      value1 - 参数1
      options - 配置
      Returns:
      本身 , 方便链式调用
    • add0

      public WhereBodySet add0(String name, WhereType whereType, WhereOption... options)
      添加一个查询条件
      Parameters:
      name - 名称 (注意 : 默认为字段名称 , 不是数据库名称)
      whereType - where 类型
      options - 配置
      Returns:
      本身 , 方便链式调用
    • isEmpty

      public boolean isEmpty()
      查询条件是否为空
      Returns:
      a boolean
    • isNull

      public WhereBodySet isNull(String fieldName, WhereOption... options)
      为空
      Parameters:
      fieldName - 名称 (注意 : 默认为字段名称 , 不是数据库名称)
      options - 配置
      Returns:
      this 方便链式调用
    • isNotNull

      public WhereBodySet isNotNull(String fieldName, WhereOption... options)
      不为空
      Parameters:
      fieldName - 名称 (注意 : 默认为字段名称 , 不是数据库名称)
      options - 配置
      Returns:
      this 方便链式调用
    • eq

      public WhereBodySet eq(String fieldName, Object value, WhereOption... options)
      相等
      Parameters:
      fieldName - 名称 (注意 : 默认为字段名称 , 不是数据库名称)
      value - 比较值
      options - 配置
      Returns:
      this 方便链式调用
    • ne

      public WhereBodySet ne(String fieldName, Object value, WhereOption... options)
      不相等
      Parameters:
      fieldName - 名称 (注意 : 默认为字段名称 , 不是数据库名称)
      value - 比较值
      options - 配置
      Returns:
      this 方便链式调用
    • gt

      public WhereBodySet gt(String fieldName, Object value, WhereOption... options)
      大于
      Parameters:
      fieldName - 名称 (注意 : 默认为字段名称 , 不是数据库名称)
      value - 比较值
      options - 配置
      Returns:
      this 方便链式调用
    • ge

      public WhereBodySet ge(String fieldName, Object value, WhereOption... options)
      大于等于
      Parameters:
      fieldName - 名称 (注意 : 默认为字段名称 , 不是数据库名称)
      value - 比较值
      options - 配置
      Returns:
      this 方便链式调用
    • lt

      public WhereBodySet lt(String fieldName, Object value, WhereOption... options)
      小于
      Parameters:
      fieldName - 名称 (注意 : 默认为字段名称 , 不是数据库名称)
      value - 比较值
      options - 配置
      Returns:
      this 方便链式调用
    • le

      public WhereBodySet le(String fieldName, Object value, WhereOption... options)
      小于等于
      Parameters:
      fieldName - 名称 (注意 : 默认为字段名称 , 不是数据库名称)
      value - 比较值
      options - 配置
      Returns:
      this 方便链式调用
    • between

      public WhereBodySet between(String fieldName, Object value1, Object value2, WhereOption... options)
      两者之间
      Parameters:
      fieldName - 名称 (注意 : 默认为字段名称 , 不是数据库名称)
      value1 - 比较值1
      value2 - 比较值2
      options - 配置
      Returns:
      this 方便链式调用
    • notBetween

      public WhereBodySet notBetween(String fieldName, Object value1, Object value2, WhereOption... options)
      不处于两者之间
      Parameters:
      fieldName - 名称 (注意 : 默认为字段名称 , 不是数据库名称)
      value1 - 比较值1
      value2 - 比较值2
      options - 配置
      Returns:
      this 方便链式调用
    • likeRegex

      public WhereBodySet likeRegex(String fieldName, String value, WhereOption... options)
      like : 根据 SQL 表达式进行判断
      Parameters:
      fieldName - 名称 (注意 : 默认为字段名称 , 不是数据库名称)
      value - SQL 表达式
      options - 配置
      Returns:
      this 方便链式调用
    • notLikeRegex

      public WhereBodySet notLikeRegex(String fieldName, String value, WhereOption... options)
      not like : 根据 SQL 表达式进行判断
      Parameters:
      fieldName - 名称 (注意 : 默认为字段名称 , 不是数据库名称)
      value - SQL 表达式
      options - 配置
      Returns:
      this 方便链式调用
    • like

      public WhereBodySet like(String fieldName, Object value, WhereOption... options)
      like : 默认会在首尾添加 %
      Parameters:
      fieldName - 名称 (注意 : 默认为字段名称 , 不是数据库名称)
      value - 参数 默认会在首尾添加 %
      options - 配置
      Returns:
      this 方便链式调用
    • notLike

      public WhereBodySet notLike(String fieldName, Object value, WhereOption... options)
      not like : 默认会在首尾添加 %
      Parameters:
      fieldName - 名称 (注意 : 默认为字段名称 , 不是数据库名称)
      value - 默认会在首尾添加 %
      options - 配置
      Returns:
      this 方便链式调用
    • jsonContains

      public WhereBodySet jsonContains(String fieldName, Object value, WhereOption... options)
      包含 : 一般用于 JSON 格式字段 区别于 in
      Parameters:
      fieldName - 名称 (注意 : 默认为字段名称 , 不是数据库名称)
      value - 比较值
      options - 配置
      Returns:
      this 方便链式调用
    • in

      public WhereBodySet in(String fieldName, Object value, WhereOption... options)
      在其中
      Parameters:
      fieldName - 名称 (注意 : 默认为字段名称 , 不是数据库名称)
      value - 比较值
      options - 配置
      Returns:
      this 方便链式调用
    • notIn

      public WhereBodySet notIn(String fieldName, Object value, WhereOption... options)
      不在其中
      Parameters:
      fieldName - 名称 (注意 : 默认为字段名称 , 不是数据库名称)
      value - 比较值
      options - 配置
      Returns:
      this 方便链式调用
    • remove

      public WhereBodySet remove(String name)
      a
      Parameters:
      name - a
      Returns:
      a
    • clear

      public WhereBodySet clear()
      清除所有 where 条件 (不包括 whereSQL)
      Returns:
      this 方便链式调用
    • type

      public LogicType type()
      Specified by:
      type in interface Logic
    • clauses

      public Object[] clauses()
      Specified by:
      clauses in interface Logic
    • toQuery

      public Query toQuery()
      Specified by:
      toQuery in class QueryLike<WhereBodySet>