定时任务@Scheduled使用,以及L关键字无法使用的问题
配置:
1、开启注解调度支持
spring在配置文件中添加 <task:annotation-driven />
<!--开启注解调度支持 @Scheduled -->
<task:annotation-driven />
2、springBoot可以直接在启动类上添加注解 @EnableScheduling
@SpringBootApplication
@EnableScheduling//开启定时任务
@MapperScan("xxx.xxx.mapper")
原创
2020-09-07 16:36:11 ·
2068 阅读 ·
0 评论