Springboot项目中mybatisplus Wrappers, ServiceImpl, Page的使用

mybatisplus中必须学会使用的几个类:
ServiceImpl<M extends BaseMapper,T> implements IService< T>
这个类封装了baseMapper sqlHelper, T 为绑定数据库的实体类,内部通过反射拿到@tableName 的注解数据库表,以此实现数据库相关操作,内部主要方法:

boolean saveOrUpdate(T entity)
boolean saveOrUpdateBatch(Collection<T> entityList)
boolean removeById(Serializable id)
boolean removeByIds(Collection<? extends Serializable> idList)
boolean removeByMap(Map<String, Object> columnMap)
boolean remove(Wrapper<T> queryWrapper)
boolean updateById(T entity)
boolean update(Wrapper<T> updateWrapper)
boolean updateBatchById(Collection<T> entityList, int batchSize)

T getOne(Wrapper<T> queryWrapper)
T getById(Serializable id)
List<T> listByIds(Collection<? extends Serializable> idList)
List<T> listByMap(Map<String, Object> columnMap)
T getOne(Wrapper<T> queryWrapper)
List<T> <
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值