<?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.xxfc.platform.order.mapper.OrderRentVehicleDetailMapper">

    <select id="listByOrderId" parameterType="Integer" resultType="com.xxfc.platform.order.entity.OrderRentVehicleDetail">
        select *
        from order_rent_vehicle_detail
        where order_id = #{orderId}
    </select>

    <select id="oneByOrderId" parameterType="Integer" resultType="map">
        select *
        from order_rent_vehicle_detail
        where order_id = #{orderId} limit 1 offset 0;
    </select>

    <select id="getPScore" resultType="Integer" >
        SELECT round(IFNULL (AVG(score),0)) score  FROM  order_rent_vehicle_detail  WHERE model_id=#{modelId}
     </select>
</mapper>