package com.madeu.dao.web.webtreatmentdiet;

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

    @Autowired
    private SqlSessionTemplate sqlSessionTemplate;

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

    /**
     * 홈페이지 시술예약(다이어트) 정보 총 갯수 조회 (total count)
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public List<Map<String, Object>> selectTotalWebTreatmentDietCount(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentDietSqlMapDAO selectTotalWebTreatmentDietCount START");
        String sqlId = "WebTreatmentDiet.selectTotalWebTreatmentDietCount";
        logger.debug("WebTreatmentDietSqlMapDAO selectTotalWebTreatmentDietCount END");
        return getSqlSession().selectList(sqlId, paramMap);
    }

    /**
     * 홈페이지 시술예약(다이어트) 정보 리스트 조회 (List)
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public List<Map<String, Object>> selectListWebTreatmentDiet(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentDietSqlMapDAO selectListWebTreatmentDiet START");
        String sqlId = "WebTreatmentDiet.selectListWebTreatmentDiet";
        logger.debug("WebTreatmentDietSqlMapDAO selectListWebTreatmentDiet END");
        return getSqlSession().selectList(sqlId, paramMap);
    }

    /**
     * 홈페이지 시술예약(다이어트) 정보 조회
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public List<Map<String, Object>> selectWebTreatmentDiet(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentDietSqlMapDAO selectWebTreatmentDiet START");
        String sqlId = "WebTreatmentDiet.selectWebTreatmentDiet";
        logger.debug("WebTreatmentDietSqlMapDAO selectWebTreatmentDiet END");
        return getSqlSession().selectList(sqlId, paramMap);
    }

    /**
     * 홈페이지 시술예약(다이어트) 정보 등록
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public int insertWebTreatmentDiet(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentDietSqlMapDAO insertWebTreatmentDiet START");
        String sqlId = "WebTreatmentDiet.insertWebTreatmentDiet";
        logger.debug("WebTreatmentDietSqlMapDAO insertWebTreatmentDiet END");
        return getSqlSession().insert(sqlId, paramMap);
    }
    
    /**
     * 홈페이지 시술예약(다이어트) 파일 정보 등록
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public int insertWebTreatmentDietContentFile(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentDietSqlMapDAO insertWebTreatmentDietContentFile START");
        String sqlId = "WebTreatmentDiet.insertWebTreatmentDietContentFile";
        logger.debug("WebTreatmentDietSqlMapDAO insertWebTreatmentDietContentFile END");
        return getSqlSession().insert(sqlId, paramMap);
    }
    
    /**
     * 홈페이지 시술예약(다이어트) 파일 정보 등록
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public int insertWebTreatmentDietThumbnailFile(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentDietSqlMapDAO insertWebTreatmentDietThumbnailFile START");
        String sqlId = "WebTreatmentDiet.insertWebTreatmentDietThumbnailFile";
        logger.debug("WebTreatmentDietSqlMapDAO insertWebTreatmentDietThumbnailFile END");
        return getSqlSession().insert(sqlId, paramMap);
    }
    
    /**
     * 홈페이지 시술예약(다이어트) 시술 정보 등록
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public int insertWebTreatmentListDiet(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentDietSqlMapDAO insertWebTreatmentListDiet START");
        String sqlId = "WebTreatmentDiet.insertWebTreatmentListDiet";
        logger.debug("WebTreatmentDietSqlMapDAO insertWebTreatmentListDiet END");
        return getSqlSession().insert(sqlId, paramMap);
    }
    
    /**
     * 홈페이지 시술예약(다이어트) 시술 정보 수정
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public int updateWebTreatmentListDiet(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentDietSqlMapDAO updateWebTreatmentListDiet START");
        String sqlId = "WebTreatmentDiet.updateWebTreatmentListDiet";
        logger.debug("WebTreatmentDietSqlMapDAO updateWebTreatmentListDiet END");
        return getSqlSession().insert(sqlId, paramMap);
    }

    /**
     * 홈페이지 시술예약(다이어트) 정보 수정
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public int updateWebTreatmentDiet(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentDietSqlMapDAO updateWebTreatmentDiet START");
        String sqlId = "WebTreatmentDiet.updateWebTreatmentDiet";
        logger.debug("WebTreatmentDietSqlMapDAO updateWebTreatmentDiet END");
        return getSqlSession().update(sqlId, paramMap);
    }

    /**
     * 홈페이지 시술예약(다이어트) 정보 삭제
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public int deleteWebTreatmentDiet(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentDietSqlMapDAO deleteWebTreatmentDiet START");
        String sqlId = "WebTreatmentDiet.deleteWebTreatmentDiet";
        logger.debug("WebTreatmentDietSqlMapDAO deleteWebTreatmentDiet END");
        return getSqlSession().update(sqlId, paramMap);
    }
    
    /**
     * 시술 정보 총 갯수 조회 (total count)
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public Integer selectTotalTreatmentCount(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentDietSqlMapDAO selectTotalTreatmentCount START");
        String sqlId = "WebTreatmentDiet.selectTotalTreatmentCount";
        logger.debug("WebTreatmentDietSqlMapDAO selectTotalTreatmentCount END");
        return getSqlSession().selectOne(sqlId, paramMap);
    }
    /**
     * 시술 정보 리스트 조회 (List)
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public List<Map<String, Object>> selectListTreatment(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentDietSqlMapDAO selectListTreatment START");
        String sqlId = "WebTreatmentDiet.selectListTreatment";
        logger.debug("WebTreatmentDietSqlMapDAO selectListTreatment END");
        return getSqlSession().selectList(sqlId, paramMap);
    }
    /**
     * 시술 카테고리 정보 리스트 조회 (List)
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public List<Map<String, Object>> selectWebTreatmentDietCategory(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentDietSqlMapDAO selectWebTreatmentDietCategory START");
        String sqlId = "WebTreatmentDiet.selectListTreatmentCategory";
        logger.debug("WebTreatmentDietSqlMapDAO selectWebTreatmentDietCategory END");
        return getSqlSession().selectList(sqlId, paramMap);
    }
    
    /**
     * 시술 카테고리 정보 시술리스트 조회 (List)
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public List<Map<String, Object>> selectWebTreatmentListDiet(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentDietSqlMapDAO selectWebTreatmentListDiet START");
        String sqlId = "WebTreatmentDiet.selectWebTreatmentListDiet";
        logger.debug("WebTreatmentDietSqlMapDAO selectWebTreatmentListDiet END");
        return getSqlSession().selectList(sqlId, paramMap);
    }
    
}
