package com.tzld.piaoquan.api.dao.mapper.contentplatform.ext;

import com.tzld.piaoquan.api.model.param.contentplatform.GzhPlanListParam;
import com.tzld.piaoquan.api.model.param.contentplatform.QwPlanListParam;
import com.tzld.piaoquan.api.model.param.contentplatform.XcxPlanListParam;
import com.tzld.piaoquan.api.model.param.contentplatform.VideoContentListParam;
import com.tzld.piaoquan.api.model.po.contentplatform.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ContentPlatformPlanMapperExt {


    int getGzhPlanCount(@Param("param") GzhPlanListParam param,
                        @Param("createAccountId") Long createAccountId);

    List<ContentPlatformGzhPlan> getGzhPlanList(@Param("param") GzhPlanListParam param,
                                                @Param("createAccountId") Long createAccountId,
                                                @Param("offset") int offset,
                                                @Param("pageSize") Integer pageSize);

    List<ContentPlatformGzhPlan> getGzhPlanExists(@Param("accountId") Long accountId,
                                                  @Param("type") Integer type,
                                                  @Param("scene") Integer scene,
                                                  @Param("id") Long id);

    void insertGzhPlanReturnId(@Param("record") ContentPlatformGzhPlan gzhPlan);

    String getVideoMaxDt();

    String getVideoDatastatMaxDt();

    int getVideoCount(@Param("param") VideoContentListParam param, @Param("dt") String dt,
                      @Param("minScore") Double minScore);

    List<String> getVideoCategoryList(@Param("dt") String dt, @Param("category") String category);

    List<ContentPlatformVideo> getVideoList(@Param("param") VideoContentListParam param,
                                            @Param("dt") String dt,
                                            @Param("datastatDt") String datastatDt,
                                            @Param("type") String type,
                                            @Param("channel") String channel,
                                            @Param("strategy") String strategy,
                                            @Param("minScore") Double minScore,
                                            @Param("offset") int offset,
                                            @Param("pageSize") Integer pageSize,
                                            @Param("sort") String sort);

    List<ContentPlatformVideo> getVideoMinScoreList(@Param("dt") String dt,
                                                    @Param("minScore") Double minScore,
                                                    @Param("roomId") String roomId,
                                                    @Param("offset") int offset,
                                                    @Param("pageSize") Integer pageSize,
                                                    @Param("sort") String sort);

    List<ContentPlatformVideo> getVideoMinDatastatScoreList(@Param("dt") String dt,
                                                            @Param("datastatDt") String datastatDt,
                                                            @Param("type") String type,
                                                            @Param("channel") String channel,
                                                            @Param("strategy") String strategy,
                                                            @Param("minScore") Double minScore,
                                                            @Param("excludeVideoIds") List<Long> excludeVideoIds,
                                                            @Param("offset") int offset,
                                                            @Param("pageSize") Integer pageSize,
                                                            @Param("sort") String sort);

    void batchInsertContentPlatformVideo(@Param("records") List<ContentPlatformVideo> saveList);

    void batchInsertContentPlatformIllegalVideo(@Param("records") List<ContentPlatformIllegalVideo> saveList);

    void batchInsertContentPlatformVideoAgg(@Param("records") List<ContentPlatformVideoAgg> saveList);

    int getQwPlanCount(@Param("param") QwPlanListParam param,
                       @Param("createAccountId") Long createAccountId);

    List<ContentPlatformQwPlan> getQwPlanList(@Param("param") QwPlanListParam param,
                                              @Param("createAccountId") Long createAccountId,
                                              @Param("offset") int offset,
                                              @Param("pageSize") Integer pageSize);

    void batchInsertQwPlan(@Param("records") List<ContentPlatformQwPlan> saveList);

    void insertQwPlanReturnId(@Param("record") ContentPlatformQwPlan qwPlan);

    List<ContentPlatformGzhPlanVideo> getGzhPlanVideoListByCooperateAccountId(@Param("ghId") String ghId);

    void updateVideoStatusWithOldStatus(@Param("videoId") Long videoId,
                                        @Param("status") Integer status,
                                        @Param("oldStatus") Integer oldStatus,
                                        @Param("now") Long now);

    void updateVideoAggStatusWithOldStatus(@Param("videoId") Long videoId,
                                           @Param("status") Integer status,
                                           @Param("oldStatus") Integer oldStatus,
                                           @Param("now") Long now);

    List<ContentPlatformVideoAgg> getVideoAggList(@Param("aggDt") String aggDt, @Param("dtList") List<String> dtList);

    List<ContentPlatformVideo> getVideoListByIds(@Param("videoIds") List<Long> videoIds);

    void deleteContentPlatformVideo(@Param("dt") String dt);

    void deleteContentPlatformVideoAgg(@Param("dt") String dt);

    void deleteContentPlatformVideoDatastatAgg(@Param("dt") String aggDt, @Param("strategy") String strategy);

    void deleteContentPlatformVideoDatastat(@Param("dt") String aggDt);

    void batchInsertContentPlatformVideoDatastat(@Param("records") List<ContentPlatformVideoDataStat> saveList);

    void batchInsertContentPlatformVideoDatastatAgg(@Param("records") List<ContentPlatformVideoDataStatAgg> saveAggList);

    void updateOtherVideoStatus(@Param("dt") String dt, @Param("videoIdList") List<Long> videoIdList, @Param("now") Long now);

    List<PlanIllegalVideoDTO> getGzhPlanIllegalVideoList(@Param("videoId") Long videoId);

    List<PlanIllegalVideoDTO> getQwPlanIllegalVideoList(@Param("videoId") Long videoId);

    int getUploadVideoCount(@Param("param") VideoContentListParam param, @Param("createAccountId") Long createAccountId);

    List<ContentPlatformVideo> getUploadVideoList(@Param("param") VideoContentListParam param,
                                                  @Param("createAccountId") Long createAccountId,
                                                  @Param("datastatDt") String datastatDt,
                                                  @Param("type") String type,
                                                  @Param("channel") String channel,
                                                  @Param("strategy") String strategy,
                                                  @Param("offset") int offset,
                                                  @Param("pageSize") Integer pageSize,
                                                  @Param("sort") String sort);

    void updateUploadVideoStatusWithOldStatus(@Param("videoId") Long videoId,
                                              @Param("status") Integer status,
                                              @Param("now") Long now);

    List<ContentPlatformGzhPlanVideo> getGzhPushPlanVideoByRootSourceId(@Param("rootSourceId") String rootSourceId, @Param("planType") Integer planType);

    int getXcxPlanCount(@Param("param") XcxPlanListParam param,
                        @Param("createAccountId") Long createAccountId);

    List<ContentPlatformXcxPlan> getXcxPlanList(@Param("param") XcxPlanListParam param,
                                                @Param("createAccountId") Long createAccountId,
                                                @Param("offset") int offset,
                                                @Param("pageSize") Integer pageSize);

    void insertXcxPlanReturnId(@Param("record") ContentPlatformXcxPlan xcxPlan);
}