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.BetParam;
import com.bb.model.NexusTrplVO;
import com.bb.model.TransSearchVO;

@Repository("transDao")
public class TransDaoImpl implements TransDao {

	/** 메인DB 연결 */
    @Autowired @Qualifier("sqlSessionMain")
    protected SqlSession sqlSession;
 
    /** 서브DB 연결 */
    @Autowired @Qualifier("sqlSessionSub")
    protected SqlSession sqlSessionSub;

	@Override
	public int getTransBetListCnt(TransSearchVO search) {
		// TODO Auto-generated method stub
		return sqlSessionSub.selectOne("getTransBetListCnt", search);
	}

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

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

	@Override
	public int getTransBetFastListCnt(TransSearchVO search) {
		// TODO Auto-generated method stub
		return sqlSessionSub.selectOne("getTransBetFastListCnt", search);
	}

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

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

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

	@Override
	public HashMap getBetInfoByBetId(BetParam param) {
		// TODO Auto-generated method stub
		return sqlSessionSub.selectOne("getBetInfoByBetId", param);
	}

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

	@Override
	public HashMap getSiteBetByRefIdFromOld(BetParam param) {
		// TODO Auto-generated method stub
		return sqlSessionSub.selectOne("getSiteBetByRefIdFromOld", param);
	}

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

	@Override
	public int deleteEvoDetailNull(HashMap detailMap) {
		// TODO Auto-generated method stub
		return sqlSession.delete("deleteEvoDetailNull", detailMap);
	}

}
