package com.cloudcross.ssp.service;

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

import com.cloudcross.ssp.base.service.IGenericService;
import com.cloudcross.ssp.common.utils.Pager;
import com.cloudcross.ssp.model.DeliverAnalysis;

/**
 * 报表服务
 * @author chenyou
 *
 */
public interface IAdReportService extends IGenericService<DeliverAnalysis>{
	
    int findCountForDeliverEffectAnalysisAdvertiser(Map<String, Object> paramMap);
    int findCountForDeliverEffectAnalysisOperator(Map<String, Object> paramMap);
    int findCountForDeliverEffectAnalysisBack(Map<String, Object> paramMap);
    /**
	 * 查询创意报表总数
	 * @param paramMap 条件
	 * @return
	 */
	int findCountForBanner(Map<String, Object> paramMap);
	/**
	 * 根据条件查询创意报表
	 * @param paramMap
	 * @param pager
	 * @return
	 */
	List<DeliverAnalysis> findBannerByConditions(Map<String, Object> paramMap);
	
	/**
	 * 创意报表导出
	 * @param paramMap
	 * @return
	 */
	List<DeliverAnalysis> exportBannerListList(Map<String, Object> paramMap);
    int findCountForDeliverEffectAnalysis2(Map<String, Object> paramMap);
	
	int findCountForLocationAdvertiser(Map<String, Object> paramMap);
	int findCountForLocationBack(Map<String, Object> paramMap);
	
	int findCountForOs(Map<String, Object> paramMap);
	
	int findCountForScene(Map<String, Object> paramMap);
	

	
	List<DeliverAnalysis> findByTotalReportAdvertiser(Map<String, Object> paramMap, Pager pager);
	List<DeliverAnalysis> findByTotalReportBack(Map<String, Object> paramMap, Pager pager);
	
	
	List<DeliverAnalysis> findByTotalReport2(Map<String, Object> paramMap, Pager pager);
	
	
    List<DeliverAnalysis> findByPlaceName(Map<String, Object> paramMap, Pager pager);
    List<DeliverAnalysis> findByLocationAdvertiser(Map<String, Object> paramMap, Pager pager);
    List<DeliverAnalysis> findByLocationBack(Map<String, Object> paramMap, Pager pager);
    
    List<DeliverAnalysis> findByOs(Map<String, Object> paramMap, Pager pager);

	
	//首页顶部统计数据查询
	Map<String,Object> findCompare(Map<String, Object> paramMap);
	
	//查询首页图表
	List<HashMap<String, Object>> findChart(String startDate, String endDate, Long advertiserId);
	
	int findCountForChart(String startDate, String endDate, Long advertiserId);
	
	List<HashMap<String, Object>> findChart(String startDate, String endDate, Long advertiserId, Pager pager);
	/**
	 * 根据广告主id和时间查询它的总的曝光数和点击数
	 */
	HashMap<String, Object> findTotalImpressionAndClickByAdvertiserId(Map<String, Object> paramMap);
	
	/**
	 * 根据代理商id查询该代理商下的所有广告主的曝光数和点击数的总和
	 */
	HashMap<String, Object> findTotalImpressionAndClickByAgentId(Map<String, Object> paramMap);
	
	/**
	 * 导出excel报表
	 */
	List<DeliverAnalysis> findByTotalForExcelAdvertiser(Map<String, Object> paramMap);
	List<DeliverAnalysis> findByTotalForExcelBack(Map<String, Object> paramMap);
	List<DeliverAnalysis> findByTotalForExcelOperator(Map<String, Object> paramMap);
	
    List<DeliverAnalysis> findByPlaceName(Map<String, Object> paramMap);
    
    List<DeliverAnalysis> findByLocation(Map<String, Object> paramMap);
    
    List<DeliverAnalysis> findByOs(Map<String, Object> paramMap);
    
    List<DeliverAnalysis> findDeliverEffectAnalysisOperator(
			Map<String, Object> paramMap, Pager pager);
	List<DeliverAnalysis> findDeliverEffectAnalysisOperator(
			Map<String, Object> paramMap);
	
	int countBySizeOperator(Map<String, Object> paramMap);
	List<DeliverAnalysis> findBySizeOperator(
			Map<String, Object> paramMap, Pager pager);
	List<DeliverAnalysis> findBySizeOperator(
			Map<String, Object> paramMap);
	
	List<DeliverAnalysis> findByPositionOperator(
			Map<String, Object> paramMap);
	
	int countBySystemOperator(Map<String, Object> paramMap);
	
	List<DeliverAnalysis> findBySystemOperator(
			Map<String, Object> paramMap, Pager pager);
	
	List<DeliverAnalysis> findBySystemOperator(
			Map<String, Object> paramMap);
	
	List<DeliverAnalysis> findByDeviceOperator(
			Map<String, Object> paramMap);
	
	List<DeliverAnalysis> findByArealCityOperator(
			Map<String, Object> paramMap);
	
	List<DeliverAnalysis> findByArealOperator(
			Map<String, Object> paramMap);
	
	int countByPlaceOperator(Map<String, Object> paramMap);
	
	List<DeliverAnalysis> findByPlaceOperator(
			Map<String, Object> paramMap, Pager pager);
	
	List<DeliverAnalysis> findByPlaceOperator(
			Map<String, Object> paramMap);
	
	int countByApmacOperator(Map<String, Object> paramMap);
	
	List<DeliverAnalysis> findByApmacOperator(
			Map<String, Object> paramMap, Pager pager);
	
	List<DeliverAnalysis> findByApmacOperator(
			Map<String, Object> paramMap);
	
	int countByAllArealOperator(Map<String, Object> paramMap);
	
	List<DeliverAnalysis> findByAllArealOperator(
			Map<String, Object> paramMap, Pager pager);
	
	 //根据查询条件查询总的pv，uv，曝光数等等
    DeliverAnalysis findSumOperator(Map<String, Object> paramMap);
    
    List<DeliverAnalysis> findAllAreaOperator(Map<String, Object> paramMap);
}
