package com.fshark.overseas.advert.entity.dao;



import com.fshark.overseas.advert.modle.metrics.ActivationMetrics;
import com.fshark.overseas.advert.modle.metrics.RemainMetrics;
import com.fshark.overseas.advert.modle.metrics.ServerActivationMetrics;
import org.jdbi.v3.sqlobject.customizer.Bind;
import org.jdbi.v3.sqlobject.customizer.BindBean;
import org.jdbi.v3.sqlobject.statement.SqlUpdate;

/**
 *
 */
public interface MetricsDao {

    /**
     * 更新指标表的注册创角等
     * @param event
     */
    @SqlUpdate("insert into appsflyer_metrics" +
            " (`data_date`,`data_hour`,`time_zone`,`region`, `platform`, `game_id`, `media_source`, `campaign_id` ,`ad_set_id`,`ad_id`,`channel`,`data_activation`,`data_register`,`data_device_register`,`data_create_role`,`data_day_act_register`,`data_day_register_create`,`data_active_day_dau`,`data_type`)" +
            " values (:data_date,:data_hour,:time_zone,:region,:platform,:game_id,:media_source,:campaign_id,:ad_set_id,:ad_id,:channel,:data_activation,:data_register,:data_device_register,:data_create_role,:data_day_act_register,:data_day_register_create,:data_active_day_dau,:data_type) ")
    void insertActivationMetrics(@BindBean ActivationMetrics event);


    @SqlUpdate("insert into appsflyer_retention " +
            " (`data_date`,`region`, `platform`, `game_id`, `media_source`, `campaign_id` ,`ad_set_id`,`ad_id`,`currency`,`register_num`)" +
            " values (:data_date,:region,:platform,:game_id,:media_source,:campaign_id,:ad_set_id,:ad_id,'KRW',:data_register)")
    void insertRegisterNum(@BindBean ActivationMetrics event);


    /**
     * 更新角色指标表的注册创角等
     * @param event
     */
    @SqlUpdate("insert into appsflyer_metrics_server" +
            " (`data_date`,`data_hour`,`time_zone`,`region`, `platform`, `game_id`, `media_source`, `campaign_id` ,`ad_set_id`,`ad_id`,`channel`,`server_id`,`data_register`,`data_create_role`,`data_day_register_create`,`data_active_day_dau`)" +
            " values (:data_date,:data_hour,:time_zone,:region,:platform,:game_id,:media_source,:campaign_id,:ad_set_id,:ad_id,:channel,:server_id,:data_register,:data_create_role,:data_day_register_create,:data_active_day_dau) ")
    void updateServerActivationMetrics(@BindBean ServerActivationMetrics event);



}
