|
|
@ -5,6 +5,7 @@ import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.ibatis.session.SqlSessionFactory; |
|
|
|
import org.mybatis.spring.SqlSessionFactoryBean; |
|
|
|
import org.mybatis.spring.SqlSessionTemplate; |
|
|
|
import org.mybatis.spring.annotation.MapperScan; |
|
|
|
import org.springframework.beans.factory.annotation.Qualifier; |
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties; |
|
|
|
import org.springframework.boot.jdbc.DataSourceBuilder; |
|
|
@ -16,6 +17,10 @@ import javax.sql.DataSource; |
|
|
|
|
|
|
|
@Slf4j |
|
|
|
@Configuration |
|
|
|
@MapperScan( |
|
|
|
basePackages = "com.example.demo.mapper.bean", // 扫描coin包 |
|
|
|
sqlSessionTemplateRef = "mysql2SqlSessionTemplate" |
|
|
|
) |
|
|
|
public class Mysql2DataSourceConfig { |
|
|
|
|
|
|
|
@Bean(name = "mysql2DataSource") |
|
|
|