• 引入依赖
<dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>pagehelper</artifactId>
    <version>5.1.10</version>
</dependency>
  • 配置
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
    <property name="dataSource" ref="dataSource" />
    <property name="plugins">
        <array>
            <bean class="com.github.pagehelper.PageInterceptor">
                <property name="properties">
                    <props>
                        <prop key="helperDialect">oracle</prop>
                        <prop key="reasonable">true</prop>

                    </props>
                </property>
            </bean>
        </array>
    </property>
</bean>
  • 使用
@Override
public List<Order> findAll() {
    PageHelper.startPage(1,5);
    return orderDao.findAll();
}

results matching " "

No results matching " "

results matching " "

No results matching " "