注釋 | mapper extends BaseMapper | service extends IService | 注釋 |
---|---|---|---|
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
|