package com.gxwebsoft.cms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gxwebsoft.cms.entity.LeadDispatch;
import com.gxwebsoft.cms.param.CustomerLeadParam;
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 LeadDispatchMapper extends BaseMapper<LeadDispatch> {

    /**
     * 查询客资的派单历史
     */
    List<LeadDispatch> selectDispatchHistory(@Param("leadId") Integer leadId);

    /**
     * 查询业务员的派单记录
     */
    List<LeadDispatch> selectSalesmanDispatches(CustomerLeadParam param);

    /**
     * 查询今日派单数量
     */
    Integer countTodayDispatches(@Param("adminId") Integer adminId);
}
