|  |  |  | 
|---|
|  |  |  | package com.dy.rtuMw; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.dy.common.multiDataSource.EnableMultiDataSource; | 
|---|
|  |  |  | import org.mybatis.spring.annotation.MapperScan; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.boot.CommandLineRunner; | 
|---|
|  |  |  | 
|---|
|  |  |  | import org.springframework.context.annotation.ComponentScan; | 
|---|
|  |  |  | import org.springframework.context.annotation.EnableAspectJAutoProxy; | 
|---|
|  |  |  | import org.springframework.context.annotation.FilterType; | 
|---|
|  |  |  | import org.springframework.scheduling.annotation.EnableScheduling; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @EnableScheduling | 
|---|
|  |  |  | @SpringBootApplication | 
|---|
|  |  |  | @EnableAspectJAutoProxy | 
|---|
|  |  |  | //@EnableAspectJAutoProxy(exposeProxy=true)//见https://blog.csdn.net/qq_32590703/article/details/109320381 | 
|---|
|  |  |  | @EnableMultiDataSource | 
|---|
|  |  |  | @ComponentScan(basePackages = {"com.dy.common", "com.dy.pipIrrGlobal", "com.dy.rtuMw"}, | 
|---|
|  |  |  | excludeFilters = {@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = { | 
|---|
|  |  |  | com.dy.common.apiDoc.SpringApiConfig.class | 
|---|
|  |  |  | }) }) | 
|---|
|  |  |  | //@ComponentScan(basePackages = {"com.dy.common", "com.dy.pipIrrGlobal", "com.dy.rtuMw"}) | 
|---|
|  |  |  | excludeFilters = { | 
|---|
|  |  |  | @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = { | 
|---|
|  |  |  | com.dy.common.apiDoc.SpringApiConfig.class | 
|---|
|  |  |  | }), | 
|---|
|  |  |  | @ComponentScan.Filter(type = FilterType.REGEX, pattern = { | 
|---|
|  |  |  | //以下写正则表达式,需要对目标类的完全限定名完全匹配,否则不生效 | 
|---|
|  |  |  | "com.dy.common.multiDataSource..*" | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | @MapperScan(basePackages={"com.dy.pipIrrGlobal"}) | 
|---|
|  |  |  | public class PipIrrMwRtuApplication implements CommandLineRunner { | 
|---|
|  |  |  |  | 
|---|