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

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.eactive.eai.rms.common.base.SqlMapClientTemplateDao;
import com.eactive.eai.rms.common.util.CommonUtil;

/**
 * 사용목적 : New Log Daily Backup에서 실행 하는 DAO<br>
 * 사용법 : <br>
 * 작성 날짜 :
 * @author   
 * @version 
 */
@Repository
public class NewLogDailyBackupDAO extends SqlMapClientTemplateDao {
    /**
    * Logger for this class
    */

    @SuppressWarnings("unchecked")
    public void insert(HashMap paramMap) throws Exception {
    	template.insert("NewLogDailyBackup.insert", paramMap);
    }


	public void delete(HashMap paramMap) throws Exception{
		template.delete("NewLogDailyBackup.delete", paramMap);
	}
	
    public BigDecimal selectLogCount(String yyyyMMdd) throws Exception {
        Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("date", yyyyMMdd);
        paramMap.put("tableName", CommonUtil.getLogTable(yyyyMMdd, true));

        return (BigDecimal) this.template.queryForObject("NewLogDailyBackup.selectLogCount", paramMap);
    }
}
