<?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.xrtygis.mapper.TfCameraTypeMapper">

    <resultMap id="tfCameraTypeMap" type="com.tofly.xrtygis.entity.TfCameraType">
        <id property="id" column="ID"/>
        <result property="name" column="NAME"/>
        <result property="parentId" column="PARENT_ID"/>
        <result property="showNum" column="SHOW_NUM"/>
        <result property="createUser" column="CREATE_USER"/>
        <result property="createTime" column="CREATE_TIME"/>
        <result property="updateTime" column="UPDATE_TIME"/>
        <result property="updateUser" column="UPDATE_USER"/>
        <association property="createUserName" column="CREATE_USER"
                     select="com.tofly.xrtygis.mapper.IFileMapper.getUserName"/>
        <association property="updateUserName" column="UPDATE_USER"
                     select="com.tofly.xrtygis.mapper.IFileMapper.getUserName"/>
    </resultMap>

    <select id="getTypeList" resultType="string">

        SELECT id
        FROM tf_camera_type t
        START WITH t.id in
        <foreach item="nodeCodestr" collection="typeIds.split(',')" open="(" separator="," close=")">
            #{nodeCodestr}
        </foreach>

        CONNECT BY PRIOR t.ID = t.parent_id
    </select>

</mapper>
