美文网首页
mybatis-plus从2升级到3

mybatis-plus从2升级到3

作者: kevin_cae6 | 来源:发表于2019-01-07 18:28 被阅读0次

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

相关文章

网友评论

      本文标题:mybatis-plus从2升级到3

      本文链接:https://www.haomeiwen.com/subject/jekprqtx.html