In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Most people do not understand the knowledge points of this article "mybatis-plus returns the total number of query records", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "mybatis-plus returns the total number of query records" article.
Mybatis-plus returns the total number of records in the query
The mp framework provides a selectCount method to query the total number of records
Demand:
Find the number of employees whose salary is more than 3500 and have "small" in their names.
Sql implementation:
Select count (*) from t_employee where salary > 3500 and name like'% small%'
Code implementation:
@ Testpublic void selectCountByQueryWrapper11 () {QueryWrapper queryWrapper=new QueryWrapper (); / / QueryWrapper queryWrapper2=Wrappers.query (); queryWrapper.gt ("salary", 3500). Like ("name", "small"); Integer count = employeeMapper.selectCount (queryWrapper); System.out.println (count);} mybatis-plus paging query, solution package com.integration.config;import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;import org.mybatis.spring.annotation.MapperScan;import org.springframework.context.annotation.Bean with zero total number of entries Import org.springframework.context.annotation.Configuration;@Configuration@MapperScan ("com.integration.mapper") public class MybatisPlusConfig {@ Bean public PaginationInterceptor paginationInterceptor () {PaginationInterceptor page = new PaginationInterceptor (); return page }} the above is the content of this article on "what is the method for mybatis-plus to return the total number of query records". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.