package com.reptileclient.jlifeapp.service.emailnotice;

import com.reptileclient.jlifeapp.dao.jz.JzEventHistoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.reptileclient.jlifeapp.dao.region.EtlLogMapper;
import com.reptileclient.jlifeapp.util.email.MailSend;

@Service
public class EmailNoticeService {

//	public static String Z_GANWEI_SQL="运行z_ganwei_sql脚本成功";

	@Autowired
	EtlLogMapper etlLogMapper;

	public String checkETL(String title,String ETLcomment) {
		//统计某个etl中结束的记录值comment,如果不存在，就发送通知
		Integer ct = etlLogMapper.selectTypeCount(ETLcomment);
		if(ct==0) {
			return  "函数没有执行成功，请查看etl_log运行记录";
		}else {
			return"函数运行成功";
		}
	}

	public Boolean checkETL(String ETLcomment) {
		//统计某个etl中结束的记录值comment,如果不存在，就发送通知
		Integer ct = etlLogMapper.selectTypeCount(ETLcomment);
		if(ct==0) {
			return false;
		}

		return true;
	}
}
