Package io.mybatis.mapper.logical
Interface LogicalMapper<T,I extends Serializable>
-
- All Superinterfaces:
BaseMapper<T,I>,CursorMapper<T,Example<T>>,io.mybatis.provider.EntityInfoMapper<T>,EntityMapper<T,I>,ExampleMapper<T,Example<T>>,FnMapper<T>
public interface LogicalMapper<T,I extends Serializable> extends BaseMapper<T,I>, FnMapper<T>
逻辑删除的 Mapper 方法继承此mapper会覆盖BaseMapper、FnMapper中的查、删、改相关方法
- Author:
- hzw
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description longcountByExample(Example<T> example)根据 Example 条件查询总数intdelete(T entity)保存实体信息批量删除intdeleteByExample(Example<T> example)根据 Example 删除intdeleteByPrimaryKey(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可以实现一样的功能,当前方法只是示例)longselectCount(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 条件查询单个实体intupdateByExample(T entity, Example<T> example)根据 Example 条件批量更新实体信息intupdateByExampleSelective(T entity, Example<T> example)根据 Example 条件批量更新实体不为空的字段intupdateByExampleSetValues(Example<T> example)根据 Example 条件和 setValue 值更新字段intupdateByPrimaryKey(T entity)根据主键更新实体intupdateByPrimaryKeySelective(T entity)根据主键更新实体中不为空的字段intupdateByPrimaryKeySelectiveWithForceFields(T entity, Fn.Fns<T> forceUpdateFields)根据主键更新实体中不为空的字段,强制字段不区分是否 null,都更新-
Methods inherited from interface io.mybatis.mapper.BaseMapper
deleteByFieldList, selectByFieldList, wrapper
-
Methods inherited from interface io.mybatis.mapper.base.EntityMapper
insert, insertSelective
-
-
-
-
Method Detail
-
updateByPrimaryKeySelectiveWithForceFields
@Lang(io.mybatis.provider.Caching.class) @UpdateProvider(type=LogicalProvider.class, method="updateByPrimaryKeySelectiveWithForceFields") int updateByPrimaryKeySelectiveWithForceFields(@Param("entity") T entity, @Param("fns") Fn.Fns<T> forceUpdateFields)
Description copied from interface:BaseMapper根据主键更新实体中不为空的字段,强制字段不区分是否 null,都更新当前方法来自
FnMapper,该接口中的其他方法用ExampleMapper也能实现- Specified by:
updateByPrimaryKeySelectiveWithForceFieldsin interfaceBaseMapper<T,I extends Serializable>- Specified by:
updateByPrimaryKeySelectiveWithForceFieldsin interfaceFnMapper<T>- Parameters:
entity- 实体类forceUpdateFields- 强制更新的字段,不区分字段是否为 null,通过Fn.of(Fn...)创建Fn.Fns- Returns:
- 1成功,0失败
-
selectColumnsOne
@Lang(io.mybatis.provider.Caching.class) @SelectProvider(type=LogicalProvider.class, method="selectColumns") Optional<T> selectColumnsOne(@Param("entity") T entity, @Param("fns") Fn.Fns<T> selectFields)
Description copied from interface:FnMapper根据实体字段条件查询唯一的实体(ExampleMapper可以实现一样的功能,当前方法只是示例)- Specified by:
selectColumnsOnein interfaceFnMapper<T>- Parameters:
entity- 实体类selectFields- 查询的字段,不区分字段是否为 null,通过Fn.of(Fn...)创建Fn.Fns- Returns:
- 单个实体,查询结果由多条时报错
-
selectColumns
@Lang(io.mybatis.provider.Caching.class) @SelectProvider(type=LogicalProvider.class, method="selectColumns") List<T> selectColumns(@Param("entity") T entity, @Param("fns") Fn.Fns<T> selectFields)
Description copied from interface:FnMapper根据实体字段条件批量查询(ExampleMapper可以实现一样的功能,当前方法只是示例)- Specified by:
selectColumnsin interfaceFnMapper<T>- Parameters:
entity- 实体类selectFields- 查询的字段,不区分字段是否为 null,通过Fn.of(Fn...)创建Fn.Fns- Returns:
- 实体列表
-
deleteByPrimaryKey
@Lang(io.mybatis.provider.Caching.class) @DeleteProvider(type=LogicalProvider.class, method="deleteByPrimaryKey") int deleteByPrimaryKey(I id)
Description copied from interface:EntityMapper根据主键删除- Specified by:
deleteByPrimaryKeyin interfaceEntityMapper<T,I extends Serializable>- Parameters:
id- 主键- Returns:
- 1成功,0失败
-
delete
@Lang(io.mybatis.provider.Caching.class) @DeleteProvider(type=LogicalProvider.class, method="delete") int delete(T entity)
Description copied from interface:EntityMapper保存实体信息批量删除- Specified by:
deletein interfaceEntityMapper<T,I extends Serializable>- Parameters:
entity- 实体类- Returns:
- 大于等于1成功,0失败
-
updateByPrimaryKey
@Lang(io.mybatis.provider.Caching.class) @UpdateProvider(type=LogicalProvider.class, method="updateByPrimaryKey") int updateByPrimaryKey(T entity)
Description copied from interface:EntityMapper根据主键更新实体- Specified by:
updateByPrimaryKeyin interfaceEntityMapper<T,I extends Serializable>- Parameters:
entity- 实体类- Returns:
- 1成功,0失败
-
updateByPrimaryKeySelective
@Lang(io.mybatis.provider.Caching.class) @UpdateProvider(type=LogicalProvider.class, method="updateByPrimaryKeySelective") int updateByPrimaryKeySelective(T entity)
Description copied from interface:EntityMapper根据主键更新实体中不为空的字段- Specified by:
updateByPrimaryKeySelectivein interfaceEntityMapper<T,I extends Serializable>- Parameters:
entity- 实体类- Returns:
- 1成功,0失败
-
selectByPrimaryKey
@Lang(io.mybatis.provider.Caching.class) @SelectProvider(type=LogicalProvider.class, method="selectByPrimaryKey") Optional<T> selectByPrimaryKey(I id)
Description copied from interface:EntityMapper根据主键查询实体- Specified by:
selectByPrimaryKeyin interfaceEntityMapper<T,I extends Serializable>- Parameters:
id- 主键- Returns:
- 实体
-
selectOne
@Lang(io.mybatis.provider.Caching.class) @SelectProvider(type=LogicalProvider.class, method="select") Optional<T> selectOne(T entity)
Description copied from interface:EntityMapper根据实体字段条件查询唯一的实体- Specified by:
selectOnein interfaceEntityMapper<T,I extends Serializable>- Parameters:
entity- 实体类- Returns:
- 单个实体,查询结果由多条时报错
-
selectList
@Lang(io.mybatis.provider.Caching.class) @SelectProvider(type=LogicalProvider.class, method="select") List<T> selectList(T entity)
Description copied from interface:EntityMapper根据实体字段条件批量查询- Specified by:
selectListin interfaceEntityMapper<T,I extends Serializable>- Parameters:
entity- 实体类- Returns:
- 实体列表
-
selectCount
@Lang(io.mybatis.provider.Caching.class) @SelectProvider(type=LogicalProvider.class, method="selectCount") long selectCount(T entity)
Description copied from interface:EntityMapper根据实体字段条件查询总数- Specified by:
selectCountin interfaceEntityMapper<T,I extends Serializable>- Parameters:
entity- 实体类- Returns:
- 总数
-
selectCursor
@Lang(io.mybatis.provider.Caching.class) @SelectProvider(type=LogicalProvider.class, method="select") org.apache.ibatis.cursor.Cursor<T> selectCursor(T entity)
Description copied from interface:CursorMapper根据实体字段条件查询- Specified by:
selectCursorin interfaceCursorMapper<T,I extends Serializable>- Parameters:
entity- 实体类- Returns:
- 实体列表
-
selectCursorByExample
@Lang(io.mybatis.provider.Caching.class) @SelectProvider(type=LogicalProvider.class, method="selectByExample") org.apache.ibatis.cursor.Cursor<T> selectCursorByExample(Example<T> example)
Description copied from interface:CursorMapper根据 Example 条件查询- Specified by:
selectCursorByExamplein interfaceCursorMapper<T,I extends Serializable>- Parameters:
example- 条件- Returns:
- 实体列表
-
example
default Example<T> example()
Description copied from interface:ExampleMapper获取 Example 对象- Specified by:
examplein interfaceExampleMapper<T,I extends Serializable>- Returns:
- Example 对象
-
deleteByExample
@Lang(io.mybatis.provider.Caching.class) @DeleteProvider(type=LogicalProvider.class, method="deleteByExample") int deleteByExample(Example<T> example)
Description copied from interface:ExampleMapper根据 Example 删除- Specified by:
deleteByExamplein interfaceExampleMapper<T,I extends Serializable>- Parameters:
example- 条件- Returns:
- 大于等于1成功,0失败
-
updateByExample
@Lang(io.mybatis.provider.Caching.class) @UpdateProvider(type=LogicalProvider.class, method="updateByExample") int updateByExample(@Param("entity") T entity, @Param("example") Example<T> example)
Description copied from interface:ExampleMapper根据 Example 条件批量更新实体信息- Specified by:
updateByExamplein interfaceExampleMapper<T,I extends Serializable>- Parameters:
entity- 实体类example- 条件- Returns:
- 大于等于1成功,0失败
-
updateByExampleSetValues
@Lang(io.mybatis.provider.Caching.class) @UpdateProvider(type=LogicalProvider.class, method="updateByExampleSetValues") int updateByExampleSetValues(@Param("example") Example<T> example)
Description copied from interface:ExampleMapper根据 Example 条件和 setValue 值更新字段- Specified by:
updateByExampleSetValuesin interfaceExampleMapper<T,I extends Serializable>- Parameters:
example- 条件- Returns:
- 大于等于1成功,0失败
-
updateByExampleSelective
@Lang(io.mybatis.provider.Caching.class) @UpdateProvider(type=LogicalProvider.class, method="updateByExampleSelective") int updateByExampleSelective(@Param("entity") T entity, @Param("example") Example<T> example)
Description copied from interface:ExampleMapper根据 Example 条件批量更新实体不为空的字段- Specified by:
updateByExampleSelectivein interfaceExampleMapper<T,I extends Serializable>- Parameters:
entity- 实体类example- 条件- Returns:
- 大于等于1成功,0失败
-
selectByExample
@Lang(io.mybatis.provider.Caching.class) @SelectProvider(type=LogicalProvider.class, method="selectByExample") List<T> selectByExample(Example<T> example)
Description copied from interface:ExampleMapper根据 Example 条件批量查询- Specified by:
selectByExamplein interfaceExampleMapper<T,I extends Serializable>- Parameters:
example- 条件- Returns:
- 实体列表
-
selectOneByExample
@Lang(io.mybatis.provider.Caching.class) @SelectProvider(type=LogicalProvider.class, method="selectByExample") Optional<T> selectOneByExample(Example<T> example)
Description copied from interface:ExampleMapper根据 Example 条件查询单个实体- Specified by:
selectOneByExamplein interfaceExampleMapper<T,I extends Serializable>- Parameters:
example- 条件- Returns:
- 单个实体,查询结果由多条时报错
-
countByExample
@Lang(io.mybatis.provider.Caching.class) @SelectProvider(type=LogicalProvider.class, method="countByExample") long countByExample(Example<T> example)
Description copied from interface:ExampleMapper根据 Example 条件查询总数- Specified by:
countByExamplein interfaceExampleMapper<T,I extends Serializable>- Parameters:
example- 条件- Returns:
- 总数
-
selectByExample
List<T> selectByExample(Example<T> example, org.apache.ibatis.session.RowBounds rowBounds)
Description copied from interface:ExampleMapper根据 Example 条件批量查询- Specified by:
selectByExamplein interfaceExampleMapper<T,I extends Serializable>- Parameters:
example- 条件rowBounds- 分页信息- Returns:
- 实体列表
-
-