<?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.custom.mapper.CustomCarTypeMapper">

    <resultMap id="typeMap" type="com.tofly.pojo.car.cusom.CustomCarType">
        <id property="id" column="ID"/>
        <result property="name" column="NAME"/>
        <result property="delFlag" column="DEL_FLAG"/>
        <result property="createTime" column="CREATE_TIME"/>
        <result property="createUser" column="CREATE_USER"/>
        <result property="notes" column="NOTES"/>
        <association property="createUserName" column="CREATE_USER"
                     select="com.tofly.gpsboot.mapper.plan.HydrantrecordMapper.getRealName"></association>
    </resultMap>

    <select id="pageByName" resultMap="typeMap" parameterType="java.lang.String">
        select * from tf_car_type t where 1=1
        <if test="name != null and name.trim() != ''">
            and (t.NAME like '%'||#{name}||'%')
        </if>
    </select>
</mapper>