wrapper介绍:
- AbstractWrapper: 用于查询条件封装,生成sql的where条件
- AbstractLambdaWrapper: Lambda语法使用Wrapper统一处理解析lambda获取column
- QueryWrapper: Entity 对象封装操作类,不是用lambda
- UpdateWrapper: Update条件封装,用于Entity对象更新操作
CURD接口
Mapper CRUD接口
int insert (T entity)//插入一条记录
deleteById(Serializable id) //根据Id删除
deleteByMap( Map<String, Object> columnMap) // 根据 columMap条件删除记录
int delete( Wrapper
wrapper)//根据wrapper里面Entity条件删除
int deleteBatchIds( Collection<? extends Serializable> idList); //根据ID批量删除
int updateById(T entity);//根据ID修改
int update(T entity, Wrapper
updateWrapper);//entity作为set条件值,updateWrapprt里面的entity用于生成where条件值
T seleteById(String id) //根据id查询
List
selectBatchIds( Collection<? extends Serializable> idList);//根据id批量查询
List
selectByMap( Map<String, Object> columnMap);//根据map条件
T selectOne( Wrapper
queryWrapper);//根据wrapper里面的entity查找,如果不是唯一需要添加wrapper.last("limit 1")
. Integer selectCount( Wrapper
queryWrapper);//根据wrapper条件查询总数
. List
selectList(Wrapper
queryWrapper); //根据条件查询实体集合
. List<Map<String, Object>> selectMaps( Wrapper
queryWrapper);//根据 Wrapper 条件,查询全部记录
. List