package com.madeu.dao.web.webdevice;

import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Slf4j
@Repository
public class WebDeviceSqlMapDAO extends SqlSessionDaoSupport {
    @Autowired
    private SqlSessionTemplate sqlSessionTemplate;

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

    /**
     * 디바이스 정보 리스트 조회 (List)
     *
     * @param Map
     * @return
     * @throws Exception
     */
    public List<Map<String, Object>> selectListDevice(HashMap<String, Object> paramMap)
            throws Exception {
        log.debug("WebDeviceSqlMapDAO selectListDevice START");
        String sqlId = "WebDevice.selectListDevice";
        log.debug("WebDeviceSqlMapDAO selectListDevice END");
        return getSqlSession().selectList(sqlId, paramMap);
    }

    /**
     * 디바이스 정보 리스트 조회 (List)
     *
     * @param Map
     * @return
     * @throws Exception
     */
    public List<Map<String, Object>> selectListDevice2(HashMap<String, Object> paramMap)
            throws Exception {
        log.debug("WebDeviceSqlMapDAO selectListDevice2 START");
        String sqlId = "WebDevice.selectListDevice2";
        log.debug("WebDeviceSqlMapDAO selectListDevice2 END");
        return getSqlSession().selectList(sqlId, paramMap);
    }
}
