package com.meishu.common.schedule; import com.meishu.mapper.StudentMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; @Component public class ChangeStudentStatus { @Autowired private StudentMapper studentMapper; @Scheduled(cron = "0 30 20 * * ?") public void changeStudentStatus(){ System.out.println("========="); studentMapper.changeStudentStatus(); } }