package com.madeu.dao.mobile.mobiletreatmentprocedure;

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

	@Autowired
	private SqlSessionTemplate sqlSessionTemplate;

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

	/**
	 * 진료 시술 정보 총 갯수 조회 (total count, option)
	 * 
	 * @param Map
	 * @return
	 * @throws DataAccessException 
	 */
	public List<Map<String, Object>> selectTotalTreatmentProcedureOptionCount(HashMap<String, Object> paramMap)
			throws DataAccessException {
		logger.debug("MobileTreatmentProcedureSqlMapDAO selectTotalTreatmentProcedureOptionCount START");
		String sqlId = "MobileTreatmentProcedure.selectTotalTreatmentProcedureOptionCount";
		logger.debug("MobileTreatmentProcedureSqlMapDAO selectTotalTreatmentProcedureOptionCount END");
		return getSqlSession().selectList(sqlId, paramMap);
	}

	/**
	 * 진료 시술 조회 (List, option)
	 *
	 * @param Map
	 * @return
	 * @throws DataAccessException
	 */
	public List<Map<String, Object>> selectListTreatmentProcedureOption(HashMap<String, Object> paramMap)
			throws DataAccessException {
		logger.debug("MobileTreatmentProcedureSqlMapDAO selectListTreatmentProcedureOption START");
		String sqlId = "MobileTreatmentProcedure.selectListTreatmentProcedureOption";
		logger.debug("MobileTreatmentProcedureSqlMapDAO selectListTreatmentProcedureOption END");
		return getSqlSession().selectList(sqlId, paramMap);
	}
}
