package cn.iocoder.yudao.module.train.mapper;

import cn.iocoder.yudao.module.train.entity.DriveSchoolCoachClock;
import cn.iocoder.yudao.module.train.vo.*;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 教练打卡表 Mapper 接口
 *
 * @author author
 * @since 2025-07-16
 */
@Mapper
public interface DriveSchoolCoachClockMapper extends BaseMapper<DriveSchoolCoachClock> {

    IPage<DriveSchoolCoachClockVO> queryListPage(@Param("entity") DriveSchoolCoachClockVO pageReqVO, Page<DriveSchoolCoachClockVO> page);

    /**
     * 统计训练车辆台次
     */
    TrainCarCountVO countTrainCar(@Param("entity") TrainCarCountVO trainCarCountVO);

    List<TrainCarCountVO> trainClockByCar(@Param("entity") TrainCarCountVO trainCarCountVO);

    List<DriveSchoolCoachClock> selectCoachClockIdsByCarId(@Param("entity") TrainDetailsByCarVO trainDetailsByCarVO);

    /**
     * 获取未进行离场打卡的教练userId列表
     * @return
     */
    List<DriveSchoolCoachClock> noClockInRemind();

    /**
     * 导出数据获取
     */
    IPage<CoachClockExportVO> coachClockExport(@Param("entity") CoachClockExportVO coachClockExportVO, Page<CoachClockExportVO> page);


    CloakAndTrainCountVO getTrainStudentCount(@Param("entity") CloakAndTrainCountVO cloakAndTrainCountVO);
    CloakAndTrainCountVO getTrainCarCount(@Param("entity") CloakAndTrainCountVO cloakAndTrainCountVO);


    /**
     *  获取当日实时训练情况
     */
    CloakAndTrainCountVO getTodayTrainSituation();


    /**
     * 获取正在训练的车辆信息
     */
    List<DriveSchoolCoachClockVO> getTodayCarTrainSituation(@Param("entity") DriveSchoolCoachClock driveSchoolCoachClock);

    /**
     * 根据教练id查询当日打卡记录的车牌号列表
     */
    List<String> getClockCarNoByUserId(@Param("userId") Long userId);
    DriveSchoolCoachClock getClockCarInfoByUserId(@Param("userId") Long userId, @Param("carNo") String carNo);

    IPage<DriveSchoolCoachClockVO> queryErrorClockListPage(@Param("entity") DriveSchoolCoachClockVO pageReqVO, Page<DriveSchoolCoachClockVO> page);



}
