package com.boot.security.server.dao;

import com.boot.security.server.model.AdvertiserData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

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

@Mapper
public interface AdvertDao {
    @Select("select report_date reportDate,advertiser_id advertiserId,advertiser_name advertiserName,code_id codeId,ecpm,cpc,exposure,click,income from advert_data_count t where report_date>= #{startTime} and report_date<=#{endTime}")
    List<AdvertiserData> getAdvertData(@Param("startTime") String startTime, @Param("endTime") String endTime);

    @Select("select count(*) from advert_data_count t where report_date>= #{startTime} and report_date<=#{endTime}")
    Integer getAdvertDataCount(@Param("startTime") String startTime, @Param("endTime") String endTime);
}
