MyBatis:mybatisplus查询最大值

时间:2025-03-20 10:30:01

您可以通过使用mybatis-plus提供 QueryWrapper类来获取某值最大数据。以下实例根据自己需求调整:

QueryWrapper<Entity> queryWrapper = new QueryWrapper<>();
("max(column_name)");
Entity entity = (queryWrapper );

其中Entity为实体bean,column_name为获取需要获取最大值列名,entityMapper为Mapper接口