| | |
| | | package com.gkhy.safePlatform.config.database; |
| | | |
| | | import com.alibaba.druid.pool.DruidDataSource; |
| | | import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder; |
| | | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; |
| | | import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean; |
| | | import org.apache.ibatis.plugin.Interceptor; |
| | |
| | | @Autowired |
| | | private MybatisPlusInterceptor mybatisPlusInterceptor; |
| | | |
| | | @Bean(name = "dataSourceGoalManage") |
| | | @ConfigurationProperties(prefix = "spring.datasource.goalmanage") |
| | | public DruidDataSource dataSourceGoalManage(){ |
| | | return DruidDataSourceBuilder.create().build(); |
| | | } |
| | | |
| | | @Bean(name = "sqlFactoryGoalManage") |
| | | public SqlSessionFactory sqlSessionFactory(@Qualifier("dataSourceGoalManage") DruidDataSource dataSource) |
| | | public SqlSessionFactory sqlSessionFactory() |
| | | throws Exception |
| | | { |
| | | MybatisSqlSessionFactoryBean factoryBean = new MybatisSqlSessionFactoryBean(); |