package com.sptg.statistics.biz.service;

import com.baomidou.mybatisplus.service.IService;
import com.sptg.statistics.api.dto.StatisticsAdPushDto;
import com.sptg.statistics.api.entity.StatisticsAdPush;
import org.springframework.transaction.annotation.Transactional;

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

/**
 * title: StatisticsServiceInterface
 * package: com.sptg.statistics.biz.security
 * description: 统计广告发布-服务层接口
 *
 *                
 *                 
 */
public interface StatisticsAdPushServiceInterface extends IService<StatisticsAdPush> {

    /**
     * 功能描述:统计广告发布（广告曝光量,累计发布广告条数,当月曝光量,当月发布广告条数）
     * @param statisticsAdPushDto
     * @return Map<String,Object>
     *                
     *                       
     */
    Map<String,Object> statisticsAdPushTotal(StatisticsAdPushDto statisticsAdPushDto);

    /**
     * 功能描述:当月曝光量,当月发布广告条数
     * @param statisticsAdPushDto
     * @return Map<String,Object>
     *                
     *                       
     */
    Map<String,Object> statisticsCurrentMonthAdPushTotal(StatisticsAdPushDto statisticsAdPushDto);

    /**
     * 功能描述:查询某年广告曝光量，广告发布数量统计
     * @param statisticsAdPushDto
     * @return ResultBean<List<Map<String,Object>>>
     *                
     *                       
     */
    public abstract List<Map<String,Object>> statisticsAdPushAndExposure(StatisticsAdPushDto statisticsAdPushDto);

    /**
     * 功能描述:更新记录机构位置
     * @param oldPosition 旧机构位置
     * @param newPosition 新机构位置
     * @return void
     *                
     *                       
     */
    void updateOrgPosition(String oldPosition, String newPosition);

    /**
     * 功能描述:添加广告发布统计
     * @param statisticsAdPush
     * @return boolean
     *                
     *                      
     */
    @Transactional(rollbackFor = {Exception.class})
    void addAdPush(StatisticsAdPush statisticsAdPush);

    /**
     * 功能描述:添加多个广告发布统计
     * @param statisticsAdPushList
     * @return boolean
     *                
     *                       
     */
    @Transactional(rollbackFor = {Exception.class})
    void addAdPushList(List<StatisticsAdPush> statisticsAdPushList);

    /**
     * 功能描述:统计各个省份广告投放
     * @param statisticsAdPushDto
     * @return List<Map<String,Object>>
     *                
     *                      
     */
    List<Map<String,Object>> statisticsAdPushAndExposureByArea(StatisticsAdPushDto statisticsAdPushDto);

    /**
     * 功能描述:统计广告投放量
     * @param statisticsAdPushDto
     * {
     *    orgPosition : 位置信息
     *    isAllType : 查询类型
     * }
     * @return long
     *                
     *                      
     */
    long statisticsAdPushCount(StatisticsAdPushDto statisticsAdPushDto);


}
