mybatis-plus从2升级到3

2019-01-07  本文已影响0人  kevin_cae6

mybatis-plus2.* 和 mybatis-plus3.* 的包结构修改了,还是类也有修改,为了项目兼容,需要修改如下:

上面是2.*的结构,下面是3.*的结构:

import com.baomidou.mybatisplus.service.impl.ServiceImpl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

com.baomidou.mybatisplus.service.IService

om.baomidou.mybatisplus.extension.service.IService

import com.baomidou.mybatisplus.mapper.BaseMapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.baomidou.mybatisplus.mapper.EntityWrapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import com.baomidou.mybatisplus.plugins.Page;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import com.baomidou.mybatisplus.plugins.pagination.Pagination;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

pageList.getTotal()  --> 返回参数从int变成long

int count

long count

Service.insert

Service.save

Service.selectList

Service.page

Service.selectById

Service.getById

EntityWrapper<

QueryWrapper<

Service.selectPage

Service.page

Service.delete

Service.remove

IPage<

Page<

import com.baomidou.mybatisplus.annotations.TableId;

import com.baomidou.mybatisplus.annotation.TableId;

import com.baomidou.mybatisplus.annotations.TableField;

import com.baomidou.mybatisplus.annotation.TableField;

import com.baomidou.mybatisplus.annotations.TableName;

import com.baomidou.mybatisplus.annotation.TableName;

Service.deleteById

Service.removeById

上一篇 下一篇

猜你喜欢

热点阅读