Package com.imyeyu.spring.util
Class SQLProvider
java.lang.Object
com.imyeyu.spring.util.BaseSQLProvider
com.imyeyu.spring.util.SQLProvider
- Direct Known Subclasses:
RawSQLProvider
通用 Mapper SQL 代理器
继承 BaseSQLProvider,为 BaseMapper 提供适配层
- Since:
- 2025-02-05 23:34
- Author:
- 夜雨
-
Nested Class Summary
Nested classes/interfaces inherited from class com.imyeyu.spring.util.BaseSQLProvider
BaseSQLProvider.EntityMeta, BaseSQLProvider.FieldColumn -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncountByPage(org.apache.ibatis.builder.annotation.ProviderContext context, Page<?> page) 根据 Page 对象统计数据量根据 ID 软删除,需要实体实现DeletabledeleteAllByExample(Object entity, Logic logic) 根据示例批量逻辑删除硬删除,需要实体实现DestroyabledestroyAllByExample(Object entity, Logic logic) 根据示例批量销毁(物理删除)插入根据 ID 查询selectAll(org.apache.ibatis.builder.annotation.ProviderContext context) 查询全部数据selectAllByExample(Object entity, Logic logic) 根据实体非空字段使用等号查询selectByExample(Object entity, Logic logic) 根据实体非空字段使用等号查询selectByPage(org.apache.ibatis.builder.annotation.ProviderContext context, Page<?> page) 根据 Page 对象查询数据列表根据 ID 更新,需要实体实现UpdatableupdateSelective(Object entity) 根据 ID 更新,选择性更新非空属性,需要实体实现UpdatableMethods inherited from class com.imyeyu.spring.util.BaseSQLProvider
appendOrderBy, appendPageConditions, appendSoftDeleteCondition, buildCountByPageSQL, buildDeleteAllByExampleSQL, buildDeleteSQL, buildDestroyAllByExampleSQL, buildDestroySQL, buildExampleConditions, buildInsertSQL, buildSelectAllByExampleSQL, buildSelectByIdSQL, buildSelectByPageSQL, buildUpdateSelectiveSQL, buildUpdateSQL, getEntityMeta, getEntityMeta
-
Constructor Details
-
SQLProvider
public SQLProvider()创建 SQL 提供器
-
-
Method Details
-
selectByPage
public String selectByPage(org.apache.ibatis.builder.annotation.ProviderContext context, @Param("page") Page<?> page) 根据 Page 对象查询数据列表- Parameters:
context- 代理器上下文page- 分页参数- Returns:
- SQL
-
countByPage
public String countByPage(org.apache.ibatis.builder.annotation.ProviderContext context, @Param("page") Page<?> page) 根据 Page 对象统计数据量- Parameters:
context- 代理器上下文page- 分页参数- Returns:
- SQL
-
selectAll
查询全部数据- Parameters:
context- 代理器上下文- Returns:
- SQL
-
insert
插入不实现
Creatable也允许调用是合理的,某些数据属于关联数据,不参与主创建过程- Parameters:
context- 代理器上下文entity- 实体- Returns:
- SQL
-
select
public String select(org.apache.ibatis.builder.annotation.ProviderContext context, @Param("id") Object id) 根据 ID 查询- Parameters:
context- 代理器上下文id- ID- Returns:
- SQL
-
selectByExample
根据实体非空字段使用等号查询- Parameters:
entity- 实体logic- 条件连接逻辑- Returns:
- SQL
-
selectAllByExample
根据实体非空字段使用等号查询- Parameters:
entity- 实体logic- 条件连接逻辑- Returns:
- SQL
-
update
根据 ID 更新,需要实体实现Updatable- Parameters:
entity- 实体- Returns:
- SQL
-
updateSelective
根据 ID 更新,选择性更新非空属性,需要实体实现Updatable- Parameters:
entity- 实体- Returns:
- SQL
-
delete
public String delete(org.apache.ibatis.builder.annotation.ProviderContext context, @Param("id") Object id) 根据 ID 软删除,需要实体实现Deletable- Parameters:
context- 代理器上下文id- ID- Returns:
- SQL
-
deleteAllByExample
根据示例批量逻辑删除- Parameters:
entity- 实体logic- 条件连接逻辑- Returns:
- SQL
-
destroy
public String destroy(org.apache.ibatis.builder.annotation.ProviderContext context, @Param("id") Object id) 硬删除,需要实体实现Destroyable- Parameters:
context- 代理器上下文id- ID- Returns:
- SQL
-
destroyAllByExample
根据示例批量销毁(物理删除)- Parameters:
entity- 实体logic- 条件连接逻辑- Returns:
- SQL
-