<?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.bonus.canteen.core.bus.mapper.BusLineMapper">

    <select id="queryBusLineAndDeviceList" resultType="com.bonus.canteen.core.bus.vo.BusDeviceVO">
        SELECT t1.line_id,
               t3.device_id,
               t3.device_sn,
               t3.device_name,
               t3.device_num
        FROM bus_line t1
                 LEFT JOIN bus_device_info t2 ON t1.line_id = t2.line_id
                 LEFT JOIN device_info t3 ON t2.device_id = t3.device_id
        WHERE t1.del_flag = 2
          and t2.del_flag = 2
          and t1.line_id = #{lineId}
    </select>
</mapper>
