package com.ruixuan.salesLeads.mapper;

import com.ruixuan.salesLeads.pojo.SaleClueInfoPojo;
import com.ruixuan.salesLeads.pojo.TestPojo;
import com.ruixuan.salesLeads.pojo.vo.SaleRecordVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * ***************************************************
 *
 * @Auther: zianY
 * @Descipion: 销售线索
 * @CreateDate: 2022-05-19
 * ****************************************************
 */
public interface SaleClueInfoMapper {


    /**
     * 批量新增销售线索
     * @param saleClueList
     */
    void replaceSaleClueInfoBatch(@Param(value = "saleClueList") List<SaleClueInfoPojo> saleClueList);

    /**
     * 查询销售线索信息
     * @param sellerName 卖家昵称
     * @param uploadDate 上传日期 202205
     * @param distributionSaleFlag 是否分配销售 0-否 1-是
     * @param industryId 行业id
     * @param fansType 粉丝类别
     * @param state 状态 1-未开始 2-进行中 3-已结束
     * @param userId
     * @return
     */
    List<SaleClueInfoPojo> selectSaleClueInfoList(@Param(value = "sellerName") String sellerName,
                                                  @Param(value = "uploadDate") Long uploadDate,
                                                  @Param(value = "distributionSaleFlag") String distributionSaleFlag,
                                                  @Param(value = "industryId") String industryId,
                                                  @Param(value = "fansType") String fansType,
                                                  @Param(value = "state") String state,
                                                  @Param(value = "salesLeadsType") String salesLeadsType,
                                                  @Param(value = "userId") Long userId);

    /**
     *  销售线索 任务 列表信息
     * @param sellerName
     * @param state
     * @param saleId
     * @return
     */
    List<SaleClueInfoPojo> selectSaleClueTaskList(@Param(value = "sellerName") String sellerName,
                                                  @Param(value = "state") Integer state,
                                                  @Param(value = "saleId") Long saleId);


    /**
     * 根据卖家ids 查询销售线索
     * @param sellerIds 卖家id
     * @return
     */
     List<SaleClueInfoPojo> selectSaleClueInfoBySellers(@Param(value = "sellerIds") List<Long> sellerIds);

    /**
     * 修改销售线索 销售人员
     * @param sellerId  卖家id
     * @param saleId 销售id
     * @param distributionSaleFlag 是否分配销售 0-否 1-是
     * @return
     */
     void updateSaleClueSale(@Param(value = "sellerId") Long sellerId, @Param(value = "saleId") Long saleId, @Param(value = "distributionSaleFlag") int distributionSaleFlag);

    /**
     * 修改销售线索 状态
     * @param sellerId 卖家id
     * @param state 进行状态 1-未开始 2-进行中 3-已结束
     */
     void updateSaleClueState(@Param(value = "sellerId") Long sellerId, @Param(value = "state") int state);

    /**
     *  根据销售 查询未完成数量数量
     * @param saleId 销售人员id
     * @return
     */
     int selectSaleClueComplete(@Param(value = "saleId") Long saleId);


    /**
     * 卖家id 查询线索信息
     * @param sellerId 卖家id
     * @return
     */
     SaleRecordVo selectSaleClueInfoBySellerId(@Param(value = "sellerId") Long sellerId);

     SaleRecordVo selectSaleClueInfoById(@Param(value = "id") int id);

    /**
     * 修改销售线索 销售类别 电销或面销
     * @param sellerId 卖家id
     * @param offlineSaleFlag 类型 1-电销 2-面销
     * @param saleId 销售
     */
     void updateSaleClueOfflineFlag(@Param(value = "sellerId") Long sellerId,@Param(value = "offlineSaleFlag") int offlineSaleFlag,@Param(value = "saleId") Long saleId);

    /**
     * 修改销售线索 导入电话记录的状态
     * @param id 销售线索的id
     * @param importPhoneFlag  是否导入电话记录 0-否 1-是
     */
     void updateSaleClueImportPhoneFlag(@Param(value = "id") Long id,@Param(value = "importPhoneFlag") int importPhoneFlag);





}
