<?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.feesapi.file.mapper.FileMapper">
    <resultMap id="fileMap" type="com.tofly.feesapi.file.entity.File">
        <id property="id" column="ID"/>
        <result property="tableName" column="TABLE_NAME"/>
        <result property="tableBh" column="TABLE_BH"/>
        <result property="fileXh" column="FILE_XH"/>
        <result property="fileNote" column="FILE_NOTE"/>
        <result property="fileOldFn" column="FILE_OLD_FN"/>
        <result property="fileNewFn" column="FILE_NEW_FN"/>
        <result property="fileSize" column="FILE_SIZE"/>
        <result property="czry" column="CZRY"/>
        <result property="czsj" column="CZSJ"/>
    </resultMap>
    <select id="getFileList" resultMap="fileMap">
        select * from sys_upfiles
        <where>
            <if test="tableids != null">
                and table_bh in
                <foreach item="fileId" collection="tableids.split(',')" open="(" separator="," close=")">
                    #{fileId}
                </foreach>
            </if>
            <if test="tableName != null">
                and table_name = #{tableName}
            </if>
        </where>
    </select>
</mapper>
