@Service
@EnableScheduling //注解开启定时任务功能
public class ChkBillServiceImpl extends ServiceImpl<ChkBillMapper, ChkBill> implements ChkBillService {
@Scheduled(cron = "0 0 0 1 * ?") //每个月票据号归0
@Override
public void eachMonthBillNumToOne() {
sysDeptMapper.eachMonthBillNumToOne();//执行的任务,票据号归零
}
}
定期任务,如每月清理(SpringBoot Mybatis-Plus)
原文:https://www.cnblogs.com/ideaAI/p/14745650.html