Class SqlsCriteria<T>

java.lang.Object
org.miaixz.bus.mapper.criteria.SqlsCriteria<T>
Type Parameters:
T - 泛型
All Implemented Interfaces:
SqlCriteria

public class SqlsCriteria<T> extends Object implements SqlCriteria
sql 条件语句
Since:
Java 17+
Author:
Kimi Liu
  • Method Details

    • custom

      public static <T> SqlsCriteria<T> custom(Class<T> clazz)
    • andIsNull

      public SqlsCriteria<T> andIsNull(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn)
      AND column IS NULL
      Parameters:
      fn - 函数
      Returns:
      the object
    • andIsNotNull

      public SqlsCriteria<T> andIsNotNull(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn)
      AND column IS NOT NULL
      Parameters:
      fn - 函数
      Returns:
      the object
    • andEqualTo

      public SqlsCriteria<T> andEqualTo(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, Object value)
      AND column = value 当value=null则不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • andEqualTo

      public SqlsCriteria<T> andEqualTo(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, Object value, boolean required)
      AND column = value
      Parameters:
      fn - 函数
      value - 值
      required - false 当value=null 则不参与查询 ; true 当value = null 则转 is null 查询: AND column is null
      Returns:
      the object
    • andNotEqualTo

      public SqlsCriteria<T> andNotEqualTo(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, Object value)
      AND column != value 默认 value=null 则不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • andNotEqualTo

      public SqlsCriteria<T> andNotEqualTo(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, Object value, boolean required)
      AND column != value
      Parameters:
      fn - 函数
      value - 值
      required - false 当value=null 则不参与查询 ; true 当value = null 则转 is not null 查询 : AND column is not null
      Returns:
    • andGreaterThan

      public SqlsCriteria<T> andGreaterThan(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, Object value)
      AND column 大于 value 当 value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • andGreaterThanOrEqualTo

      public SqlsCriteria<T> andGreaterThanOrEqualTo(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, Object value)
      AND column 大于等于 value 当 value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • andLessThan

      public SqlsCriteria<T> andLessThan(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, Object value)
      AND column 小于 value 当 value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • andLessThanOrEqualTo

      public SqlsCriteria<T> andLessThanOrEqualTo(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, Object value)
      AND column 小于等于 value 当 value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • andIn

      public SqlsCriteria<T> andIn(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, Iterable values)
      AND column IN (#{item.value}) 当 values = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      values - 值
      Returns:
      the object
    • andNotIn

      public SqlsCriteria<T> andNotIn(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, Iterable values)
      AND column NOT IN (#{item.value}) 当 values = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      values - 值
      Returns:
      the object
    • andBetween

      public SqlsCriteria<T> andBetween(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, Object value1, Object value2)
      AND column BETWEEN value1 AND value2 当 value1 或 value2 为空 则当前属性不参与查询
      Parameters:
      fn - 函数
      value1 - 值1
      value2 - 值2
      Returns:
      the object
    • andNotBetween

      public SqlsCriteria<T> andNotBetween(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, Object value1, Object value2)
      AND column NOT BETWEEN value1 AND value2 当 value1 或 value2 为空 则当前属性不参与查询
      Parameters:
      fn - 函数
      value1 - 值1
      value2 - 值2
      Returns:
      the object
    • andLike

      public SqlsCriteria<T> andLike(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, String value)
      AND column LIKE %value% 当 value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • andLikeLeft

      public SqlsCriteria<T> andLikeLeft(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, String value)
      AND column LIKE %value 当 value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • andLikeRight

      public SqlsCriteria<T> andLikeRight(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, String value)
      AND column LIKE value% 当 value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • andNotLike

      public SqlsCriteria<T> andNotLike(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, String value)
      AND column NOT LIKE %value% 当 value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • andNotLikeLeft

      public SqlsCriteria<T> andNotLikeLeft(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, String value)
      AND column NOT LIKE %value 当 value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • andNotLikeRight

      public SqlsCriteria<T> andNotLikeRight(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, String value)
      AND column NOT LIKE value% 当 value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • orIsNull

      public SqlsCriteria<T> orIsNull(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn)
      OR column IS NULL 当 value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      Returns:
      the object
    • orIsNotNull

      public SqlsCriteria<T> orIsNotNull(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn)
      OR column IS NOT NULL 当 value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      Returns:
      the object
    • orEqualTo

      public SqlsCriteria<T> orEqualTo(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, Object value)
      OR column = value 当 value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • orEqualTo

      public SqlsCriteria<T> orEqualTo(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, Object value, boolean required)
      OR column = value 当request = true 且 value = null时 转 #orIsNull(FunctionX)
      Parameters:
      fn - 函数
      value - 值
      required - 是否必须
      Returns:
      the object
    • orNotEqualTo

      public SqlsCriteria<T> orNotEqualTo(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, Object value)
      OR column 不等于 value 当value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • orNotEqualTo

      public SqlsCriteria<T> orNotEqualTo(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, Object value, boolean required)
      OR column 不等于 value 当request = true 且 value = null时 转 #orIsNotNull(FunctionX)
      Parameters:
      fn - 函数
      value - 值
      required - 是否必须
      Returns:
      the object
    • orGreaterThan

      public SqlsCriteria<T> orGreaterThan(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, String value)
      OR column 大于 value 当value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • orGreaterThanOrEqualTo

      public SqlsCriteria<T> orGreaterThanOrEqualTo(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, String value)
      OR column 大于等于 value 当value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • orLessThan

      public SqlsCriteria<T> orLessThan(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, String value)
      OR column 小于 value 当value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • orLessThanOrEqualTo

      public SqlsCriteria<T> orLessThanOrEqualTo(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, String value)
      OR column 小于等于 value 当value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • orIn

      public SqlsCriteria<T> orIn(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, Iterable values)
      OR column IN (#{item.value}) 当value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      values - 值
      Returns:
      the object
    • orNotIn

      public SqlsCriteria<T> orNotIn(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, Iterable values)
      OR column NOT IN (#{item.value}) 当value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      values - 值
      Returns:
      the object
    • orBetween

      public SqlsCriteria<T> orBetween(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, Object value1, Object value2)
      OR column BETWEEN value1 AND value2 当 value1 或 value2 为空 则当前属性不参与查询
      Parameters:
      fn - 函数
      value1 - 值1
      value2 - 值2
      Returns:
      the object
    • orNotBetween

      public SqlsCriteria<T> orNotBetween(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, Object value1, Object value2)
      OR column NOT BETWEEN value1 AND value2 当 value1 或 value2 为空 则当前属性不参与查询
      Parameters:
      fn - 函数
      value1 - 值1
      value2 - 值2
      Returns:
      the object
    • orLike

      public SqlsCriteria<T> orLike(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, String value)
      OR column LIKE value 当 value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • orLikeLeft

      public SqlsCriteria<T> orLikeLeft(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, String value)
      OR column LIKE %value 当 value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • orLikeRight

      public SqlsCriteria<T> orLikeRight(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, String value)
      OR column LIKE value% 当 value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • orNotLike

      public SqlsCriteria<T> orNotLike(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, String value)
      OR column NOT LIKE value 当 value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • orNotLikeLeft

      public SqlsCriteria<T> orNotLikeLeft(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, String value)
      OR column NOT LIKE %value 当 value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • orNotLikeRight

      public SqlsCriteria<T> orNotLikeRight(org.miaixz.bus.core.center.function.FunctionX<T,Object> fn, String value)
      OR column NOT LIKE value% 当 value = null 则当前属性不参与查询
      Parameters:
      fn - 函数
      value - 值
      Returns:
      the object
    • getCriteria

      public Sqls.Criteria getCriteria()
      Specified by:
      getCriteria in interface SqlCriteria