<?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="org.springblade.business.mapper.UserOpinionFileMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="userOpinionFileResultMap" type="org.springblade.business.entity.UserOpinionFile">
        <result column="id" property="id"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>
        <result column="user_opinion_id" property="userOpinionId"/>
        <result column="file_url" property="fileUrl"/>
    </resultMap>

    <select id="selectUserOpinionFileByUserOpinionKeys" resultMap="userOpinionFileResultMap">
        select file_url,user_opinion_id from u_user_opinion_file where is_deleted= 0 and user_opinion_id in
        <foreach collection="userOpinionKeys" item="key" open="(" separator="," close=")">
            #{key}
        </foreach>
    </select>

    <select id="selectUserOpinionFilePage" resultMap="userOpinionFileResultMap">
        select * from u_user_opinion_file where is_deleted = 0
    </select>

</mapper>
