package com.madeu.dao.web.webuseroriginalchart;

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

	@Autowired
	private SqlSessionTemplate sqlSessionTemplate;

	@PostConstruct
	void init() {
		setSqlSessionTemplate(sqlSessionTemplate);
	}
	
	/**
	 * 고객 상세 - 고객 상담차트 정보 총 갯수 조회 (total count)
	 * 
	 * @param Map
	 * @return
	 * @throws DataAccessException 
	 */
	public List<Map<String, Object>> selectTotalUserOriginalChartCount(HashMap<String, Object> paramMap)
			throws DataAccessException {
		logger.debug("WebUserOriginalChartSqlMapDAO selectTotalUserOriginalChartCount START");
		String sqlId = "WebUserOriginalChart.selectTotalUserOriginalChartCount";
		logger.debug("WebUserOriginalChartSqlMapDAO selectTotalUserOriginalChartCount END");
		return getSqlSession().selectList(sqlId, paramMap);
	}
	
	/**
	 * 고객 상세 - 고객 상담차트 정보 리스트 조회 (List)
	 * 
	 * @param Map
	 * @return
	 * @throws DataAccessException 
	 */
	public List<Map<String, Object>> selectListUserOriginalChart(HashMap<String, Object> paramMap)
			throws DataAccessException {
		logger.debug("WebUserOriginalChartSqlMapDAO selectListUserOriginalChart START");
		String sqlId = "WebUserOriginalChart.selectListUserOriginalChart";
		logger.debug("WebUserOriginalChartSqlMapDAO selectListUserOriginalChart END");
		return getSqlSession().selectList(sqlId, paramMap);
	}

	/**
	 * 고객 상담차트 정보 조회
	 * 
	 * @param Map
	 * @return
	 * @throws DataAccessException 
	 */
	public List<Map<String, Object>> selectUserOriginalChart(HashMap<String, Object> paramMap)
			throws DataAccessException {
		logger.debug("WebUserOriginalChartSqlMapDAO selectUserOriginalChart START");
		String sqlId = "WebUserOriginalChart.selectUserOriginalChart";
		logger.debug("WebUserOriginalChartSqlMapDAO selectUserOriginalChart END");
		return getSqlSession().selectList(sqlId, paramMap);
	}
}
