package com.huiju.estateagents.statistic.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huiju.estateagents.statistic.entity.TsCustomerStatisticMonthly;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 客户分析月统计表 小程序盘客工具客户分析 Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2019-11-08
 */
@Mapper
public interface TsCustomerStatisticMonthlyMapper extends BaseMapper<TsCustomerStatisticMonthly> {
	
	/**
	 * 获取一个月新增客户的数据插入
	 * @param nowDate
	 * @param status
	 * @return
	 */
	List<TsCustomerStatisticMonthly> getNewCustomerStatisticMonthly(@Param("nowDate") LocalDateTime nowDate, @Param("status") int status);
	
	/**
	 * 获取一个月跟进客户数据插入
	 * @param nowDate
	 * @return
	 */
	List<TsCustomerStatisticMonthly> getFollowUpStatisticMonthly(@Param("nowDate") LocalDateTime nowDate);
	
	/**
	 * 获取一个月访问客户数据插入
	 * @param nowDate
	 * @param checkin
	 * @return
	 */
	List<TsCustomerStatisticMonthly> getVisiteStatisticMonthly(@Param("nowDate") LocalDateTime nowDate, @Param("checkin") int checkin);
	
	/**
	 * 获取12个月的统计数据
	 * @param customerType
	 * @param orgId
	 * @param nowDate
	 * @param beforeDate
	 * @param personId
	 * @param userId
	 * @return
	 */
	List<TsCustomerStatisticMonthly> getMonthlyList(@Param("customerType") String customerType, @Param("orgId") Integer orgId, @Param("nowDate") LocalDateTime nowDate, @Param("beforeDate") LocalDateTime beforeDate, @Param("personId") String personId,@Param("userId") Integer userId);
}
