https://blog.csdn.net/xybz1993/article/details/80627432关于这个无法拦截的解释 这里解释的很清楚 但有没有解决的办法:有
首先自定义注解 设置为type
拦截用
execution(* com.demo..*..*.dao..*.*(..))")
//获取方法上的注解
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
Method method = signature.getMethod();
TargetDataSource annotation = method.getAnnotation(TargetDataSource.class);
//获取类上的注解
TargetDataSource targetDataSource = method.getDeclaringClass().getAnnotation(TargetDataSource.class)
搞定