package com.yunzhi.marketing.xlk.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yunzhi.marketing.dto.StatisticsDTO;
import com.yunzhi.marketing.po.CustomerRankListVO;
import com.yunzhi.marketing.po.MineRecommendCustomerPO;
import com.yunzhi.marketing.po.TaRecommendCustomerPO;
import com.yunzhi.marketing.xlk.dto.RecommendCustomerDTO;
import com.yunzhi.marketing.xlk.entity.ChannelCustomer;
import com.yunzhi.marketing.xlk.vo.CustomerDetailVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 渠道报备客户表  Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2021-07-19
 */
@Mapper
public interface ChannelCustomerMapper extends BaseMapper<ChannelCustomer> {

    IPage<ChannelCustomer> getProfileList(IPage<ChannelCustomer> pg,
                                          @Param("orgId") Integer orgId,
                                          @Param("buildingId") String buildingId,
                                          @Param("name") String name,
                                          @Param("phone") String phone,
                                          @Param("recommendPersonName") String recommendPersonName,
                                          @Param("recommendPhone") String recommendPhone,
                                          @Param("status") String status,@Param("type") String type,
                                          @Param("institutionIds") List<String> institutions);

    List<CustomerRankListVO> getRanklist(@Param("params") StatisticsDTO statisticsDTo);

    IPage<MineRecommendCustomerPO>  getCustomersIRecommended(IPage<MineRecommendCustomerPO> page,@Param("params") RecommendCustomerDTO recommendCustomerDTO);

    /**
     * 新增客户
     * @param statisticsDTo
     * @return
     */
    int getNewCustomer(@Param("params") StatisticsDTO statisticsDTo);

    /**
     *
     * @param statisticsDTo
     * @return
     */
    int getSuccessCustomer(@Param("params") StatisticsDTO statisticsDTo);

    List<CustomerDetailVO> getNewCustomerDetail(@Param("params") StatisticsDTO statisticsDTo);

    List<CustomerDetailVO> getSuccessCustomerDetail(@Param("params") StatisticsDTO statisticsDTo);

    ChannelCustomer getMoreInfoById(String id);
}
