package org.jeecg.ctop.material.mapper;

import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;

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

public interface AdqAdvertiserReportMapper {

    JSONObject getTotalCharge(Map<String, Object> paramsMap);

    JSONObject getTotalChargeHourly(Map<String, Object> paramsMap);

    JSONObject getTotalChargeDaily(Map<String, Object> paramsMap);

    Long getYesterdayUploadNewMaterialCount(Map<String, Object> paramsMap);

    List<JSONObject> getHourCost(@Param("projectId") Long projectId, @Param("startTime") Integer startTime);

    List<JSONObject> getDataCost(@Param("projectId") Long projectId, @Param("startTime") Integer startTime, @Param("endTime") Integer endTime);

    List<JSONObject> getProjectTodayBase(@Param("projectId") Long projectId, @Param("startTime") Integer startTime);

    List<JSONObject> getProjectMetaByIds(@Param("projectIds") List<Long> projectIds);

    List<JSONObject> getProjectMaterialCountByDayAndIds(@Param("statDate") Integer statDate, @Param("projectIds") List<Long> projectIds);

    List<JSONObject> getProjectPrevHourlyCostByDayAndIds(@Param("statDate") Integer statDate, @Param("hour") Integer hour, @Param("projectIds") List<Long> projectIds);

    List<JSONObject> getProjectAccountOperatorCountByCurrentHourlyAndIds(@Param("statDate") Integer statDate, @Param("hour") Integer hour, @Param("projectIds") List<Long> projectIds);

    List<JSONObject> getProjectAccountOperatorCountByDayAndIds(@Param("statDate") Integer statDate, @Param("projectIds") List<Long> projectIds);

    List<JSONObject> getProjectToDayReport(@Param("category") String category, @Param("projectId") Long projectId, @Param("startTime") Integer startTime, @Param("hour") Integer hour, @Param("sortCode") String sortCode, @Param("order") String order, @Param("userIds") List<String> userIds);

    List<JSONObject> getProjectMoreDaysReport(@Param("category") String category, @Param("projectId") Long projectId, @Param("startTime") Integer startTime, @Param("endTime") Integer endTime, @Param("lastStart") Integer lastStart, @Param("lastEnd") Integer lastEnd, @Param("sortCode") String sortCode, @Param("order") String order, @Param("userIds") List<String> userIds);

    List<JSONObject> getProjectNoByDays(@Param("startTime") Integer startTime, @Param("endTime") Integer endTime);

    List<JSONObject> getAdvertiserNoByDays(@Param("startTime") Integer startTime, @Param("endTime") Integer endTime);

    List<JSONObject> getUnitNoByHours(@Param("startTime") Integer startTime);

    List<JSONObject> getUnitNoByDays(@Param("startTime") Integer startTime, @Param("endTime") Integer endTime);

    List<JSONObject> getAdqOperateInfoHourly(@Param("hour") Integer hour, @Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("lastTimeEnd") Long lastTimeEnd, @Param("lastTimeStart") Long lastTimeStart, @Param("list") List<String> operatorUserIds);

    List<JSONObject> getAdqOperateInfo(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("lastTimeEnd") Long lastTimeEnd, @Param("lastTimeStart") Long lastTimeStart, @Param("list") List<String> operatorUserIds);

    JSONObject getAdqOperateGroupInfoHourly(@Param("hour") Integer hour, @Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("lastTimeEnd") Long lastTimeEnd, @Param("lastTimeStart") Long lastTimeStart, @Param("list") Set<String> operatorUserIds);

    JSONObject getAdqOperateGroupInfo(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("lastTimeEnd") Long lastTimeEnd, @Param("lastTimeStart") Long lastTimeStart, @Param("list") Set<String> operatorUserIds);

    List<JSONObject> getOperateGroupCurrentHourlyByUsers(@Param("hour") Integer hour, @Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("userIds") List<String> userIds);

    List<JSONObject> getOperateGroupCurrentByUsers(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("userIds") List<String> userIds);

    List<JSONObject> getOperateGroupPreviousHourlyByUsers(@Param("hour") Integer hour, @Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("userIds") List<String> userIds);

    List<JSONObject> getOperateGroupPreviousByUsers(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("userIds") List<String> userIds);

    List<JSONObject> getOperateGroupHourlyMetricsByUsers(@Param("hour") Integer hour, @Param("currentStartDate") Long currentStartDate, @Param("currentEndDate") Long currentEndDate, @Param("previousStartDate") Long previousStartDate, @Param("previousEndDate") Long previousEndDate, @Param("userIds") List<String> userIds);

    List<JSONObject> getOperateGroupDailyMetricsByUsers(@Param("currentStartDate") Long currentStartDate, @Param("currentEndDate") Long currentEndDate, @Param("previousStartDate") Long previousStartDate, @Param("previousEndDate") Long previousEndDate, @Param("userIds") List<String> userIds);

    List<JSONObject> getAdqOperateGroupInfoHourlyBatch(@Param("managerIds") List<String> managerIds, @Param("hour") Integer hour, @Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("lastTimeEnd") Long lastTimeEnd, @Param("lastTimeStart") Long lastTimeStart);

    List<JSONObject> getAdqOperateGroupInfoBatch(@Param("managerIds") List<String> managerIds, @Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("lastTimeEnd") Long lastTimeEnd, @Param("lastTimeStart") Long lastTimeStart);
}
