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.ReportSearch;
import com.bb.model.Site;
import com.bb.model.SiteSearch;

import jakarta.validation.Valid;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	@Override
	public HashMap getYdayBetInfoByUser(HashMap targetUser) {
		return sqlSessionSub.selectOne("getYdayBetInfoByUser", targetUser);
	}

	@Override
	public HashMap getMonthBetInfoByUser(HashMap targetUser) {
		return sqlSessionSub.selectOne("getMonthBetInfoByUser", targetUser);
	}

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

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

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

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

	@Override
	public HashMap getHybridReportTotal(@Valid ReportSearch search) {
		// TODO Auto-generated method stub
		return sqlSessionSub.selectOne("getHybridReportTotal", search);
	}
	
}
