package com.bb.dao;

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

import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

import com.bb.model.BlockGameVO;
import com.bb.model.CmnSearch;
import com.bb.model.SiteVendorSkinVO;

@Repository("settingDao")
public class SettingDaoImpl implements SettingDao {

	/** 메인DB 연결 */
    @Autowired @Qualifier("sqlSessionMain")
    protected SqlSession sqlSession;
 
    /** 서브DB 연결 */
    @Autowired @Qualifier("sqlSessionSub")
    protected SqlSession sqlSessionSub;
    
    
	@Override
	public List<HashMap<String, Object>> getSettingVendorList(CmnSearch search) {
		// TODO Auto-generated method stub
		return sqlSessionSub.selectList("getSettingVendorList", search);
	}


	@Override
	public List<HashMap<String, Object>> getSettingSkinList(CmnSearch search) {
		// TODO Auto-generated method stub
		return sqlSessionSub.selectList("getSettingSkinList", search);
	}


	@Override
	public int settingVendorSkinSave(SiteVendorSkinVO item) {
		// TODO Auto-generated method stub
		return sqlSession.update("settingVendorSkinSave", item);
	}


	@Override
	public String getWhiteIpListStr(CmnSearch search) {
		// TODO Auto-generated method stub
		return sqlSessionSub.selectOne("getWhiteIpListStr", search);
	}


	@Override
	public List<HashMap<String, Object>> getBlockVendorSelectBoxList(String category) {
		// TODO Auto-generated method stub
		return sqlSessionSub.selectList("getBlockVendorSelectBoxList", category);
	}


	@Override
	public List<HashMap<String, Object>> getBlockVendorSelectBoxList2(CmnSearch search) {
		// TODO Auto-generated method stub
		return sqlSessionSub.selectList("getBlockVendorSelectBoxList2", search);
	}


	@Override
	public List<HashMap<String, Object>> getBlockTableSelectBoxList(CmnSearch search) {
		// TODO Auto-generated method stub
		return sqlSessionSub.selectList("getBlockTableSelectBoxList", search);
	}


	@Override
	public String getBlockTableIds(CmnSearch search) {
		// TODO Auto-generated method stub
		return sqlSessionSub.selectOne("getBlockTableIds", search);
	}


	@Override
	public int blockTableIdSave(BlockGameVO blockGameVO) {
		// TODO Auto-generated method stub
		return sqlSession.update("blockTableIdSave", blockGameVO);
	}


	@Override
	public String getVendorTitle(CmnSearch search) {
		// TODO Auto-generated method stub
		return sqlSessionSub.selectOne("getVendorTitle", search);
	}


	@Override
	public HashMap<String, String> getBetRadarApiInfo(String siteId) {
		// TODO Auto-generated method stub
		return sqlSessionSub.selectOne("getBetRadarApiInfo", siteId);
	}
    
    
}
