<?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.sckw.fleet.dao.KwfFleetDriverMapper">

    <select id="findByTruckDriver" resultType="com.sckw.fleet.model.KwfFleetDriver" parameterType="com.sckw.fleet.model.KwfFleetDriver" >
        SELECT
        id, fleet_id fleetId, driver_id driverId, ent_id entId, remark, status, create_by createBy, create_time createTime,
        update_by updateBy, update_time updateTime FROM kwf_fleet_driver
        where del_flag = 0
        and driver_id = #{driverId, jdbcType=VARCHAR}
        and ent_id = #{entId, jdbcType=VARCHAR}
    </select>

    <select id="findByFleetDriver" resultType="com.sckw.fleet.model.KwfFleet" >
        SELECT
        fleet_id id, fl.name
        FROM kwf_fleet_driver fld
        left join kwf_fleet fl on fl.id = fld.fleet_id
        where fld.del_flag = 0
        and driver_id = #{driverId, jdbcType=VARCHAR}
        and fld.ent_id = #{entId, jdbcType=VARCHAR}
    </select>
</mapper>
