全局上下文工具类配置
13 | * 14 | * @description : 解决静态方法中mapper的调用 15 | */ 16 | @Slf4j 17 | public class ApplicationContextUtil { 18 | 19 | private static ApplicationContext applicationContext; 20 | 21 | public static void setApplicationContext(ApplicationContext ac) 22 | throws BeansException { 23 | applicationContext = ac; 24 | } 25 | 26 | public static ApplicationContext getApplicationContext() { 27 | return applicationContext; 28 | } 29 | 30 | /** 31 | * 根据Class类型在IOC容器中获取对象 32 | * @param clazz Class类型 33 | * @return 对象 34 | */ 35 | public static