package com.ycwl.basic.mapper;

import com.ycwl.basic.model.pc.broker.entity.BrokerRecord;
import com.ycwl.basic.model.pc.broker.req.BrokerRecordReqQuery;
import com.ycwl.basic.model.pc.broker.resp.BrokerRecordRespVO;
import com.ycwl.basic.model.pc.broker.resp.DailySummaryRespVO;
import org.apache.ibatis.annotations.Mapper;

import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.HashMap;
import java.util.List;

/**
 * @Author：longbinbin
 * @Date：2024/12/12 10:00
 */
@Mapper
public interface BrokerRecordMapper {
    List<BrokerRecordRespVO> list(BrokerRecordReqQuery brokerRecordReqQuery);

    BrokerRecordRespVO getById(Long id);

    int add(BrokerRecord brokerRecord);

    int deleteById(Long id);

    int deleteByOrderId(Long orderId);

    int update(BrokerRecord brokerRecord);

    List<DailySummaryRespVO> getDailySummaryByBrokerId(Long brokerId, Date startTime, Date endTime);

    /**
     * 按日期统计分销员订单数据（不含扫码统计，已迁移到 ClickHouse）
     */
    List<HashMap<String, Object>> getDailyOrderStats(@Param("brokerId") Long brokerId,
                                                     @Param("startTime") Date startTime,
                                                     @Param("endTime") Date endTime);
}