package com;



import com.gyee.alarm.AlarmWeb;
import com.gyee.alarm.model.auto.ProEconAlarmRule;
import com.gyee.alarm.service.AlarmRuleService;
import com.gyee.alarm.util.SpringUtils;
import com.gyee.common.util.DateUtils;

import org.junit.runner.RunWith;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.util.Calendar;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;


/**
 * OpenCSV CSVReader Example, Read line by line
 *
 * @author pankaj
 *
 */
@SpringBootTest
@RunWith(SpringRunner.class)
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
public class AlarmTest {

    public static void main(String[] args) throws Exception {
        SpringApplication.run(AlarmWeb.class, args);
        AlarmRuleService alarmRuleService= SpringUtils.getBean("alarmRuleService");






        //
        System.out.println("故障转换率记录调度程序执行开始!。。。。。。");
        ProEconAlarmRule alarm= alarmRuleService.selectByAlertruleId("1");
        alarm.setUniformCode("test11");
        alarmRuleService.saveAndUpdateAlertrule(alarm);

        alarmRuleService.saveAndUpdateAlertrule(new ProEconAlarmRule());


        alarmRuleService.deleteAlertrule("1139571619573145600");
        System.out.println("故障转换率记录调度程序执行结束!。。。。。。");

    }
}
