package com.madeu.dao.web.webtreatmentprocedurearea;

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 jakarta.annotation.PostConstruct;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Repository
public class WebTreatmentProcedureAreaSqlMapDAO extends SqlSessionDaoSupport{

	@Autowired
	private SqlSessionTemplate sqlSessionTemplate;

	@PostConstruct
	void init() {
		setSqlSessionTemplate(sqlSessionTemplate);
	}
	
	/**
	 * 시술 부위 정보 리스트 조회 (List)
	 * 
	 * @param Map
	 * @return
	 * @throws DataAccessException 
	 */
	public List<Map<String, Object>> selectListTreatmentProcedureArea(HashMap<String, Object> paramMap)
			throws DataAccessException {
		logger.debug("WebTreatmentProcedureAreaSqlMapDAO selectListTreatmentProcedureArea START");
		String sqlId = "WebTreatmentProcedureArea.selectListTreatmentProcedureArea";
		logger.debug("WebTreatmentProcedureAreaSqlMapDAO selectListTreatmentProcedureArea END");
		return getSqlSession().selectList(sqlId, paramMap);
	}
	
	/**
	 * 시술 부위 정보 등록
	 * 
	 * @param Map
	 * @return
	 * @throws DataAccessException
	 */
	public int insertTreatmentProcedureArea(HashMap<String, Object> paramMap)
			throws DataAccessException {
		logger.debug("WebTreatmentProcedureAreaSqlMapDAO insertTreatmentProcedureArea START");
		String sqlId = "WebTreatmentProcedureArea.insertTreatmentProcedureArea";
		logger.debug("WebTreatmentProcedureAreaSqlMapDAO insertTreatmentProcedureArea END");
		return getSqlSession().insert(sqlId, paramMap);
	}

	/**
	 * 시술 부위 정보 삭제
	 * 
	 * @param Map
	 * @return
	 * @throws DataAccessException
	 */
	public int deleteTreatmentProcedureArea(HashMap<String, Object> paramMap)
			throws DataAccessException {
		logger.debug("WebTreatmentProcedureAreaSqlMapDAO deleteTreatmentProcedureArea START");
		String sqlId = "WebTreatmentProcedureArea.deleteTreatmentProcedureArea";
		logger.debug("WebTreatmentProcedureAreaSqlMapDAO deleteTreatmentProcedureArea END");
		return getSqlSession().update(sqlId, paramMap);
	}
}
