首页>代码>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;
    }
}
最近下载更多
13940562934  LV22 2023年9月27日
1379585889  LV11 2023年6月2日
yeyuuu  LV6 2023年5月20日
李亮  LV19 2023年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日
最近浏览更多
ma406805131  LV15 6月28日
暂无贡献等级
颜菜菜  LV2 6月19日
17380184110 6月18日
暂无贡献等级
yuanyuan23  LV1 5月30日
WBelong  LV7 4月2日
taoshen95  LV15 2023年12月25日
wwwww816  LV5 2023年12月19日
xiao小果  LV12 2023年12月13日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友