<?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.tofly.gpsboot.mapper.car.CarRepairMapper">

    <resultMap id="carRepairMap" type="com.tofly.pojo.car.CarRepair">
        <id property="id" column="ID"/>
        <result property="carId" column="CAR_ID"/>
        <result property="repairPer" column="REPAIR_PER"/>
        <result property="repairDate" column="REPAIR_DATE"/>
        <result property="repairType" column="REPAIR_TYPE"/>
        <result property="carMileage" column="CAR_MILEAGE"/>
        <result property="createTime" column="CREATE_TIME"/>
        <result property="createUser" column="CREATE_USER"/>
        <result property="carPic" column="CAR_PIC"/>
        <result property="delFlag" column="DEL_FLAG"/>
        <result property="factory" column="FACTORY"/>
        <result property="notes" column="NOTES"/>
        <association property="createUserName" column="CREATE_USER"
                     select="com.tofly.gpsboot.mapper.plan.HydrantrecordMapper.getRealName"></association>

        <association property="carNum" javaType="java.lang.String" column="CAR_ID" select="getCarNum"></association>
    </resultMap>

    <select id="getCarNum" resultType="java.lang.String">
        select car_number
        from tf_car_baseinfo
        where del_flag = '1'
          and id = #{carId}
    </select>


</mapper>
