mybatis-plus list(Wrappers)

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档

文章目录

  • 前言
  • 一、方法命名


前言

使用mybatis-plus中的一个坑


一、方法命名

在使用mybatis-plus的过程中如果命名和BaseMapper中的命名重复了是非常淦的一件事,如图
mybatis-plus list(Wrappers)_第1张图片
此时如果调用如:

List<XOrderReturn> list = list(Wrappers.<XOrderReturn>lambdaQuery().eq(XOrderReturn::getOrderBaseid, xOrderReturn.getOrderBaseid()).eq(XOrderReturn::getOrderListid, xOrderReturn.getOrderListid()).eq(XOrderReturn::getShopgoodsid, xOrderReturn.getShopgoodsid()));

这种 list(Wrappers xxx) 的操作,就不会出现预期的查询(预期的查询指的是查询符合这些条件的list)而是会返回上面图的集合,原因非常简单,因为继承的BaseMapper extends Mapper命名是非常规范的mybatis-plus list(Wrappers)_第2张图片
所以自定义别那么规范得有点特色,是把.

你可能感兴趣的:(mybatis)