//package com.yeejoin.equipmanage.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.transaction.annotation.EnableTransactionManagement;
//
//import com.baomidou.mybatisplus.autoconfigure.ConfigurationCustomizer;
//import com.baomidou.mybatisplus.core.MybatisConfiguration;
//import com.baomidou.mybatisplus.core.config.GlobalConfig;
//import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
//import com.yeejoin.amos.boot.biz.config.MetaHandler;
//
///**
// * @description: 分页插件
// * @author: duanwei
// * @create: 2020-06-30 13:57
// **/
//@EnableTransactionManagement
//@Configuration
//public class MybatisPlusConfig {
////	
////	 @Value("${mybatis.mapper-locations}")
////	 private String mapperLocations;
//    /**
//     * plus分页插件支持
//     */
//    @Bean
//    public PaginationInterceptor paginationInterceptor() {
//        PaginationInterceptor page = new PaginationInterceptor();
//        //设置方言类型
//        page.setDialectType("mysql");
//        //不限制
//        page.setLimit(-1);
//        return page;
//    }
//
//    /**
//     * pageHelper插件支持
//     *
//     * @return
//     */
//    @Bean
//    ConfigurationCustomizer mybatisConfigurationCustomizer() {
//        return new ConfigurationCustomizer() {
//            @Override
//            public void customize(MybatisConfiguration configuration) {
//                configuration.addInterceptor(new com.github.pagehelper.PageInterceptor());
//            }
//        };
//    }
//
//    /**
//     * mp参数切面
//     *
//     * @return
//     */
//    @Bean
//    public GlobalConfig globalConfig() {
//        GlobalConfig globalConfig = new GlobalConfig();
//        globalConfig.setMetaObjectHandler(new MetaHandler());
//        return globalConfig;
//    }
//
////    @Bean
////    public SqlSessionFactoryBean configSqlSessionFactoryBean(DataSource dataSource) throws IOException {
////        SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
////        org.apache.ibatis.session.Configuration configuration = new org.apache.ibatis.session.Configuration();
////        configuration.setMapUnderscoreToCamelCase(true);// 开启驼峰命名
////        configuration.setCallSettersOnNulls(true);// 开启在属性为null也调用setter方法
////
////        sqlSessionFactoryBean.setConfiguration(configuration);
////        sqlSessionFactoryBean.setDataSource(dataSource);
////        ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
////        sqlSessionFactoryBean.setMapperLocations(resolver.getResources(mapperLocations));
////        return sqlSessionFactoryBean;
////    }
//
//}
