<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bs.tm.mapper.TmVehicleMapper">

    <select id="selectTmVehicleList" resultType="com.bs.tm.domain.TmVehicle">
        select a.*, b.DRIVER_NAME, c.cust_name
        from tm_vehicle a
                 left join tm_driver b on a.driver_id = b.driver_id
                 left join cm_cust c on a.cust_id = c.id
            ${ew.customSqlSegment}
    </select>

    <select id="selectTmVehicleById" resultType="com.bs.tm.domain.TmVehicle">
        select a.*, b.DRIVER_NAME, c.cust_name
        from tm_vehicle a
                 left join tm_driver b on a.driver_id = b.driver_id
                 left join cm_cust c on a.cust_id = c.id
        where a.id = #{id}

    </select>


</mapper>
