springboot 多数据源

如上是定义了两个数据源

然后在main方法所在类加上此注解

 

复制代码
@MyBadisLoader({"saas = com.llc.admin.web.dao.saas = classpath:mapper/*xml" , 
                "saas2 = com.llc.admin.web.dao.saas2 = classpath:mapper/*.xml,classpath:mapper/user/*.xml"})
@SpringBootApplication
public class WebApplication {

    public static void main(String[] args) {
        SpringApplication.run(WebApplication.class,args);
    }
}

posted on 2018-04-20 16:45  superficial。  阅读(504)  评论(0编辑  收藏  举报

导航