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

import cn.com.ctop.common.module.vo.KuaishouReportAccountDailyDTOEntity;
import cn.com.ctop.kuaishou.modules.report.entity.*;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

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

public interface KuaishouReportDailyAccountMapper extends BaseMapper<KuaishouReportDailyAccount> {

    void loadAccountDailyReport(@Param("accountId") Long accountId, @Param("localPath") String localPath);

    void insertSelective(KuaishouReportDailyAccount dailyAccount);

    List<JSONObject> selectCost(@Param("accountId") Long accountId, @Param("startDate") String startDate, @Param("endDate") String endDate);

    List<ProjectAccountDTO> getKuaishouProjectInfo(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projectList") List<Long> projectList, @Param("yn") Integer yn);

    List<KuaishouReportDailyAccountDTO> getKuaishouAccountInfoByProjectId(@Param("projectId") Long projectId, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projectList") List<Long> projectList, @Param("accountIds") List<Long> accountIds, @Param("yn") Integer yn);

    List<KuaishouReportDailyAccountDTO> getKuaishouCampaignInfoByAccountId(@Param("projectList") List<Long> projectList, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("accountId") Long accountId, @Param("accountIds") List<Long> accountIds, @Param("yn") Integer yn);

    List<KuaishouReportDailyAccountDTO> getKuaishouUnitInfoByCampaignId(@Param("projectList") List<Long> projectList, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("campaignId") Long campaignId, @Param("accountIds") List<Long> accountIds, @Param("yn") Integer yn);

    List<Long> queryProjectMemberByUserId(@Param("userId") String userId, @Param("mediaIds") List<Long> mediaIds);

    List<Long> queryProjectInfoBySaleId(@Param("userId") String userId, @Param("mediaIds") List<Long> mediaIds);

    List<ProjectAccountDTO> queryProjectMemberByIds(@Param("projectIds") List<Long> projectIds);

    String getRoleCodeByUserId(@Param("userId") String userId);

    List<Long> queryProjectMemberByAdmins(@Param("mediaIds") List<Long> mediaIds);

    List<KuaishouReportDailyAccountDTO> getKuaishouCreativeInfoByUnitId(@Param("projectList") List<Long> projectList, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("unitId") Long unitId, @Param("accountIds") List<Long> accoundIds, @Param("yn") Integer yn);

    KuaishouVideoInfoDTO getVideoUrl(@Param("photoId") Long photoId);

    List<Long> getUserProjectAccountIds(@Param("userId") String userId, @Param("yn") Integer yn);

    List<Long> getUserProjectAccountIdsByAdmin(@Param("yn") Integer yn);

    List<Long> getSaleProjectAccountIds(@Param("userId") String userId, @Param("yn") Integer yn);

    List<KuaishouReportAccountDailyDTOEntity> getKuaishouProjectInfoEntity(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projectList") List<Long> projectList, @Param("yn") Integer yn);

    void replaceBatch(@Param("addList") List<KuaishouReportDailyAccount> addList);

    void replaceBatchAdScene(@Param("addList") List<KuaishouReportDailyAccount> addList);

    List<EtlKuaishouReportAccountHourly> queryEveryDayDataForAccount();

    BigDecimal getSumChargeByAccountIdAndStatDate(@Param("accountId") Long accountId, @Param("statDate") String statDate);

    List<JSONObject> getPositionData(@Param("accountIds") JSONArray accountIds, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("filedAll") String filedAll);
}
