public interface BaseMapper<T extends BaseEntity,ID extends Serializable>
| 限定符和类型 | 方法和说明 |
|---|---|
int |
batchLogicDelete(List<ID> ids) |
int |
batchUpdateByPrimaryKeys(List<ID> ids,
T example) |
long |
countAll() |
long |
countByExample(Object example) |
Integer |
deleteByExample(Object example) |
int |
deleteByPrimaryKey(ID id) |
int |
deleteByPrimaryKeys(List<ID> ids) |
void |
insert(T entity)
保存(持久化)对象
|
void |
insertList(List<T> entities)
批量插入
|
void |
insertSelective(T entity) |
List<T> |
selectAll() |
List<T> |
selectByExample(Object example) |
T |
selectByPrimaryKey(ID id)
获取指定的唯一标识符对应的持久化对象
|
List<T> |
selectByPrimaryKeys(List<ID> ids) |
T |
selectOneByExample(Object example) |
int |
updateByPrimaryKey(T entity) |
int |
updateByPrimaryKeySelective(T entity) |
int |
updateByPrimaryKeyWithVersion(T entity)
带乐观锁更新
|
int |
updateListByPrimaryKeys(List<T> entities) |
int |
updateListByPrimaryKeysSelective(List<T> entities)
批量更新对象 (jdbc连接需指定allowMultiQueries=true)
|
void insert(T entity)
entity - 要持久化的对象void insertSelective(T entity)
int updateByPrimaryKey(T entity)
entity - int updateByPrimaryKeySelective(T entity)
entity - @UpdateProvider(type=UpdateWithVersionProvider.class, method="updateByPrimaryKeyWithVersion") @ResultType(value=int.class) int updateByPrimaryKeyWithVersion(T entity)
entity - T selectByPrimaryKey(ID id)
id - 指定的唯一标识符int deleteByPrimaryKey(ID id)
long countAll()
@SelectProvider(type=CountByExampleProvider.class, method="countByExample") @ResultType(value=java.lang.Long.class) long countByExample(Object example)
@SelectProvider(type=SelectByExampleProvider.class, method="selectByExample") @ResultMap(value="BaseResultMap") List<T> selectByExample(Object example)
int batchUpdateByPrimaryKeys(@Param(value="ids")
List<ID> ids,
@Param(value="example")
T example)
int updateListByPrimaryKeysSelective(List<T> entities)
entities - @DeleteProvider(type=DeleteByExampleProvider.class, method="deleteByExample") @ResultType(value=java.lang.Integer.class) Integer deleteByExample(Object example)
@SelectProvider(type=SelectOneByExampleProvider.class, method="selectOneByExample") @ResultMap(value="BaseResultMap") T selectOneByExample(Object example)
Copyright © 2025. All rights reserved.