注释 | mapper | service | 注释 |
---|---|---|---|
DDML | 进一步封装:采用 get 查询单行, remove 删除, list 查询集合, page 分页 | ||
int insert(T entity); | boolean save(T entity); | 选择字段,策略插入 | |
boolean saveBatch(Collection
|
批量插入 | ||
boolean saveOrUpdateBatch(Collection
|
|||
int deleteById(Serializable id); | boolean removeById(Serializable id); | ||
根据 entity 条件删除 | int delete(Wrapper
|
boolean remove(Wrapper
|
无对应记录也返回true |
columnMap 删除条件 | int deleteByMap(Map<String, Object> columnMap); | boolean removeByMap(Map<String, Object> columnMap); | columnMap 表字段 map 对象 |
int updateById(T entity); | boolean updateById(T entity); | ||
boolean saveOrUpdate(T entity); | |||
T selectById(Serializable id); | T getById(Serializable id); | ||
columnMap查询条件 | List
|
Collection
|
|
如果逻辑非唯一需要 wrapper.last("limit 1") 设置唯一性 |
T selectOne(Wrapper
|
T getOne(Wrapper
|
有多个取一个 |
Integer selectCount(Wrapper
|
int count(Wrapper
|
||
List
|
List
|
||
只能查询一个字段 List<Object> cols; List<String> l = (List)cols; |
List<Object> selectObjs(Wrapper
|
List<Object> listObjs(Wrapper
|
根据 Wrapper 条件,查询全部记录 |
IPage
|
IPage
|
MyBatis-Plus BaseMapper和IService使用手册
猜你喜欢
转载自www.cnblogs.com/andea/p/11601367.html
今日推荐
周排行