<?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.WcxNoticeFileMapper">

    <insert id="batchInsert">
        INSERT INTO wcx_notice_file
        (
        file_id,
        file_url,
        file_type,
        notice_id,
        status,
        create_date
        )
        VALUES
            (
            #{wcxFiles.fileId},
            #{wcxFiles.fileUrl},
            #{wcxFiles.fileType},
            #{wcxFiles.noticeId},
            #{wcxFiles.status},
            #{wcxFiles.createDate}
            )
    </insert>

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

    <update id="update">
         UPDATE  wcx_notice_file SET file_url = #{fileUrl}
       WHERE notice_id = #{noticeId}
    </update>
    <update id="updateDelete">
         UPDATE  wcx_notice_file SET status = 0
       WHERE notice_id = #{noticeId}
    </update>
</mapper>