package cn.com.ctop.kuaishou.modules.report.mapper;

import cn.com.ctop.kuaishou.modules.report.entity.NewMonitorInfo;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@Mapper
public interface NewMonitorMapper {

    List<Long> getAllAccountId(@Param("type") String type);

    List<Map> getKuaiShouGroup(@Param("date") String date, @Param("accountId") String accountId);

    List<Map> getKuaiShouGroupNow(@Param("date") String date, @Param("accountId") String accountId);

    List<Map> getKuaiShouCampaign(@Param("date") String date, @Param("accountId") String accountId);

    List<Map> getKuaiShouCampaignNow(@Param("date") String date, @Param("accountId") String accountId);

    List<Map> getTouTiaoCampaign(@Param("date") String date, @Param("accountId") String accountId);

    List<Map> getTouTiaoCampaignNow(@Param("date") String date, @Param("accountId") String accountId);

    BigDecimal getGroupCharge(@Param("unitId") String unitId, @Param("afterDate") String afterDate);

    BigDecimal getCampaignCharge(@Param("campaignId") String campaignId, @Param("afterDate") String afterDate);

    BigDecimal getCampaignChargeTouTiao(@Param("campaignId") String campaignId, @Param("afterDate") String afterDate);

    void saveMonitorGroup(@Param("accountId") String accountId, @Param("accountName") String accountName, @Param("operatingName") String operatingName, @Param("unitId") String unitId, @Param("createTime") String createTime, @Param("projectType") String projectType, @Param("effective") String effective);

    void saveMonitorCampaign(@Param("accountId") String accountId, @Param("accountName") String accountName, @Param("operatingName") String operatingName, @Param("campaignId") String campaignId, @Param("createTime") String createTime, @Param("projectType") String projectType, @Param("effective") String effective);

    String getMonitorGroupByUnitId(@Param("unitId") String unitId);

    String getMonitorPlanByCampaignId(@Param("campaignId") String campaignId);

    void updateMonitorGroupByUnitId(@Param("unitId") String unitId, @Param("effective") String effective);

    void updateMonitorPlanByCampaignId(@Param("campaignId") String campaignId, @Param("effective") String effective);

    List<JSONObject> getKuaiShouGroupMessage(@Param("array") JSONArray array, @Param("startDate") Integer startDate, @Param("endDate") Integer endDate);

    JSONObject getKuaiShouGroupSum(@Param("array") JSONArray array, @Param("startDate") Integer startDate, @Param("endDate") Integer endDate);

    List<JSONObject> getKuaiShouGroupMessageGroup(@Param("array") JSONArray array, @Param("startDate") Integer startDate, @Param("endDate") Integer endDate, @Param("group") String group);

    List<JSONObject> getPlanMessage(@Param("array") JSONArray array, @Param("startDate") Integer startDate, @Param("endDate") Integer endDate);

    JSONObject getPlanSum(@Param("array") JSONArray array, @Param("startDate") Integer startDate, @Param("endDate") Integer endDate);

    List<JSONObject> getPlanMessageGroup(@Param("array") JSONArray array, @Param("startDate") Integer startDate, @Param("endDate") Integer endDate, @Param("group") String group);

    List<NewMonitorInfo> getOperator(@Param("userId") String userId);

    JSONObject getPlanSumBytedance(@Param("array") JSONArray array, @Param("startDate") Integer startDate, @Param("endDate") Integer endDate);

    List<JSONObject> getPlanMessageGroupBytedance(@Param("array") JSONArray array, @Param("startDate") Integer startDate, @Param("endDate") Integer endDate, @Param("group") String group);

    List<JSONObject> getPlanMessageBytedance(@Param("array") JSONArray array, @Param("startDate") Integer startDate, @Param("endDate") Integer endDate);

}
