package com.madeu.dao.web.webtreatmentpetit;

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

    @Autowired
    private SqlSessionTemplate sqlSessionTemplate;

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

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

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

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

    /**
     * 홈페이지 시술예약(쁘띠) 정보 등록
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public int insertWebTreatmentPetit(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentPetitSqlMapDAO insertWebTreatmentPetit START");
        String sqlId = "WebTreatmentPetit.insertWebTreatmentPetit";
        logger.debug("WebTreatmentPetitSqlMapDAO insertWebTreatmentPetit END");
        return getSqlSession().insert(sqlId, paramMap);
    }

    
    /**
     * 홈페이지 시술예약(쁘띠) 파일 정보 등록
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public int insertWebTreatmentPetitContentFile(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentPetitSqlMapDAO insertWebTreatmentPetitContentFile START");
        String sqlId = "WebTreatmentPetit.insertWebTreatmentPetitContentFile";
        logger.debug("WebTreatmentPetitSqlMapDAO insertWebTreatmentPetitContentFile END");
        return getSqlSession().insert(sqlId, paramMap);
    }
    
    /**
     * 홈페이지 시술예약(쁘띠) 파일 정보 등록
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public int insertWebTreatmentPetitThumbnailFile(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentPetitSqlMapDAO insertWebTreatmentPetitThumbnailFile START");
        String sqlId = "WebTreatmentPetit.insertWebTreatmentPetitThumbnailFile";
        logger.debug("WebTreatmentPetitSqlMapDAO insertWebTreatmentPetitThumbnailFile END");
        return getSqlSession().insert(sqlId, paramMap);
    }
    
    /**
     * 홈페이지 시술예약(쁘띠) 시술 정보 등록
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public int insertWebTreatmentListDiet(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentPetitSqlMapDAO insertWebTreatmentListDiet START");
        String sqlId = "WebTreatmentPetit.insertWebTreatmentListPetit";
        logger.debug("WebTreatmentPetitSqlMapDAO insertWebTreatmentListDiet END");
        return getSqlSession().insert(sqlId, paramMap);
    }
    
    /**
     * 홈페이지 시술예약(쁘띠) 시술 정보 수정
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public int updateWebTreatmentListDiet(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentPetitSqlMapDAO updateWebTreatmentListDiet START");
        String sqlId = "WebTreatmentPetit.updateWebTreatmentListPetit";
        logger.debug("WebTreatmentPetitSqlMapDAO updateWebTreatmentListDiet END");
        return getSqlSession().insert(sqlId, paramMap);
    }
    
    /**
     * 홈페이지 시술예약(쁘띠) 정보 수정
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public int updateWebTreatmentPetit(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentPetitSqlMapDAO updateWebTreatmentPetit START");
        String sqlId = "WebTreatmentPetit.updateWebTreatmentPetit";
        logger.debug("WebTreatmentPetitSqlMapDAO updateWebTreatmentPetit END");
        return getSqlSession().update(sqlId, paramMap);
    }

    /**
     * 홈페이지 시술예약(쁘띠) 정보 삭제
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public int deleteWebTreatmentPetit(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentPetitSqlMapDAO deleteWebTreatmentPetit START");
        String sqlId = "WebTreatmentPetit.deleteWebTreatmentPetit";
        logger.debug("WebTreatmentPetitSqlMapDAO deleteWebTreatmentPetit END");
        return getSqlSession().update(sqlId, paramMap);
    }
    
    /**
     * 시술 정보 총 갯수 조회 (total count)
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public Integer selectTotalTreatmentCount(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentPetitSqlMapDAO selectTotalTreatmentCount START");
        String sqlId = "WebTreatmentPetit.selectTotalTreatmentCount";
        logger.debug("WebTreatmentPetitSqlMapDAO 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("WebTreatmentPetitSqlMapDAO selectListTreatment START");
        String sqlId = "WebTreatmentPetit.selectListTreatment";
        logger.debug("WebTreatmentPetitSqlMapDAO selectListTreatment END");
        return getSqlSession().selectList(sqlId, paramMap);
    }
    /**
     * 시술 카테고리 정보 리스트 조회 (List)
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public List<Map<String, Object>> selectWebTreatmentPetitCategory(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentPetitSqlMapDAO selectWebTreatmentPetitCategory START");
        String sqlId = "WebTreatmentPetit.selectListTreatmentCategory";
        logger.debug("WebTreatmentPetitSqlMapDAO selectWebTreatmentPetitCategory END");
        return getSqlSession().selectList(sqlId, paramMap);
    }
    
    /**
     * 시술 카테고리 정보 시술리스트 조회 (List)
     *
     * @param Map
     * @return
     * @throws DataAccessException
     */
    public List<Map<String, Object>> selectWebTreatmentListPetit(HashMap<String, Object> paramMap)
            throws DataAccessException {
        logger.debug("WebTreatmentPetitSqlMapDAO selectWebTreatmentListPetit START");
        String sqlId = "WebTreatmentPetit.selectWebTreatmentListPetit";
        logger.debug("WebTreatmentPetitSqlMapDAO selectWebTreatmentListPetit END");
        return getSqlSession().selectList(sqlId, paramMap);
    }
    
}
