package org.jeecg.ctop.material.mapper;

import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.ctop.material.entity.KuaishouUnitReportDailyPojo;
import org.jeecg.ctop.material.entity.KuaishouUnitReportHourlyPojo;
import org.jeecg.ctop.material.entity.vo.KuaiShouAccountPieVo;
import org.jeecg.ctop.material.entity.vo.KuaiShouOperateAccountVo;
import org.jeecg.ctop.material.entity.vo.KuaiShouOperateProjectVo;
import org.jeecg.ctop.material.entity.vo.KuaiShouOperateVo;

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

@Mapper
public interface KuaishouOperationRecordMapper {


    /**
     * 查询快手组 时报 消耗前10
     * @param advertiserId
     * @param startTime
     * @param endTime
     * @return
     */
    List<KuaishouUnitReportHourlyPojo> getKuaishouUnitReportHourly(@Param("advertiserId") long advertiserId, @Param("startTime") long startTime, @Param("endTime") long endTime);

    /**
     * 查询快手组 日报 消耗前10
     * @param advertiserId
     * @param startTime
     * @param endTime
     * @return
     */
    List<KuaishouUnitReportHourlyPojo> getKuaishouUnitReportDaily(@Param("advertiserId") long advertiserId, @Param("startTime") long startTime, @Param("endTime") long endTime);


    /**
     * 查询 账户操作类型
     * @param advertiserId 账户id
     * @param operationType 操作目标类型1：账户 2：计划 3：广告组 4：创意 5：视频 6：应用 7：人群包
     *                   warning:!!!   根据磁力引擎api得知 状态为3时 字段 objectId 对应为计划id-unitId
     *                      but but but 状态为2时 对应的是组id unitId
     * @param objectId 操作对象id
     * @param startTime
     * @param endTime
     * @return
     */
    List<JSONObject> getKuaishouOperationRecordByAdvertiserId(@Param("advertiserId") long advertiserId,@Param("objectId") long objectId,@Param("operationType") int operationType,  @Param("operationTime") String operationTime);

    /**
     * 查看快手 组数据信息
     * @param accountId
     * @param unitId
     * @param statDate
     * @param statHour
     * @return
     */
    JSONObject getKuaishouOperationUnitReport(@Param("accountId") long accountId,@Param("unitId") long unitId, @Param("statDate") String statDate, @Param("statHour") String statHour);


}
