MP offers a lot of useful plug-ins, and the configuration is simple and easy to use. Then take a look at how the use of plug-MP.
1, pagination plug-ins:
Before there comes, selectPage method BaseMapper of selectPage method and AR are not provided physical page, after page plug-in is required to configure physical page, so now take a look at how to configure the plugin.
<!-- 3、配置mybatisplus的sqlSessionFactory -->
<bean id="sqlSessionFactory" class=
"com.baomidou.mybatisplus.spring.MybatisSqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value="classpath:mybatis-config.xml"/>
<property name="typeAliasesPackage" value="com.zhu.mybatisplus.entity"/>
<!-- 注入全局配置 -->
<property name="globalConfig" ref="globalConfiguration"/>
<!-- 配置插件 -->
<property name="plugins">
<list>
<!-- 分页插件 -->
<bean class="com.baomidou.mybatisplus.plugins.PaginationInterceptor"/>
</list>
</property>
</bean>