package com.njzscloud.supervisory.biz.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njzscloud.supervisory.biz.pojo.entity.TruckLocationTrackEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 车辆定位数据
 */
@Mapper
public interface TruckLocationTrackMapper extends BaseMapper<TruckLocationTrackEntity> {

    @Select("SELECT b.gps\n" +
            "FROM order_info a\n" +
            "         INNER JOIN biz_truck b ON b.id = a.truck_id AND b.deleted = 0\n" +
            "WHERE a.id = #{orderId}\n" +
            "  AND a.deleted = 0")
    String gpsId(@Param("orderId") Long orderId);
}
