<?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.keyware.shandan.system.mapper.SysFileMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.keyware.shandan.system.entity.SysFile">
        <id column="ID" property="id"/>
        <result column="FILE_NAME" property="fileName"/>
        <result column="FILE_SUFFIX" property="fileSuffix"/>
        <result column="FILE_TYPE" property="fileType"/>
        <result column="FILE_SIZE" property="fileSize"/>
        <result column="PATH" property="path"/>
        <result column="CREATE_USER" property="createUser"/>
        <result column="CREATE_TIME" property="createTime"/>
        <result column="MODIFY_USER" property="modifyUser"/>
        <result column="MODIFY_TIME" property="modifyTime"/>
        <result column="REMARK" property="remark"/>

        <result column="ENTRYSTAFF" property="entryStaff"/>
        <result column="EQUIPMENTMODEL" property="equipmentModel"/>
        <result column="INPUTDATE" property="inputDate"/>
        <result column="SOURCE" property="source"/>
        <result column="TASKCODE" property="taskCode"/>
        <result column="TASKNATURE" property="taskNature"/>
        <result column="TROOPCODE" property="troopCode"/>
        <result column="TARGETNUMBER" property="targetNumber"/>
        <result column="MISSILENUMBER" property="missileNumber"/>

        <collection property="labels" column="ID" select="com.keyware.shandan.bianmu.mapper.LabelEntityMapper.selectByEntityId"/>
    </resultMap>
    <select id="listByDirId" resultType="com.keyware.shandan.system.entity.SysFile"
            parameterType="java.lang.String">
        select F.*
        from B_DIRECTORY D
                 left join SYS_FILE F on F.ID = D.RESOURCE_ID
        where D.DIRECTORY_TYPE = 'FILE'
          and D.PARENT_ID = #{dirId}
          and F.ID is not null
    </select>
</mapper>
