package com.eactive.eai.rms.onl.statistics.backup.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.eactive.eai.rms.onl.statistics.backup.dao.Tseaist01DAO;
import com.eactive.eai.rms.onl.statistics.backup.vo.Tseaist01VO;

@Service("backupResultService")
public class BackupResultService {
    /**
    * Logger for this class
    */

    @Autowired
    private Tseaist01DAO tseaist01DAO;
    
    
    public void requiresNewInsertBackupResult(String date, String statcJobCyclDstcd, String statcJobStartHMS, String statcJobEndHMS, String sucssYn, String errMsg) {
        Tseaist01VO tseaist01VO = tseaist01DAO.findTseaist01(date, statcJobCyclDstcd);

        if (tseaist01VO != null) {
            tseaist01DAO.updateTseaist01(date, statcJobCyclDstcd,
                statcJobStartHMS, statcJobEndHMS, sucssYn, errMsg);
        } else {
            tseaist01DAO.insertTseaist01(date, statcJobCyclDstcd,
                statcJobStartHMS, statcJobEndHMS, sucssYn, errMsg);
        }
    }

}
