package com.bb.dao;

import java.util.Map;

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;

@Repository("splusDao")
public class SplusDaoImpl implements SplusDao {
	
	/** 메인DB 연결 */
    @Autowired @Qualifier("sqlSessionMain")
    protected SqlSession sqlSession;
 
    /** 서브DB 연결 */
    @Autowired @Qualifier("sqlSessionSub")
    protected SqlSession sqlSessionSub;
	

	@Override
	public void insertSplus(Map splusBetParam) {
		System.out.print("dsfsdfsdfsdfsdfsdf");
		sqlSession.insert("insertSplus", splusBetParam);
		
	}


	@Override
	public void udpateEvent(Map eventParam) {
		sqlSession.update("udpateEvent", eventParam);
		
	}


	@Override
	public void udpateBet(Map splusBetParam) {
		sqlSession.update("udpateBet", splusBetParam);
		
	}


	@Override
	public void cancelBet(Map splusBetParam) {
		sqlSession.update("udpacancelBeteBet", splusBetParam);
		
	}


	@Override
	public int getReserveCnt(Map trxParam) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getReserveCnt", trxParam);
	}


	@Override
	public int getCommitCnt(Map trxParam) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getCommitCnt", trxParam);
	}


	@Override
	public int getDeReverseCnt(Map trxParam) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getDeReverseCnt", trxParam);
	}


	@Override
	public int getCustomerCnt(Map trxParam) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getCustomerCnt", trxParam);
	}

}
