package com.yeejoin.amos.boot.module.jxiop.biz.scheduled;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic;
import com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESWindSpeed;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.TemporaryData;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.TemporaryDataMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.repository.ESWindSpeedRepository;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import java.util.ArrayList;
import java.util.List;

@EnableScheduling
public class WindSpeedScheduled {



    @Autowired
    TemporaryDataMapper temporaryDataMapper;
    @Autowired
    ESWindSpeedRepository esWindSpeedRepository;

    @Scheduled(cron="${windSpeed.cron}")
    private void initData(){
        esWindSpeedRepository.saveAll(temporaryDataMapper.getAllData());
    }


}
