<?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.CarMochaitomMapper">

    <resultMap id="carMochaitomMap" type="com.tofly.pojo.car.CarMochaitom">
        <id property="id" column="ID"/>
        <result property="monthMileage" column="MONTH_MILEAGE"/>
        <result property="createTime" column="CREATE_TIME"/>
        <result property="createUser" column="CREATE_USER"/>
        <result property="delFlag" column="DEL_FLAG"/>
        <result property="useTime" column="USE_TIME"/>
        <result property="carMileage" column="CAR_MILEAGE"/>
        <result property="monthOil" column="MONTH_OIL"/>
        <result property="maintenanceCost" column="MAINTENANCE_COST"/>
        <result property="oilCost" column="OIL_COST"/>
        <result property="parkingCost" column="PARKING_COST"/>
        <result property="washingCost" column="WASHING_COST"/>
        <result property="carId" column="CAR_ID"/>
        <result property="note" column="NOTE"/>
        <association property="createUserName"  column="CREATE_USER" select="com.tofly.gpsboot.mapper.plan.HydrantrecordMapper.getRealName" ></association>
        <association property="carNumber" column="CAR_ID" select="getcarNumber"/>
    </resultMap>


    <select id="getcarNumber" resultType="java.lang.Object">
      select CAR_NUMBER as carNumber from tf_car_baseinfo where id = #{carId}
    </select>

</mapper>
