DiskReceivedMapper.xml 1.89 KB
Newer Older
284718418@qq.com committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<?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.timer.api.dao.disk.DiskReceivedMapper">

	<!-- 可根据自己的需求,是否要使用 -->
    <resultMap type="cn.timer.api.bean.disk.DiskReceived" id="BaseResultMap">
        <id property="id" column="id"/>
        <result property="shareId" column="share_id"/>
        <result property="filesId" column="files_id"/>
        <result property="title" column="title"/>
        <result property="filePath" column="file_path"/>
        <result property="fileSize" column="file_size"/>
        <result property="userId" column="user_id"/>
        <result property="userName" column="user_name"/>
        <result property="deleteFlag" column="delete_flag"/>
        <result property="createTime" column="create_time"/>
        <result property="updateTime" column="update_time"/>
19

284718418@qq.com committed
20 21
    </resultMap>

22 23

    <select id="queryDiskReceived" resultType="cn.timer.api.dto.disk.DiskFilesDto">
24
        SELECT
25 26 27 28 29 30 31 32 33
            df.id,
            df.show_size,
            df.file_type,
            df.url_path,
            dfi.url,
            dr.id obj_id,
            dr.title,
            dr.update_time,
            dr.user_name
34 35 36 37
        FROM
        `disk_received` dr
        LEFT JOIN `disk_files` df ON dr.`files_id` = df.`id`
        LEFT JOIN disk_file_image dfi ON df.file_type = dfi.type
龙于生 committed
38 39 40
        LEFT JOIN disk_catalogue_files dcf ON df.id = dcf.files_id
        LEFT JOIN disk_catalogue dc ON dc.id = dcf.catalogue_id
        WHERE dc.org_id=#{orgId} AND dr.user_id = #{diskReceived.userId} and dr.delete_flag = 0
41 42 43 44 45 46
        <if test="diskReceived.title != null and diskReceived.title != '' and diskReceived.title != 'null'">
            and dr.title LIKE CONCAT('%',#{diskReceived.title},'%')
        </if>
        ORDER BY dr.`create_time` DESC
    </select>

284718418@qq.com committed
47
</mapper>