package com.madeu.dao.mobile.mobilehospital;

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 MobileHospitalSqlMapDAO extends SqlSessionDaoSupport{

	@Autowired
	private SqlSessionTemplate sqlSessionTemplate;

	@PostConstruct
	void init() {
		setSqlSessionTemplate(sqlSessionTemplate);
	}
	
	/**
	 * 병원 운영시간 조회
	 * 
	 * @param Map
	 * @return
	 * @throws DataAccessException 
	 */
	public List<Map<String, Object>> selectHospitalWorkTime(HashMap<String, Object> paramMap)
			throws DataAccessException {
		logger.debug("MobileHospitalSqlMapDAO selectHospitalWorkTime START");
		String sqlId = "MobileHospital.selectHospitalWorkTime";
		logger.debug("MobileHospitalSqlMapDAO selectHospitalWorkTime END");
		return getSqlSession().selectList(sqlId, paramMap);
	}

	/**
	 * 병원 휴일 조회
	 *
	 * @param Map
	 * @return
	 * @throws DataAccessException
	 */
	public List<Map<String, Object>> selectHospitalHoliday(HashMap<String, Object> paramMap)
			throws DataAccessException {
		logger.debug("MobileHospitalSqlMapDAO selectHospitalHoliday START");
		String sqlId = "MobileHospital.selectHospitalHoliday";
		logger.debug("MobileHospitalSqlMapDAO selectHospitalHoliday END");
		return getSqlSession().selectList(sqlId, paramMap);
	}
}
