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

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.eactive.eai.rms.common.base.SqlMapClientTemplateDao;
import com.eactive.eai.rms.onl.statistics.eaisvcname.vo.StatisticsForm;
import com.eactive.eai.rms.onl.statistics.intfacptrncd.vo.IntfacPtrnCdYearlyVO;
import com.ibatis.sqlmap.client.event.RowHandler;

/**
 * <pre>
 * 1. 기능 : 
 * 2. 처리 개요 : 
 *     - 
 * 3. 주의사항 : 
 * </pre>
 * @author  : music75
 * @version : $Revision: 1.1 $
 * @since : rts 1.0
 * @spring.bean id="intfacPtrnCdYearlyDAO"
 * @spring.property name="dataSource" ref="dataSource"
 */
@Repository("intfacPtrnCdYearlyDAO")
public class IntfacPtrnCdYearlyDAOImpl
        extends SqlMapClientTemplateDao
        implements IntfacPtrnCdYearlyDAO {

    /**
     * <pre>
     * 1. 기능 : 인터페이스별 유형별 년간 통계 리스트 조회
     * 2. 처리 개요 : 
     *     - 
     * 3. 주의사항 : Overriden 
     * </pre>
     * @author  : music75
     * @version : $Revision: 1.1 $
     * @since : rts 1.0
     * @see com.eactive.eai.rts.biz.statistics.eaisvcname.dao.IntfacPtrnCdYearlyDAO#findByIntfacPtrnCdYearly(com.eactive.eai.rts.biz.statistics.eaisvcname.vo.StatisticsForm)
     * @param statisticsForm
     * @return
     */
    public List findByIntfacPtrnCdYearly(StatisticsForm statisticsForm) throws Exception {
        final ArrayList<IntfacPtrnCdYearlyVO> al = new ArrayList<IntfacPtrnCdYearlyVO>();

        final HashMap<String, String> paramMap = new HashMap<String, String>();
        paramMap.put("intfacPtrnCd", statisticsForm.getIntfacPtrnCd());
        template.queryWithRowHandler("IntfacPtrnCdYearly.findByIntfacPtrnCdYearly", paramMap,
    			new RowHandler(){
            		@SuppressWarnings("unchecked")
                    public void handleRow(Object valueObject) {
            			IntfacPtrnCdYearlyVO vo = (IntfacPtrnCdYearlyVO)valueObject;
                        al.add(vo);
        }});
        return al;
    }

    public List findByIntfacPtrnCdYearlyObject2_1(StatisticsForm statisticsForm) throws Exception {
        final ArrayList<IntfacPtrnCdYearlyVO> al = new ArrayList<IntfacPtrnCdYearlyVO>();

        final HashMap<String, String> paramMap = new HashMap<String, String>();
        paramMap.put("intfacPtrnCd", statisticsForm.getIntfacPtrnCd());
        paramMap.put("startDate", statisticsForm.getStartDate());
        template.queryWithRowHandler("IntfacPtrnCdYearly.findByIntfacPtrnCdYearlyObject2_1", paramMap,
    			new RowHandler(){
            		@SuppressWarnings("unchecked")
                    public void handleRow(Object valueObject) {
            			IntfacPtrnCdYearlyVO vo = (IntfacPtrnCdYearlyVO)valueObject;
                        al.add(vo);
        }});
        return al;
    }

    public List findByIntfacPtrnCdYearlyObject2_2(StatisticsForm statisticsForm) throws Exception {
        final ArrayList<IntfacPtrnCdYearlyVO> al = new ArrayList<IntfacPtrnCdYearlyVO>();

        final HashMap<String, String> paramMap = new HashMap<String, String>();
        paramMap.put("intfacPtrnCd", statisticsForm.getIntfacPtrnCd());
        paramMap.put("startDate", statisticsForm.getStartDate());
        template.queryWithRowHandler("IntfacPtrnCdYearly.findByIntfacPtrnCdYearlyObject2_2", paramMap,
    			new RowHandler(){
            		@SuppressWarnings("unchecked")
                    public void handleRow(Object valueObject) {
            			IntfacPtrnCdYearlyVO vo = (IntfacPtrnCdYearlyVO)valueObject;
                        al.add(vo);
        }});
        return al;
    }
}
