<?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="cn.com.countrygarden.bi.main.dao.wcx.WcxFileMapper">

    <insert id="batchInsert">
        INSERT INTO wcx_file
        (
        file_id,
        file_url,
        file_name,
        file_type,
        order_no,
        innovation_id,
        status,
        create_date
        )
        VALUES
        <foreach collection="list" index="index" item="record" separator="," >
            (
            #{record.fileId},
            #{record.fileUrl},
            #{record.fileName},
            #{record.fileType},
            #{record.orderNo},
            #{record.innovationId},
            #{record.status},
            #{record.createDate}
            )
        </foreach>
    </insert>

    <select id="findFileUrlByInnoInfo" resultType="string">
        SELECT file_url FROM wcx_file WHERE innovation_id = #{innoId} AND file_type = #{fileType} ORDER BY order_no ASC
    </select>
</mapper>