package com.bb.dao;

import java.util.HashMap;
import java.util.List;
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.security.core.Authentication;
import org.springframework.stereotype.Repository;

import com.bb.model.BalanceParam;
import com.bb.model.BetParam;
import com.bb.model.BoardSearch;
import com.bb.model.CashParam;
import com.bb.model.CommonParam;
import com.bb.model.Game;
import com.bb.model.Member;
import com.bb.model.OTPInfo;
import com.bb.model.Site;
import com.bb.model.SitePwdVO;
import com.bb.model.SiteSearch;
import com.bb.model.TrfApiInfo;
import com.bb.model.UserSearch;
import com.bb.model.Vendor;
import com.bb.model.VendorChangeBalanceLogVo;

@Repository("siteDao")
public class SiteDaoImpl implements SiteDao  {

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

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

	@Override
	public Site getSiteInfo(String authorization) {
		return sqlSession.selectOne("getSiteInfo", authorization);
	}

	@Override
	public Site getSiteInfoAPI(String authorization) {
		return sqlSession.selectOne("getSiteInfoAPI", authorization);
	}

	@Override
	public Member getMember(CommonParam commonParam) {
		return sqlSession.selectOne("getMember", commonParam);
	}

	@Override
	public Member getMember2(CashParam param) {
		return sqlSession.selectOne("getMember2", param);
	}

	@Override
	public void insertMember(CommonParam commonParam) {
		sqlSession.insert("insertMember", commonParam);

	}

	@Override
	public HashMap getVenderApiInfo(CommonParam commonParam) {
		return sqlSession.selectOne("getVenderApiInfo", commonParam);
	}


	@Override
	public List<HashMap> getCbList() {
		// TODO Auto-generated method stub
		return sqlSession.selectList("getCbList", null);
	}

	@Override
	public void updateCbApi(HashMap upParam) {
		// TODO Auto-generated method stub
		 sqlSession.update("updateCbApi", upParam);
	}

	@Override
	public HashMap getSiteApiInfo(HashMap sParam) {
		return sqlSessionSub.selectOne("getSiteApiInfo", sParam);
	}

	@Override
	public HashMap getSiteApiInfo2(HashMap sParam) {
		return sqlSessionSub.selectOne("getSiteApiInfo2", sParam);
	}

	@Override
	public int commonBetinsert(HashMap tranParam) {
		// TODO Auto-generated method stub
		 return sqlSession.update("commonBetinsert", tranParam);
	}

	@Override
	public int commonBetinsert2(HashMap tranParam) {
		// TODO Auto-generated method stub
		 return sqlSession.update("commonBetinsert2", tranParam);
	}

	@Override
	public Site getSiteLogin(Authentication authentication) {
		return sqlSession.selectOne("getSiteLogin", authentication);
	}

	@Override
	public Site getSiteLoginApi(Map site) {
		return sqlSessionSub.selectOne("getSiteLoginApi", site);
	}

	@Override
	public Site getGuestLogin() {
		return sqlSession.selectOne("getGuestLogin");
	}

	@Override
	public int getSiteListCnt(SiteSearch search) {
		return sqlSession.selectOne("getSiteListCnt", search);
	}

	@Override
	public List<HashMap> getSiteList(SiteSearch search) {
		return sqlSession.selectList("getSiteList", search);
	}

	@Override
	public void addProc(Site site) {
		sqlSession.insert("addProc",site );
	}

	@Override
	public void addCreditInfo(Site site) {
		sqlSession.insert("addCreditInfo",site );
	}

	@Override
	public void addsiteFlow(Site site) {
		sqlSession.insert("addsiteFlow",site );
	}

	@Override
	public void insertVendors(Site site) {
		sqlSession.insert("insertVendors",site );

	}

	@Override
	public Site getSiteInfoMypage(Site site) {
		return sqlSession.selectOne("getSiteInfoMypage", site);
	}

	@Override
	public long getSiteCredit(String siteId) {
		return sqlSession.selectOne("getSiteCredit", siteId);
	}

	@Override
	public long getUnderSiteCredit(String siteId) {
		return sqlSession.selectOne("getUnderSiteCredit", siteId);
	}

	@Override
	public long getSitePoint(String siteId) {
		return sqlSessionSub.selectOne("getSitePoint", siteId);
	}

	@Override
	public void addPointInfo(Site site) {
		// TODO Auto-generated method stub
		sqlSession.insert("addPointInfo",site );
	}

	@Override
	public HashMap getCreditWait(int siteIdx) {
		return sqlSession.selectOne("getCreditWait", siteIdx);
	}

	@Override
	public int getSiteUserListCnt(SiteSearch search) {
		return sqlSession.selectOne("getSiteUserListCnt", search);
	}

	@Override
	public List<HashMap> getSiteUserList(SiteSearch search) {
		return sqlSession.selectList("getSiteUserList", search);
	}

	@Override
	public int getTranCheck(String tranId) {
		return sqlSession.selectOne("getTranCheck", tranId);
	}

	@Override
	public void insertError(HashMap eParam) {
		sqlSession.insert("insertError",eParam );

	}

	@Override
	public int getFinalErr(String betId) {
		return sqlSession.selectOne("getFinalErr", betId);
	}

	@Override
	public void updateSid(Member member) {
		sqlSession.update("updateSid",member );

	}

	@Override
	public long getInsureAmt(String siteId) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getInsureAmt", siteId);
	}

	@Override
	public long getInsurePointAmt(String siteId) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getInsurePointAmt", siteId);
	}

	@Override
	public void insertinsurance(Site site) {
		// TODO Auto-generated method stub
		 sqlSession.insert("insertinsurance", site);
	}

	@Override
	public void insertinsurancePoint(Site site) {
		// TODO Auto-generated method stub
		 sqlSession.insert("insertinsurancePoint", site);
	}

	@Override
	public List<HashMap> getVenderRateList(Site loginSite) {
		// TODO Auto-generated method stub
		return sqlSession.selectList("getVenderRateList", loginSite);
	}

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

	@Override
	public void updateBombKey(Member member) {
		// TODO Auto-generated method stub
		 sqlSession.update("updateBombKey", member);
	}

	@Override
	public Member getMemByBombAccId(HashMap memParam) {
		return sqlSession.selectOne("getMemByBombAccId", memParam);
	}


	@Override
	public void insertBetDetail(Map detailMap) {
		// TODO Auto-generated method stub
		sqlSession.insert("insertBetDetail", detailMap);
	}

	@Override
	public String getBetInfo(BetParam param) {
		// TODO Auto-generated method stub
		sqlSession.update("updateVariable", "SET @@group_concat_max_len = 50240");
		return sqlSession.selectOne("getBetInfo", param);

	}

	@Override
	public List<HashMap> getSiteFlow(Site loginSite) {
		// TODO Auto-generated method stub
		return sqlSession.selectList("getSiteFlow", loginSite);

	}

	@Override
	public void saveVendorRate(HashMap paramMap) {
		// TODO Auto-generated method stub
		sqlSession.insert("saveVendorRate", paramMap);
	}

	@Override
	public HashMap getEvoApiInfo() {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getEvoApiInfo", null);
	}

	@Override
	public String getSiteIdByRefId(String refId) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getSiteIdByRefId", refId);
	}

	@Override
	public void updateDetailLastTime(HashMap evoInfo) {
		// TODO Auto-generated method stub
		//System.out.print("endDate " + evoInfo.get("endDate"));
		sqlSession.insert("updateDetailLastTime", evoInfo);
	}

	@Override
	public Site getSiteDetail(SiteSearch search) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getSiteDetail", search);
	}

	@Override
	public Site getSiteSimpleDetail(SiteSearch search) {
		// TODO Auto-generated method stub
		return sqlSessionSub.selectOne("getSiteSimpleDetail", search);
	}

	@Override
	public HashMap getVenderApiInfoByToken(Map paramV) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getVenderApiInfoByToken", paramV);
	}

	@Override
	public Site getSiteBypassword(Map siteParam) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getSiteBypassword", siteParam);
	}

	@Override
	public void updatePass(Map siteParam) {
		sqlSession.update("updatePass", siteParam);

	}

	@Override
	public void siteUpdate(Site site) {
		sqlSession.update("siteUpdate", site);

	}

	@Override
	public void saveVendorInsurePointRate(HashMap paramMap) {
		// TODO Auto-generated method stub
		sqlSession.insert("saveVendorInsurePointRate", paramMap);
	}

	@Override
	public HashMap getDashInfo(Site loginSite) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getDashInfo", loginSite);
	}

	@Override
	public HashMap getDashInfo2(Site loginSite) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getDashInfo2", loginSite);
	}

	@Override
	public void insertVendorsRate(Site site) {
		// TODO Auto-generated method stub
		sqlSession.insert("insertVendorsRate", site);
	}

	@Override
	public HashMap getMicroApiInfo() {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getMicroApiInfo", null);
	}

	@Override
	public int getApiStatus(HashMap tranParam) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getApiStatus", tranParam);
	}

	@Override
	public void saveVendorInsureRate(HashMap paramMap) {
		// TODO Auto-generated method stub
		sqlSession.insert("saveVendorInsureRate", paramMap);
	}

	@Override
	public void updateVendorUseYn(HashMap paramMap) {
		// TODO Auto-generated method stub
		sqlSession.update("updateVendorUseYn", paramMap);
	}

	@Override
	public List<HashMap> getSiteVendorList(SiteSearch search) {
		// TODO Auto-generated method stub
		return sqlSession.selectList("getSiteVendorList", search);
	}

	@Override
	public List<HashMap> getVendorList(SiteSearch search) {
		// TODO Auto-generated method stub
		return sqlSession.selectList("getVendorList", search);
	}

	@Override
	public void siteVenderUpdate(Vendor vendor) {
		// TODO Auto-generated method stub
		sqlSession.update("siteVenderUpdate", vendor);
	}

	@Override
	public HashMap getDowinApiInfo() {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getDowinApiInfo", null);
	}

	@Override
	public long getSiteMaxBet(HashMap sParam) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getSiteMaxBet", sParam);
	}

	@Override
	public Long getUserMaxBet(HashMap sParam) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getUserMaxBet", sParam);
	}

	@Override
	public int getBetCheckByHc(String refId) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getBetCheckByHc", refId);
	}

	@Override
	public void updatePragmaticId(Member member) {
		// TODO Auto-generated method stub
		sqlSession.update("updatePragmaticId", member);
	}

	@Override
	public HashMap getProgmaticApiInfo() {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getProgmaticApiInfo", null);
	}

	@Override
	public HashMap getProgmaticApiInfo2() {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getProgmaticApiInfo2", null);
	}

	@Override
	public HashMap getSiteApiInfoByPra(HashMap sParam) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getSiteApiInfoByPra", sParam);
	}

	@Override
	public String getlastDepostId(HashMap dParam) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getlastDepostId", dParam);
	}

	@Override
	public List<HashMap> getNotUseMemberListProgama() {
		// TODO Auto-generated method stub
		return sqlSession.selectList("getNotUseMemberListProgama", null);
	}

	@Override
	public List<Game> getGameList(HashMap param) {
		// TODO Auto-generated method stub
		return sqlSession.selectList("getGameList", param);
	}

	@Override
	public HashMap getOnlyVenderInfo(CommonParam commonParam) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getOnlyVenderInfo", commonParam);
	}

	@Override
	public int getBotaAutoCancelCnt(String tranId) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getBotaAutoCancelCnt", tranId);
	}

	@Override
	public int getBotaBetCnt(String tranId) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getBotaBetCnt", tranId);
	}

	@Override
	public List<HashMap> getBotaBetListMinute() {
		// TODO Auto-generated method stub
		return sqlSession.selectList("getBotaBetListMinute", null);
	}

	@Override
	public String getSiteIdByRefId2(String string) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getSiteIdByRefId2", string);
	}

	@Override
	public int getTranIdCheck(String string) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getTranIdCheck", string);
	}

	@Override
	public int getTranIdCheck2(String string) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getTranIdCheck2", string);
	}

	@Override
	public HashMap getSiteMember(String string) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getSiteMember", string);
	}

	@Override
	public void updateDebitCancel(String refId) {
		// TODO Auto-generated method stub
		sqlSession.update("updateDebitCancel", refId);
	}

	@Override
	public void insertSiteCallBackLog(HashMap logParam) {
		// TODO Auto-generated method stub
		sqlSession.insert("insertSiteCallBackLog", logParam);
	}

	@Override
	public List<HashMap> getBetList(BetParam param) {
		// TODO Auto-generated method stub
		return sqlSession.selectList("getBetList", param);
	}

	@Override
	public List<HashMap> getMonsterGameList() {
		// TODO Auto-generated method stub
		return sqlSession.selectList("getMonsterGameList", null);
	}

	@Override
	public HashMap getProgmaticApiInfo3(String code) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getProgmaticApiInfo3", code);
	}

	@Override
	public long getBetCancelAmt(String string) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getBetCancelAmt", string);
	}

	@Override
	public int getBetIdCheck(String refId) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getBetIdCheck", refId);
	}

	@Override
	public int getBetIdCheck2(String refId) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getBetIdCheck2", refId);
	}

	@Override
	public int getTranCheck2(String tranId) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getTranCheck2", tranId);
	}

	@Override
	public void insertSlotCity(HashMap slotMap) {
		// TODO Auto-generated method stub
		sqlSession.insert("insertSlotCity", slotMap);
	}

	@Override
	public void botaAutoCancel(HashMap tranParam) {
		// TODO Auto-generated method stub
		sqlSession.update("botaAutoCancel", tranParam);
	}

	@Override
	public void seattleCredit() {
		// TODO Auto-generated method stub
		sqlSession.insert("seattleCredit", null);
	}

	@Override
	public void updateDecimal(HashMap decimalParam) {
		sqlSession.update("updateDecimal", decimalParam);

	}

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

	@Override
	public void insertAutoLose(HashMap loseCredit) {
		// TODO Auto-generated method stub
		sqlSession.insert("insertAutoLose", loseCredit);
	}

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

	@Override
	public int callbackTokenCheck(String token) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("callbackTokenCheck", token);
	}

	@Override
	public HashMap getVenderInfo(BalanceParam param) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getVenderInfo", param);
	}

	@Override
	public String getRefIdByTranId(String tranId) {
		return sqlSession.selectOne("getRefIdByTranId", tranId);

	}

	@Override
	public List<HashMap> getCreditReSendList() {
		return sqlSessionSub.selectList("getCreditReSendList",  null);

	}

	@Override
	public void updateMemCancelCnt(long memberIdx) {
		// TODO Auto-generated method stub
		sqlSession.update("updateMemCancelCnt", memberIdx);
	}

	@Override
	public Long getMemberIdx(HashMap memParam) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getMemberIdx", memParam);
	}

	@Override
	public int insertVendorChangeBalanceLog(VendorChangeBalanceLogVo logVo) {
		// TODO Auto-generated method stub
		return sqlSession.insert("insertVendorChangeBalanceLog", logVo);
	}

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

	@Override
	public String getCreditRate(HashMap upParam) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getCreditRate", upParam);
	}

	@Override
	public void inserDemoUSer(String bombToken) {
		 sqlSession.insert("inserDemoUSer", bombToken);
	}

	@Override
	public HashMap getDemoByBombAccId(HashMap memParam) {
		return sqlSession.selectOne("getDemoByBombAccId", memParam);
	}

	@Override
	public void updateDemoUSer(HashMap memParam) {
		sqlSession.insert("updateDemoUSer", memParam);

	}

	@Override
	public List<HashMap> getTrasferVendorList() {
		return sqlSessionSub.selectList("getTrasferVendorList", null);
	}

	@Override
	public List<HashMap> getAllMember() {
		return sqlSessionSub.selectList("getAllMember", null);
	}

	@Override
	public int gethourBetCheck(long member) {
		return sqlSessionSub.selectOne("gethourBetCheck", member);
	}

	@Override
	public List<HashMap> getAllMember2() {
		return sqlSessionSub.selectList("getAllMember2", null);
	}

	@Override
	public HashMap getUserVendorInfo(HashMap memParam) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getUserVendorInfo", memParam);
	}


	@Override
	public Member getMemberByToken(Map authParam) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getMemberByToken", authParam);
	}

	@Override
	public HashMap getSiteApiInfoByToken(Map authParam) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getSiteApiInfoByToken", authParam);
	}

	@Override
	public double getBetDepositAmt(String tranId) {
		double res =0;
		try {
			res = sqlSession.selectOne("getBetDepositAmt", tranId);
		}catch(Exception e) {
			res =0;
		}
		return res;

	}

	@Override
	public void insertSplusTran(Map trxParam) {
		sqlSession.insert("insertSplusTran", trxParam);

	}

	@Override
	public void updateSplusTran(Map trxParam) {
		sqlSession.update("updateSplusTran", trxParam);

	}

	@Override
	public String getCbData(String reserve_id) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getCbData", reserve_id);
	}

	@Override
	public void updatesPurchaseId(Map trxParam) {
		sqlSession.update("updatesPurchaseId", trxParam);
	}

	@Override
	public double getBetGapAmt(String pid) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getBetGapAmt", pid);
	}

	@Override
	public void insertToken(String base64Token) {
		sqlSession.insert("insertToken", base64Token);
	}

	@Override
	public int getSplusToken(String base64Token) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getSplusToken", base64Token);
	}

	@Override
	public String getRefIdByPurchaseId(String purchaseId) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getRefIdByPurchaseId", purchaseId);
	}

	@Override
	public List<HashMap> getSplusDetailData(BetParam param) {
		// TODO Auto-generated method stub
		return sqlSession.selectList("getSplusDetailData", param);
	}

	@Override
	public String getKorNameTeam(String txt) {
		return sqlSession.selectOne("getKorNameTeam", txt);

	}

	@Override
	public String getKorNameLeague(String txt) {
		return sqlSession.selectOne("getKorNameLeague", txt);

	}

	@Override
	public void insertVendorsCodeRate(Site site) {
		// TODO Auto-generated method stub
		sqlSession.insert("insertVendorsCodeRate", site);
	}

	@Override
	public HashMap getBetInfoByTranId(String tranId) {
		return sqlSession.selectOne("getBetInfoByTranId", tranId);

	}

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

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

	@Override
	public int updatePowerballApiInfo(HashMap<String, String> registParam) {
		// TODO Auto-generated method stub
		return sqlSession.update("updatePowerballApiInfo", registParam);
	}

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

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

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

	@Override
	public int updMemLastVendorIdx(HashMap memParam) {
		// TODO Auto-generated method stub
		return sqlSession.update("updMemLastVendorIdx", memParam);
	}

	@Override
	public List<HashMap> getVendorListByVendorKey(HashMap venderInfo) {
		return sqlSession.selectList("getVendorListByVendorKey", venderInfo);
	}

	@Override
	public void vendorUpdate(HashMap venderInfo) {
		sqlSession.update("vendorUpdate", venderInfo);

	}

	@Override
	public List<HashMap> getNexusSkinListByVendorKey(HashMap venderInfo) {
		return sqlSession.selectList("getNexusSkinListByVendorKey", venderInfo);
	}

	@Override
	public void nexusSkinUpdate(HashMap venderInfo) {
		sqlSession.update("nexusSkinUpdate", venderInfo);

	}

	@Override
	public String getParseTarget() {
		return sqlSession.selectOne("getParseTarget", null);
	}

	@Override
	public String getParseTargetExtr() {
		return sqlSessionSub.selectOne("getParseTargetExtr", null);
	}

	@Override
	public HashMap getParseUseYn(int siteIdx) {
		return sqlSession.selectOne("getParseUseYn", siteIdx);
	}

	@Override
	public void insertParseUse(HashMap parseParam) {
		sqlSession.insert("insertParseUse", parseParam);

	}

	@Override
	public List<HashMap> getApiBetVendorList(int siteIdx) {
		// TODO Auto-generated method stub
		return sqlSessionSub.selectList("getApiBetVendorList", siteIdx);
	}

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

	@Override
	public List<HashMap> getApiBetTransactionList(BetParam param) {
		// TODO Auto-generated method stub
		return sqlSessionSub.selectList("getApiBetTransactionList", param);
	}

	@Override
	public void updVendorMapForDefault(Site site) {
		// TODO Auto-generated method stub
		sqlSession.update("updVendorMapForDefault", site);
	}

	@Override
	public void updVendorCreditRateForDefault(Site site) {
		// TODO Auto-generated method stub
		sqlSession.update("updVendorCreditRateForDefault", site);
	}

	@Override
	public void deleteVendorAccountForDefault(Site site) {
		// TODO Auto-generated method stub
		sqlSession.update("deleteVendorAccountForDefault", site);
	}

	@Override
	public HashMap getParseUserYn(HashMap pum) {
		return sqlSession.selectOne("getParseUserYn", pum);
	}

	@Override
	public void setParseUserYn(HashMap pum) {
		sqlSession.update("setParseUserYn", pum);

	}

	@Override
	public OTPInfo getOtpInfo(long siteIdx) {
		// TODO Auto-generated method stub
		return sqlSessionSub.selectOne("getOtpInfo", siteIdx);
	}

	@Override
	public OTPInfo getOtpInfoByManger(long siteIdx) {
		// TODO Auto-generated method stub
		return sqlSessionSub.selectOne("getOtpInfoByManger", siteIdx);
	}

	@Override
	public int registSuperOtp(OTPInfo param) {
		// TODO Auto-generated method stub
		return sqlSession.insert("registSuperOtp", param);
	}

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

	@Override
	public TrfApiInfo getTrfApiInfo(HashMap mapParam) {
		// TODO Auto-generated method stub
		return sqlSessionSub.selectOne("getTrfApiInfo", mapParam);
	}

	@Override
	public void agentIpsUpdate(Site site) {
		sqlSession.update("agentIpsUpdate", site);

	}

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

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

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

	@Override
	public List<HashMap> getParseTargetGame(String gameType) {
		return sqlSession.selectList("getParseTargetGame", gameType);
	}

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

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

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

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

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

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

	@Override
	public String getMemberByIdx(HashMap memParam) {
		return sqlSession.selectOne("getMemberByIdx", memParam);
	}

	@Override
	public List<HashMap> getSiteVendorList2(int siteIdx) {
		// TODO Auto-generated method stub
		return sqlSession.selectList("getSiteVendorList2", siteIdx);
	}

	@Override
	public List<HashMap> getVendorList2(int siteIdx) {
		// TODO Auto-generated method stub
		return sqlSession.selectList("getVendorList2", siteIdx);
	}

	@Override
	public void saveSvcr(HashMap paramMap) {
		// TODO Auto-generated method stub
		sqlSession.insert("saveSvcr", paramMap);
	}

	@Override
	public int siteVenderCodeCheck(HashMap paramMap) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("siteVenderCodeCheck", paramMap);
	}

	@Override
	public void saveVendorRate2(HashMap paramMap) {
		// TODO Auto-generated method stub
		sqlSession.update("saveVendorRate2", paramMap);
	}

	@Override
	public String getSiteKey(HashMap paramMap) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getSiteKey", paramMap);
	}

	@Override
	public String getVendorTitle(HashMap paramMap) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getVendorTitle", paramMap);
	}

	@Override
	public Long getUserTimeout(HashMap accLog) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getUserTimeout", accLog);
	}

	@Override
	public int updateUserTimeout(HashMap accLog) {
		// TODO Auto-generated method stub
		return sqlSession.update("updateUserTimeout", accLog);
	}

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

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

	@Override
	public int updateParseUseYN(String useYn) {
		// TODO Auto-generated method stub
		return sqlSession.update("updateParseUseYN", useYn);
	}

	@Override
	public int insertTheaTrxId(HashMap param) {
		// TODO Auto-generated method stub
		return sqlSession.insert("insertTheaTrxId", param);
	}

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

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

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

	@Override
	public int updMemberBalance(HashMap balanceMap) {
		// TODO Auto-generated method stub
		return sqlSession.update("updMemberBalance", balanceMap);
	}

	@Override
	public int getMemberBalance(HashMap balanceMap) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getMemberBalance", balanceMap);
	}

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

	@Override
	public int checkMemberId(String vendorUsername) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("checkMemberId", vendorUsername);
	}

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

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

	@Override
	public int updateTestCnt(Site site) {
		// TODO Auto-generated method stub
		return sqlSession.update("updateTestCnt", site);
	}

	@Override
	public int updateParseEvoYn(HashMap param) {
		// TODO Auto-generated method stub
		return sqlSession.update("updateParseEvoYn", param);
	}

	@Override
	public int saveParsEvoAmount(SiteSearch param) {
		// TODO Auto-generated method stub
		return sqlSession.update("saveParsEvoAmount", param);
	}

	@Override
	public int getUserBalance(HashMap balanceMap) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getUserBalance", balanceMap);
	}

	@Override
	public List<HashMap> getMyDownSite(SiteSearch search) {
		// TODO Auto-generated method stub
		return sqlSession.selectList("getMyDownSite", search);
	}

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

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

	@Override
	public List<HashMap> getSiteTreeList(String siteId) {
		// TODO Auto-generated method stub
		return sqlSession.selectList("getSiteTreeList", siteId);
	}

	@Override
	public int getMyDownSiteCheck(Site targetsite) {
		// TODO Auto-generated method stub
		return sqlSessionSub.selectOne("getMyDownSiteCheck", targetsite);
	}

	@Override
	public void insertParseUseYn(Site site) {
		// TODO Auto-generated method stub
		sqlSession.insert("insertParseUseYn", site);
	}

	@Override
	public int updateSitePwd(SitePwdVO sitePwdVO) {
		// TODO Auto-generated method stub
		return sqlSession.update("updateSitePwd", sitePwdVO);
	}

	@Override
	public Site getSite(Site site) {
		// TODO Auto-generated method stub
		return sqlSessionSub.selectOne("getSite", site);
	}

	@Override
	public void siteVenderLobbyUpdate(Vendor vendor) {
		// TODO Auto-generated method stub
		sqlSession.update("siteVenderLobbyUpdate", vendor);
	}

	@Override
	public List<HashMap> getVendorMapList(SiteSearch search) {
		// TODO Auto-generated method stub
		return sqlSession.selectList("getVendorMapList", search);
	}

	@Override
	public List<HashMap> geLobbyList(SiteSearch search) {
		// TODO Auto-generated method stub
		return sqlSession.selectList("geLobbyList", search);
	}

	@Override
	public String siteVenderRate(Vendor vendor) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("siteVenderRate", vendor);
	}

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

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

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

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

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

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

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

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

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

	@Override
	public void insertCmsIp(Site site) {
		// TODO Auto-generated method stub
		sqlSession.insert("insertCmsIp", site);
	}

	@Override
	public int getSiteListCntForApi(SiteSearch search) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getSiteListCntForApi", search);
	}

	@Override
	public List<HashMap> getSiteListForApi(SiteSearch search) {
		// TODO Auto-generated method stub
		return sqlSession.selectList("getSiteListForApi", search);
	}

	@Override
	public Site getSiteDetailForApi(SiteSearch search) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getSiteDetailForApi", search);
	}

	@Override
	public List<HashMap> getVendorListForApi(SiteSearch search) {
		// TODO Auto-generated method stub
		return sqlSession.selectList("getVendorListForApi", search);
	}

	@Override
	public List<HashMap> getSiteVendorListForApi(SiteSearch search) {
		// TODO Auto-generated method stub
		return sqlSession.selectList("getSiteVendorListForApi", search);
	}

	@Override
	public HashMap getRefIdByVendorTranKey(String vendorTranKey) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getRefIdByVendorTranKey", vendorTranKey);
	}

		@Override
	public int updateUserMaxBet(HashMap param) {
		return sqlSession.update("updateUserMaxBet", param);
	}

	@Override
	public int insertTranLog(HashMap logParam) {
		return sqlSession.insert("insertTranLog", logParam);
	}

	@Override
	public HashMap getSiteSubCredit(String siteId) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getSiteSubCredit", siteId);
	}

	@Override
	public String getBetAmountByTranParam(HashMap param) {
		// TODO Auto-generated method stub
		return sqlSession.selectOne("getBetAmountByTranParam", param);
	}

}
