定时创建一张新的历史表
按照每个月的一号来创建历史表,表名后缀是时间,例如:xxxx202010
/**
* 实现一个月更新一次数据
* 按照每个月的一号来创建历史表
*/
@Transactional
@Scheduled(cron = "0 0 0 1 * ?")
public void scheduled() {
if (this.isImplement()) {
if (flag) {
flag = false;
this.insertHistory();
}
}
flag = true;
}