Class SelectPropertyProvider

java.lang.Object
org.miaixz.bus.mapper.builder.MapperTemplate
org.miaixz.bus.mapper.additional.select.SelectPropertyProvider

public class SelectPropertyProvider extends MapperTemplate
根据属性查询
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • SelectPropertyProvider

      public SelectPropertyProvider(Class<?> mapperClass, MapperBuilder mapperBuilder)
  • Method Details

    • getColumnByProperty

      public static String getColumnByProperty(Class<?> entityClass, String property)
      根据实体Class和属性名获取对应的表字段名
      Parameters:
      entityClass - 实体Class对象
      property - 属性名
      Returns:
      the string
    • existsWhereCondition

      public static boolean existsWhereCondition(Object value, boolean notEmpty)
      判断是否需要拼接 where 条件
      Parameters:
      value - 值
      notEmpty - 是否为空
      Returns:
      the boolean
    • selectOneByProperty

      public String selectOneByProperty(org.apache.ibatis.mapping.MappedStatement ms)
      根据属性查询,只能有一个返回值,有多个结果时抛出异常,查询条件使用等号
      Parameters:
      ms - MappedStatement
      Returns:
      the string
    • selectByProperty

      public String selectByProperty(org.apache.ibatis.mapping.MappedStatement ms)
      根据属性查询,查询条件使用等号
      Parameters:
      ms - MappedStatement
      Returns:
      the string
    • selectInByProperty

      public String selectInByProperty(org.apache.ibatis.mapping.MappedStatement ms)
      根据属性查询,查询条件使用 in
      Parameters:
      ms - MappedStatement
      Returns:
      the string
    • selectBetweenByProperty

      public String selectBetweenByProperty(org.apache.ibatis.mapping.MappedStatement ms)
      根据属性查询,查询条件使用 between
      Parameters:
      ms - MappedStatement
      Returns:
      the string
    • existsWithProperty

      public String existsWithProperty(org.apache.ibatis.mapping.MappedStatement ms)
      根据属性查询总数,查询条件使用等号
      Parameters:
      ms - MappedStatement
      Returns:
      the string
    • selectCountByProperty

      public String selectCountByProperty(org.apache.ibatis.mapping.MappedStatement ms)
      根据属性查询总数,查询条件使用等号
      Parameters:
      ms - MappedStatement
      Returns:
      the string