注释mapperservice注释
DDML进一步封装:采用 get 查询单行, remove 删除, list 查询集合, page 分页int insert(T entity);boolean save(T entity);选择字段,策略插入boolean saveBatch(Collection entityList);批量插入boolean saveOrUpdateBatch(Collection entityList);int deleteById(Serializable id);boolean removeById(Serializable id);根据 entity 条件删除int delete(Wrapper wrapper);boolean remove(Wrapper queryWrapper);无对应记录也返回truecolumnMap 删除条件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 selectByMap(Map<String, Object> columnMap);Collection listByMap(Map<String, Object> columnMap);如果逻辑非唯一需要 wrapper.last("limit 1") 设置唯一性T selectOne(Wrapper queryWrapper);T getOne(Wrapper queryWrapper);有多个取一个Integer selectCount(Wrapper queryWrapper);int count(Wrapper queryWrapper);List selectList(Wrapper queryWrapper);List list(Wrapper queryWrapper);只能查询一个字段List<Object> cols;List<String> l = (List)cols;List<Object> selectObjs(Wrapper queryWrapper);List<Object> listObjs(Wrapper queryWrapper);根据 Wrapper 条件,查询全部记录IPage selectPage(IPage page, Wrapper queryWrapper);IPage page(IPage page, Wrapper queryWrapper);
转载于:https://www.cnblogs.com/andea/p/11601367.html
转载请注明原文地址:https://ipadbbs.8miu.com/read-61993.html