<?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.upyuns.platform.rs.website.mapper.FileDataMapper">

<select id="selectList" resultType="com.upyuns.platform.rs.website.entity.FileData" parameterType="com.upyuns.platform.rs.website.dto.FileDataDTo">
  SELECT
    fd.id,
    fd.filename,
    fd.filetype,
    fd.filesize,
    fd.gain_id,
    fd.crt_time,
    fd.fileurl,
    fd.storagetype,
    fd.has_gtdata,
    fd.gtdata_path,
    fd.filepath
    FROM
    file_data fd
    LEFT JOIN gain_data gd ON fd.gain_id = gd.id
    WHERE fd.is_del=0
	<if test="gainId !=null and gainId !=''">
        AND fd.gain_id = #{gainId}
    </if>
    </select>
</mapper>