首页>代码>springboot+springmvc+mybatis实现对学生信息的增删改查简单demo>/springboot_springmvc_mybatis/src/main/java/com/ms/config/MyConfig.java
package com.ms.config;

import java.util.Properties;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.github.pagehelper.PageHelper;

@Configuration
public class MyConfig {
	@Bean
    public PageHelper pageHelper(){
		PageHelper pageHelper = new PageHelper();
        Properties properties = new Properties();
        /**默认false,设置为true时,会将RowBounds第一个参数offset当成pageNum页码使用*/
        properties.setProperty("offsetAsPageNum","true");
        /**默认false,设置为true时,使用RowBounds分页会进行count查询 */
        properties.setProperty("rowBoundsWithCount","true");
        /** 禁用合理化时,如果pageNum<1或pageNum>pages会返回空数据 */
        properties.setProperty("reasonable","true");
        /** always总是返回PageInfo类型,check检查返回类型是否为PageInfo,none返回Page */
        properties.setProperty("returnPageInfo","check");
        /** 支持通过Mapper接口参数来传递分页参数 */
        properties.setProperty("supportMethodsArguments","false");
        /**  配置数据库的方言  */
        properties.setProperty("dialect","oracle");
        pageHelper.setProperties(properties);
        return pageHelper;
    }
}
最近下载更多
yeyuuu  LV6 5月20日
李亮  LV19 3月6日
codingwomen  LV9 2022年9月21日
莫回头  LV8 2022年8月31日
cc1061394399  LV1 2022年7月27日
alic44444  LV1 2022年4月12日
Francis132  LV4 2022年1月21日
LJYljyuuuuuuu  LV1 2022年1月6日
zzzpppmmm  LV1 2022年1月5日
543666826  LV33 2021年11月19日
最近浏览更多
星予宝藏666  LV5 5月29日
yeyuuu  LV6 5月20日
gaiung  LV1 5月15日
李亮  LV19 3月6日
wjy1225  LV1 2月9日
LITIANYU084414  LV11 1月1日
大神程序员  LV22 2022年12月26日
qwer123978ca  LV1 2022年12月19日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友