| | |
| | | |
| | | import com.alibaba.druid.pool.DruidDataSource; |
| | | import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder; |
| | | import com.baomidou.mybatisplus.core.config.GlobalConfig; |
| | | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; |
| | | import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean; |
| | | import com.gkhy.safePlatform.equipment.handler.MyMetaObjectHandler; |
| | | import org.apache.ibatis.plugin.Interceptor; |
| | | import org.apache.ibatis.session.SqlSessionFactory; |
| | | import org.mybatis.spring.SqlSessionTemplate; |
| | |
| | | //设置分页插件 |
| | | Interceptor[] plugins = {mybatisPlusInterceptor}; |
| | | factoryBean.setPlugins(plugins); |
| | | |
| | | GlobalConfig globalConfig = new GlobalConfig(); |
| | | globalConfig.setMetaObjectHandler(new MyMetaObjectHandler()); |
| | | factoryBean.setGlobalConfig(globalConfig); |
| | | |
| | | return factoryBean.getObject(); |
| | | } |
| | | |