package test;

import com.github.pagehelper.PageInfo;
import com.gyee.SpringbootStart;
import com.gyee.frame.common.domain.AjaxResult;
import com.gyee.frame.common.spring.SpringUtils;
import com.gyee.frame.controller.benchmarking.BenchmarkingController;
import com.gyee.frame.model.auto.Windturbineinfodaytop2;
import com.gyee.frame.model.custom.Tablepar;
import lombok.SneakyThrows;
import org.springframework.boot.SpringApplication;

import java.util.Calendar;
import java.util.Date;

public class BenchmarkingTest {

    @SneakyThrows
    public static void main(String[] args) {

        SpringApplication.run(SpringbootStart.class, args);


        Calendar c = Calendar.getInstance();

        c.set(Calendar.HOUR_OF_DAY, 0);
        c.set(Calendar.MINUTE, 0);
        c.set(Calendar.SECOND, 0);

        c.set(Calendar.DAY_OF_MONTH,1);
        c.set(Calendar.MONTH,0);
        c.set(Calendar.YEAR,2021);

        Date beginDate = c.getTime();

        String wpid="MHS_FDC";

//        Windturbineinfodaytop3Service windturbineinfodaytop3Service= SpringUtils.getBean("windturbineinfodaytop3Service");

        BenchmarkingController benchmarkingController= SpringUtils.getBean("benchmarkingController");
//
//        AjaxResult ajaxResult = dayBenchmarkingController.gadaylist(wpid,"2021-01-01");
//
//        List<Windturbineinfodaytop3> test=(List<Windturbineinfodaytop3>)ajaxResult.get("data");

        Tablepar tablepar=new Tablepar();
        tablepar.setPageNum(1);
        tablepar.setPageSize(10);

        AjaxResult ajax = benchmarkingController.gadaylistByPage(tablepar,wpid,"2021-01-01");

        PageInfo<Windturbineinfodaytop2> test=(PageInfo<Windturbineinfodaytop2>)ajax.get("data");
        for(Windturbineinfodaytop2 wtd:test.getList())
        {
            System.out.println(wtd.getWindturbineid()+"----------------"+wtd.getDayfdl());
        }
        //System.out.println(test);
    }




}
