package com.huiju.estateagents.statistic.mapper;

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

import java.time.LocalDate;
import java.util.List;

/**
 * <p>
 * 用户来源统计表  Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2020-01-04
 */
@Mapper
public interface TsPersonFromStatisticMapper extends BaseMapper<TsPersonFromStatistic> {

    void insertStatisticList(List<TsPersonFromStatistic> list);

    List<TsPersonFromStatistic> selectPersonFrom(@Param("orgId") Integer orgId, @Param("startDate") LocalDate startDate, @Param("endDate") LocalDate endDate);

    List<TsPersonFromStatistic> selectPersonFromGroupByDay(@Param("orgId") Integer orgId, @Param("startDate") LocalDate startDate, @Param("endDate") LocalDate endDate);

    List<TsPersonFromStatistic> selectPersonFromGroupByData(@Param("orgId") Integer orgId, @Param("startDate") LocalDate startDate, @Param("endDate") LocalDate endDate);

    void deleteByData();

    List<TsPersonFromStatistic> selectNewLinePersonFromGroupByData(@Param("orgId") Integer orgId,@Param("startDate") LocalDate startDate,@Param("endDate") LocalDate endDate);
}
