package com.gxwebsoft.cms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gxwebsoft.cms.entity.LeadFollowLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 客资跟进记录Mapper
 *
 * @author 科技小王子
 * @since 2026-04-14
 */
@Mapper
public interface LeadFollowLogMapper extends BaseMapper<LeadFollowLog> {

    /**
     * 查询客资的跟进历史
     */
    List<LeadFollowLog> selectFollowHistory(@Param("leadId") Integer leadId);

    /**
     * 查询用户的跟进记录
     */
    List<LeadFollowLog> selectUserFollows(@Param("userId") Integer userId, 
                                          @Param("startDate") String startDate,
                                          @Param("endDate") String endDate);

    /**
     * 查询需要跟进的客资(根据下次跟进时间)
     */
    List<Integer> selectNeedFollowLeadIds(@Param("userId") Integer userId);
}
