<?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.vctgo.file.mapper.FileReShareInfoMapper">

    <resultMap type="com.vctgo.file.domain.FileReShareInfo" id="FileReShareInfoResult">
        <result property="id" column="id"/>
        <result property="fileShareId" column="file_share_id"/>
        <result property="fileInfoId" column="file_info_id"/>
        <result property="remark" column="remark"/>
        <result property="isDeleted" column="is_deleted"/>
        <result property="createById" column="create_by_id"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="updateById" column="update_by_id"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="tenantId" column="tenant_id"/>
    </resultMap>

    <sql id="selectFileReShareInfoVo">
        select id, file_share_id, file_info_id, remark, is_deleted, create_by_id, create_by, create_time, update_by_id, update_by, update_time, tenant_id from file_re_share_info
    </sql>

    <select id="selectFileReShareInfoList" resultMap="FileReShareInfoResult">
        <include refid="selectFileReShareInfoVo"/>
        <where>
            <if test="query.fileShareId != null ">and file_share_id = #{query.fileShareId}</if>
            <if test="query.fileInfoId != null ">and file_info_id = #{query.fileInfoId}</if>
            <if test="query.isDeleted != null  and query.isDeleted != ''">and is_deleted = #{query.isDeleted}</if>
            <if test="query.createById != null ">and create_by_id = #{query.createById}</if>
            <if test="query.updateById != null ">and update_by_id = #{query.updateById}</if>
            <if test="query.tenantId != null ">and tenant_id = #{query.tenantId}</if>
        </where>
    </select>

    <delete id="deleteFileReShareInfoByIds" parameterType="String">
        delete from file_re_share_info where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
