public interface LogicalMapper<T,I extends Serializable> extends BaseMapper<T,I>, FnMapper<T>
继承此mapper会覆盖BaseMapper、FnMapper中的查、删、改相关方法
| Modifier and Type | Method and Description |
|---|---|
long |
countByExample(Example<T> example)
根据 Example 条件查询总数
|
int |
delete(T entity)
保存实体信息批量删除
|
int |
deleteByExample(Example<T> example)
根据 Example 删除
|
int |
deleteByPrimaryKey(I id)
根据主键删除
|
default Example<T> |
example()
获取 Example 对象
|
List<T> |
selectByExample(Example<T> example)
根据 Example 条件批量查询
|
List<T> |
selectByExample(Example<T> example,
org.apache.ibatis.session.RowBounds rowBounds)
根据 Example 条件批量查询
|
Optional<T> |
selectByPrimaryKey(I id)
根据主键查询实体
|
List<T> |
selectColumns(T entity,
Fn.Fns<T> selectFields)
根据实体字段条件批量查询(
ExampleMapper 可以实现一样的功能,当前方法只是示例) |
Optional<T> |
selectColumnsOne(T entity,
Fn.Fns<T> selectFields)
根据实体字段条件查询唯一的实体(
ExampleMapper 可以实现一样的功能,当前方法只是示例) |
long |
selectCount(T entity)
根据实体字段条件查询总数
|
org.apache.ibatis.cursor.Cursor<T> |
selectCursor(T entity)
根据实体字段条件查询
|
org.apache.ibatis.cursor.Cursor<T> |
selectCursorByExample(Example<T> example)
根据 Example 条件查询
|
List<T> |
selectList(T entity)
根据实体字段条件批量查询
|
Optional<T> |
selectOne(T entity)
根据实体字段条件查询唯一的实体
|
Optional<T> |
selectOneByExample(Example<T> example)
根据 Example 条件查询单个实体
|
int |
updateByExample(T entity,
Example<T> example)
根据 Example 条件批量更新实体信息
|
int |
updateByExampleSelective(T entity,
Example<T> example)
根据 Example 条件批量更新实体不为空的字段
|
int |
updateByExampleSetValues(Example<T> example)
根据 Example 条件和 setValue 值更新字段
|
int |
updateByPrimaryKey(T entity)
根据主键更新实体
|
int |
updateByPrimaryKeySelective(T entity)
根据主键更新实体中不为空的字段
|
int |
updateByPrimaryKeySelectiveWithForceFields(T entity,
Fn.Fns<T> forceUpdateFields)
根据主键更新实体中不为空的字段,强制字段不区分是否 null,都更新
|
deleteByFieldList, selectByFieldList, wrapperinsert, insertSelective@Lang(value=io.mybatis.provider.Caching.class) @UpdateProvider(type=LogicalProvider.class, method="updateByPrimaryKeySelectiveWithForceFields") int updateByPrimaryKeySelectiveWithForceFields(@Param(value="entity") T entity, @Param(value="fns") Fn.Fns<T> forceUpdateFields)
BaseMapper
当前方法来自 FnMapper,该接口中的其他方法用 ExampleMapper 也能实现
updateByPrimaryKeySelectiveWithForceFields in interface BaseMapper<T,I extends Serializable>updateByPrimaryKeySelectiveWithForceFields in interface FnMapper<T>entity - 实体类forceUpdateFields - 强制更新的字段,不区分字段是否为 null,通过 Fn.of(Fn...) 创建 Fn.Fns@Lang(value=io.mybatis.provider.Caching.class) @SelectProvider(type=LogicalProvider.class, method="selectColumns") Optional<T> selectColumnsOne(@Param(value="entity") T entity, @Param(value="fns") Fn.Fns<T> selectFields)
FnMapperExampleMapper 可以实现一样的功能,当前方法只是示例)selectColumnsOne in interface FnMapper<T>entity - 实体类selectFields - 查询的字段,不区分字段是否为 null,通过 Fn.of(Fn...) 创建 Fn.Fns@Lang(value=io.mybatis.provider.Caching.class) @SelectProvider(type=LogicalProvider.class, method="selectColumns") List<T> selectColumns(@Param(value="entity") T entity, @Param(value="fns") Fn.Fns<T> selectFields)
FnMapperExampleMapper 可以实现一样的功能,当前方法只是示例)selectColumns in interface FnMapper<T>entity - 实体类selectFields - 查询的字段,不区分字段是否为 null,通过 Fn.of(Fn...) 创建 Fn.Fns@Lang(value=io.mybatis.provider.Caching.class) @DeleteProvider(type=LogicalProvider.class, method="deleteByPrimaryKey") int deleteByPrimaryKey(I id)
EntityMapperdeleteByPrimaryKey in interface EntityMapper<T,I extends Serializable>id - 主键@Lang(value=io.mybatis.provider.Caching.class) @DeleteProvider(type=LogicalProvider.class, method="delete") int delete(T entity)
EntityMapperdelete in interface EntityMapper<T,I extends Serializable>entity - 实体类@Lang(value=io.mybatis.provider.Caching.class) @UpdateProvider(type=LogicalProvider.class, method="updateByPrimaryKey") int updateByPrimaryKey(T entity)
EntityMapperupdateByPrimaryKey in interface EntityMapper<T,I extends Serializable>entity - 实体类@Lang(value=io.mybatis.provider.Caching.class) @UpdateProvider(type=LogicalProvider.class, method="updateByPrimaryKeySelective") int updateByPrimaryKeySelective(T entity)
EntityMapperupdateByPrimaryKeySelective in interface EntityMapper<T,I extends Serializable>entity - 实体类@Lang(value=io.mybatis.provider.Caching.class) @SelectProvider(type=LogicalProvider.class, method="selectByPrimaryKey") Optional<T> selectByPrimaryKey(I id)
EntityMapperselectByPrimaryKey in interface EntityMapper<T,I extends Serializable>id - 主键@Lang(value=io.mybatis.provider.Caching.class) @SelectProvider(type=LogicalProvider.class, method="select") Optional<T> selectOne(T entity)
EntityMapperselectOne in interface EntityMapper<T,I extends Serializable>entity - 实体类@Lang(value=io.mybatis.provider.Caching.class) @SelectProvider(type=LogicalProvider.class, method="select") List<T> selectList(T entity)
EntityMapperselectList in interface EntityMapper<T,I extends Serializable>entity - 实体类@Lang(value=io.mybatis.provider.Caching.class) @SelectProvider(type=LogicalProvider.class, method="selectCount") long selectCount(T entity)
EntityMapperselectCount in interface EntityMapper<T,I extends Serializable>entity - 实体类@Lang(value=io.mybatis.provider.Caching.class) @SelectProvider(type=LogicalProvider.class, method="select") org.apache.ibatis.cursor.Cursor<T> selectCursor(T entity)
CursorMapperselectCursor in interface CursorMapper<T,Example<T>>entity - 实体类@Lang(value=io.mybatis.provider.Caching.class) @SelectProvider(type=LogicalProvider.class, method="selectByExample") org.apache.ibatis.cursor.Cursor<T> selectCursorByExample(Example<T> example)
CursorMapperselectCursorByExample in interface CursorMapper<T,Example<T>>example - 条件default Example<T> example()
ExampleMapperexample in interface ExampleMapper<T,Example<T>>@Lang(value=io.mybatis.provider.Caching.class) @DeleteProvider(type=LogicalProvider.class, method="deleteByExample") int deleteByExample(Example<T> example)
ExampleMapperdeleteByExample in interface ExampleMapper<T,Example<T>>example - 条件@Lang(value=io.mybatis.provider.Caching.class) @UpdateProvider(type=LogicalProvider.class, method="updateByExample") int updateByExample(@Param(value="entity") T entity, @Param(value="example") Example<T> example)
ExampleMapperupdateByExample in interface ExampleMapper<T,Example<T>>entity - 实体类example - 条件@Lang(value=io.mybatis.provider.Caching.class) @UpdateProvider(type=LogicalProvider.class, method="updateByExampleSetValues") int updateByExampleSetValues(@Param(value="example") Example<T> example)
ExampleMapperupdateByExampleSetValues in interface ExampleMapper<T,Example<T>>example - 条件@Lang(value=io.mybatis.provider.Caching.class) @UpdateProvider(type=LogicalProvider.class, method="updateByExampleSelective") int updateByExampleSelective(@Param(value="entity") T entity, @Param(value="example") Example<T> example)
ExampleMapperupdateByExampleSelective in interface ExampleMapper<T,Example<T>>entity - 实体类example - 条件@Lang(value=io.mybatis.provider.Caching.class) @SelectProvider(type=LogicalProvider.class, method="selectByExample") List<T> selectByExample(Example<T> example)
ExampleMapperselectByExample in interface ExampleMapper<T,Example<T>>example - 条件@Lang(value=io.mybatis.provider.Caching.class) @SelectProvider(type=LogicalProvider.class, method="selectByExample") Optional<T> selectOneByExample(Example<T> example)
ExampleMapperselectOneByExample in interface ExampleMapper<T,Example<T>>example - 条件@Lang(value=io.mybatis.provider.Caching.class) @SelectProvider(type=LogicalProvider.class, method="countByExample") long countByExample(Example<T> example)
ExampleMappercountByExample in interface ExampleMapper<T,Example<T>>example - 条件List<T> selectByExample(Example<T> example, org.apache.ibatis.session.RowBounds rowBounds)
ExampleMapperselectByExample in interface ExampleMapper<T,Example<T>>example - 条件rowBounds - 分页信息Copyright © 2023. All rights reserved.