<?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.unis.mobileInfo.modular.gsqCarQueue.mapper.GsqCarQueueMapper">
    <select id="getSortList" parameterType="integer" resultType="com.unis.mobileInfo.modular.gsqCarQueue.param.GsqCarQueueEditParam">
        SELECT
            gcq.id,
            gcq.reservation_register_id reservationRegisterId,
            gcq.sort_no sortNo
        FROM
            biz_gsq_reservation_register grr
        INNER JOIN biz_gsq_car_queue gcq ON grr.id = gcq.reservation_register_id
        WHERE
            grr.org_id = #{orgId}
    </select>
    <select id="getCarDynamicCheck" parameterType="integer" resultType="com.unis.mobileInfo.modular.gsqReservationRegister.entity.GsqReservationRegister">
        SELECT
            grr.id,
            grr.license_plate_number licensePlateNumber,
            gcq.sort_no sortNo,
            grr.driver_name driverName,
            grr.identification_number identificationNumber,
            grr.mobile_number mobileNumber,
            grr.driver_address driverAddress,
            grr.vehicle_type vehicleType,
            dd.DICT_LABEL dictLabel
        FROM
            biz_gsq_reservation_register grr
        INNER JOIN biz_gsq_car_queue gcq ON grr.id = gcq.reservation_register_id
        INNER JOIN dev_dict dd ON grr.vehicle_type = dd.id
        WHERE
            grr.org_id = #{orgId}
        ORDER BY
	        gcq.sort_no
    </select>
</mapper>