<?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.vehicle.mapper.VehicleUserScoreMapper">

    <!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.xxfc.platform.vehicle.entity.VehicleUserScore" id="vehicleUserScoreMap">
        <result property="id" column="id"/>
        <result property="userId" column="user_id"/>
        <result property="orderId" column="order_id"/>
        <result property="modelId" column="model_id"/>
        <result property="type" column="type"/>
        <result property="aveScore" column="ave_score"/>
        <result property="scores" column="scores"/>
        <result property="isAnony" column="is_anony"/>
        <result property="comment" column="comment"/>
        <result property="imgs" column="imgs"/>
        <result property="status" column="status"/>
        <result property="crtTime" column="crt_time"/>
        <result property="updTime" column="upd_time"/>
        <result property="isDel" column="is_del"/>
    </resultMap>

    <select id="findVehicleUserScoreDetailByOrderId"
            resultType="com.xxfc.platform.vehicle.pojo.dto.VehicleUserScoreDetailDTO">
SELECT vus.user_id as `userId`,vus.ave_score as `aveScore`,vus.comment as `comment`, vus.imgs as `imgs`,vus.crt_time as `crtTime`,vus.scores as `scores`,vm.name as `modelName`,vm.keyword as `modelKeyWorld`
FROM `vehicle_user_score` as `vus` left JOIN `vehicle_model` as `vm` on vus.model_id=vm.id WHERE vus.order_id=#{orderId} ;
    </select>
</mapper>