package com.cpxt.biz.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cpxt.biz.domain.BizDriverState;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
* @author LuoJian
* @description 针对表【biz_driver_state(司机定位状态)】的数据库操作Mapper
* @createDate 2025-01-03 09:28:09
* @Entity com.cpxt.biz.domain.BizDriverState
*/
@Mapper
public interface BizDriverStateMapper extends BaseMapper<BizDriverState> {

    int insertBizDriverState(BizDriverState bizDriverState);

    List<Map> selectDriverTrack(@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("tableName") String tableName);

    @Select("SELECT * FROM biz_driver_state WHERE id in (SELECT t.id FROM (SELECT id,MAX(gps_time) FROM biz_driver_state GROUP BY driver_id) t)")
    List<BizDriverState> selectDriverLocation();
}




