package com.madeu.dao.mobile.mobilekakaotemplate;

import jakarta.annotation.PostConstruct;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Repository;

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

@Repository
public class MobileKakaoTemplateSqlMapDAO extends SqlSessionDaoSupport {

    @Autowired
    private SqlSessionTemplate sqlSessionTemplate;

    @PostConstruct
    void init() {
        setSqlSessionTemplate(sqlSessionTemplate);
    }

    /**
     * 병원 기타설정 데이터 조회(list)
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public List<Map<String, Object>> selectListKakaoTemplateOption(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("MobileKakaoTemplateSqlMapDAO selectListKakaoTemplateOption START");
        String sqlId = "MobileKakaoTemplate.selectListKakaoTemplateOption";
        logger.debug("MobileKakaoTemplateSqlMapDAO selectListKakaoTemplateOption END");
        return getSqlSession().selectList(sqlId, paramMap);
    }
    
    /**
     * 병원 기타설정 데이터 조회(select box)
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public List<Map<String, Object>> selectKakaoTemplate(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("MobileKakaoTemplateSqlMapDAO selectKakaoTemplate START");
        String sqlId = "MobileKakaoTemplate.selectKakaoTemplate";
        logger.debug("MobileKakaoTemplateSqlMapDAO selectKakaoTemplate END");
        return getSqlSession().selectList(sqlId, paramMap);
    }
}
