package com.eactive.eai.rms.onl.statistics.stndmsguseyn.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.stndmsguseyn.vo.StndMsgUseYnYearlyVO;
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="stndMsgUseYnYearlyDAO"
 * @spring.property name="dataSource" ref="dataSource"
 */
@Repository("stndMsgUseYnYearlyDAO")
public class StndMsgUseYnYearlyDAOImpl
        extends SqlMapClientTemplateDao
        implements StndMsgUseYnYearlyDAO {

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

        final HashMap<String, String> paramMap = new HashMap<String, String>();
        paramMap.put("stndMsgUseYn", statisticsForm.getStndMsgUseYn());
        template.queryWithRowHandler("StndMsgUseYnYearly.findByStndMsgUseYnYearly", paramMap,
    			new RowHandler(){
            		@SuppressWarnings("unchecked")
                    public void handleRow(Object valueObject) {
            			StndMsgUseYnYearlyVO vo = (StndMsgUseYnYearlyVO)valueObject;
                        al.add(vo);
        }});
        return al;
    }

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

        final HashMap<String, String> paramMap = new HashMap<String, String>();
        paramMap.put("startDate",  statisticsForm.getStartDate());
        paramMap.put("stndMsgUseYn", statisticsForm.getStndMsgUseYn());
        template.queryWithRowHandler("StndMsgUseYnYearly.findByStndMsgUseYnYearlyObject2_1", paramMap,
    			new RowHandler(){
            		@SuppressWarnings("unchecked")
                    public void handleRow(Object valueObject) {
            			StndMsgUseYnYearlyVO vo = (StndMsgUseYnYearlyVO)valueObject;
                        al.add(vo);
        }});
        return al;
    }

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

        final HashMap<String, String> paramMap = new HashMap<String, String>();
        paramMap.put("startDate",  statisticsForm.getStartDate());
        paramMap.put("stndMsgUseYn", statisticsForm.getStndMsgUseYn());
        template.queryWithRowHandler("StndMsgUseYnYearly.findByStndMsgUseYnYearlyObject2_2", paramMap,
    			new RowHandler(){
            		@SuppressWarnings("unchecked")
                    public void handleRow(Object valueObject) {
            			StndMsgUseYnYearlyVO vo = (StndMsgUseYnYearlyVO)valueObject;
                        al.add(vo);
        }});
        return al;
    }
}
