package com.ruixuan.isc.mapper;

import com.alibaba.fastjson.JSONObject;
import com.ruixuan.isc.entity.JYKuaishouPromoter;
import com.ruixuan.isc.entity.KuaishouPromoter;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface KuaishouPromoterMapper {
    /**
     * 查询快手达人 信息
     *
     * @param id 快手达人 信息主键
     * @return 快手达人 信息
     */
    public KuaishouPromoter selectKuaishouPromoterById(Long id);

    /**
     * 查询快手达人 信息列表
     *
     * @param kuaishouPromoter 快手达人 信息
     * @return 快手达人 信息集合
     */
    public List<KuaishouPromoter> selectKuaishouPromoterList(@Param("userList") List<Long> userList, @Param("promoterId") String promoterId,
                                                             @Param("promoterNickName") String promoterNickName,
                                                             @Param("mediaId") String mediaId,
                                                             @Param("parameter") String parameter, @Param("orderBy") String orderBy);

    public List<JYKuaishouPromoter> selectKuaishouPromoterList3(@Param("userList") List<Long> userList, @Param("promoterId") String promoterId,
                                                                @Param("promoterNickName") String promoterNickName,
                                                                @Param("mediaId") String mediaId,
                                                                @Param("type") String type,
                                                                @Param("parameter") String parameter, @Param("orderBy") String orderBy);

    /**
     * 新增快手达人 信息
     *
     * @param kuaishouPromoter 快手达人 信息
     * @return 结果
     */
    public int insertKuaishouPromoter(KuaishouPromoter kuaishouPromoter);

    /**
     * 修改快手达人 信息
     *
     * @param kuaishouPromoter 快手达人 信息
     * @return 结果
     */
    public int updateKuaishouPromoter(KuaishouPromoter kuaishouPromoter);

    /**
     * 删除快手达人 信息
     *
     * @param id 快手达人 信息主键
     * @return 结果
     */
    public int deleteKuaishouPromoterById(Long id);

    /**
     * 批量删除快手达人 信息
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteKuaishouPromoterByIds(Long[] ids);

    KuaishouPromoter getOneByIdAndPromoterId(@Param("userId") Long userId, @Param("promoterId") String promoterId);

    JSONObject getNearlyMonthGmv(@Param("promoterId") String promoterId, @Param("start") String start, @Param("end") String end);

    void insertKuaishouPromoterRecord(JSONObject record);

    List<String> selectPromoterIdList(@Param("userList") List<Long> userList, @Param("mediaId") String mediaId);

    JSONObject getgetMonthPromoterTotal(@Param("userList") List<Long> userList, @Param("start") String start, @Param("end") String end, @Param("mediaId") String mediaId);

    void updateKuaishouPromoterByPromoterId(KuaishouPromoter promoters);

    List<JSONObject> selectAllPromoterList(@Param("userId") Long userId, @Param("promoterId") String promoterId, @Param("promoterNickName") String promoterNickName, @Param("status") String status, @Param("parameter") String parameter, @Param("orderBy") String orderBy);

    List<KuaishouPromoter> getFailInfo();

    List<JSONObject> getBoundPromoterRoleKey(@Param("promoterId") String promoterId);

    int addFollowUpRecords(@Param("result") JSONObject result);

    void updateFollowUpRecords(@Param("result") JSONObject result);

    JSONObject getFollowUpRecordsByUserId(@Param("promoterId") String promoterId, @Param("userId") Long userId);

    List<JSONObject> getFollowUpRecordListByPromoterId(@Param("promoterId") String promoterId, @Param("id") Long id);

    int deletePromoterLabel(@Param("promoterId") String promoterId, @Param("userId") Long userId);

    void insertPromoterLabels(@Param("list") List<JSONObject> list);

    List<JSONObject> getPromoterLabel(@Param("promoterId") String promoterId, @Param("userId") Long userId);


    KuaishouPromoter getOnlyPromoterInfoByUserId(@Param("promoterId") String promoterId, @Param("userId") Long userId);

    Integer getUserPromotersCount(@Param("userId") Long userId, @Param("mediaId") String mediaId);

    Integer getBoundCount(@Param("userId") Long userId);

    Integer addPromotersCount(@Param("userId") Long userId, @Param("promotersCount") Long promotersCount, @Param("mediaId") String mediaId);

    String getRuleName(@Param("ruleId") Long ruleId);

    int addRule(@Param("promoterId") String promoterId, @Param("ruleId") Long ruleId, @Param("ruleName") String ruleName);

    List<String> selectPromoterIdListByTime(@Param("userList") List<Long> userList, @Param("startDate") Long startDate, @Param("endDate") Long endDate);

    KuaishouPromoter getOneByIdAndPromoterId3(@Param("userId") Long userId, @Param("promoterId") String promoterId);

    void insertKuaishouPromoter3(JYKuaishouPromoter promoter);

    void updateKuaishouPromoterByPromoterId3(JYKuaishouPromoter kuaishouPromoter);

    int updateKuaishouPromoter3(JYKuaishouPromoter kuaishouPromoter);

    JYKuaishouPromoter selectKuaishouPromoterById3(Long id);

    void deleteKuaishouPromoterById3(Long id);

    List<JYKuaishouPromoter> getFailInfo3();
}