<?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.plan.TfYwpnPlanCartouserMapper">

  <resultMap id="tfYwpnPlanCartouserMap" type="com.tofly.pojo.plan.TfYwpnPlanCartouser">
                <id property="id" column="ID"/>
                      <result property="userId" column="USER_ID"/>
                      <result property="carId" column="CAR_ID"/>
                      <result property="startDate" column="START_DATE"/>
                      <result property="endDate" column="END_DATE"/>
                      <result property="planId" column="PLAN_ID"/>
                      <result property="planChildId" column="PLAN_CHILD_ID"/>
                      <result property="createUser" column="CREATE_USER"/>
                      <result property="createTime" column="CREATE_TIME"/>
                  <association property="userIdName"  column="USER_ID" select="com.tofly.gpsboot.mapper.plan.HydrantrecordMapper.getRealName" ></association>
                  <association property="createUserName"  column="CREATE_USER" select="com.tofly.gpsboot.mapper.plan.HydrantrecordMapper.getRealName" ></association>
                  <association property="isBind"  column="CAR_ID" select="getIsBind" ></association>
  </resultMap>

    <select id="getIsBind" resultType="String">
        select IS_BIND isBind
        FROM TF_CAR_BASEINFO
        where id = #{carId}
    </select>
                                                        
</mapper>
