package com.bonus.material.task;

import com.bonus.material.device.mapper.DevInfoMapper;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;

@Component
public class StatisticTask {
    @Resource
    private DevInfoMapper devInfoMapper;

    // 每日凌晨1点，累计上架天数，累计租赁天数
    @Scheduled(cron = "0 30 0 * * ?")
    public void setDevUpLeaseDays() {
        devInfoMapper.updateTotalDevUpDay();
        devInfoMapper.updateTotalDevLeaseDay();
    }
}
