<?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.gz.mapper.archive.ArchiveFileMapper">

    <select id="selectFileAndJnml" resultType="com.gz.rvo.archive.ArchiveFileRVO" parameterType="com.gz.vo.archive.SearchArchiveFileVO">
        SELECT af.*,sa.tm jnml FROM `tab_archive_file` af left join tab_secondary_archive sa on af.secondary_archive_id = sa.id
    <where>
        <if test="archiveId != null and archiveId != ''">
            AND af.archive_id = #{archiveId}
        </if>
        AND file_type = 0
        AND af.deleted = 0
    </where>
        ORDER BY sa.sxh asc
    </select>

</mapper>
