<!-- 定时任务 -->
<task:annotation-driven/>
<!-- 注入定时任务 -->
<bean id="TimerTaskTest01" class="com.heitian.ssm.util.TimerTaskTest01"></bean>
<task:scheduled-tasks>
<!-- 这里表示的是每隔1分钟执行一次 -->
<task:scheduled ref="TimerTaskTest01" method="run" cron="0 1/1 * * * ? "/>
</task:scheduled-tasks>
public class TimerTaskTest01 {
@Resource
private UWishMapper uWishMapper;
@Resource
private MessageMapper messageMapper;
private Logger log = Logger.getLogger(TimerTaskTest02.class);
public void run(){
//逻辑代码
}
}