package com.eactive.eai.rms.bap.manage.schedule.procPeriod;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

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

@Repository("BapProcPeriodDao")
@SuppressWarnings({"deprecation","unchecked"})
public class BapProcPeriodDao extends SqlMapClientTemplateDao {

	public int selectListCount(HashMap<String, Object> param) throws Exception {
    	return (Integer)template.queryForObject("BapProcPeriod.selectListCount", param);
    }
	
	public int checkCount(HashMap<String, Object> param) throws Exception {
		return (Integer)template.queryForObject("BapProcPeriod.checkCount", param);
	}

	public List<Map<String, Object>> selectList(HashMap<String, Object> param) throws Exception {
    	return (List<Map<String, Object>>)template.queryForList("BapProcPeriod.selectList", param);
    }

	public HashMap<String, Object> selectDetail(String bJobMsgScheId) throws Exception {
		HashMap<String, Object> param = new HashMap<String, Object>();
		param.put("bjobMsgScheID", bJobMsgScheId);
    	return (HashMap<String, Object>)template.queryForObject("BapProcPeriod.selectDetail", param);
    }
	
	public String generatePK(HashMap<String, Object> paramMap ) {
    	try {
            return (String)this.template.queryForObject("BapProcPeriod.generatePK", paramMap);
		} catch (Exception e) {
			logger.error(" error", e); 
			//e.printStackTrace();
		}
		return null;
    }

    public void insert(HashMap<String, Object> paramMap) throws Exception{
        this.template.insert("BapProcPeriod.insert", paramMap);
    }

    public void update(HashMap<String, Object> paramMap) throws Exception{
        this.template.update("BapProcPeriod.update", paramMap);
    }

    public void delete(HashMap<String, Object> paramMap) throws Exception{
        this.template.delete("BapProcPeriod.delete", paramMap);
    }
}