<?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.zxdmy.excite.system.mapper.cloud.trace.CloudFileTraceMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.zxdmy.excite.system.entity.cloud.trace.CloudFileTrace">
        <id column="id" property="id" />
        <result column="trace_name" property="traceName" />
        <result column="trace_creator_id" property="traceCreatorId" />
        <result column="trace_creator_name" property="traceCreatorName" />
        <result column="create_time" property="createTime" />
        <result column="file_id" property="fileId" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, trace_name, trace_creator_id, trace_creator_name, create_time, file_id
    </sql>


    <select id="queryByPage" resultType="com.zxdmy.excite.system.entity.vo.trace.CloudFileTraceVo" >
        select c.*,f.file_oss from cloud_file_trace c
        left join cloud_file f on c.file_id = f.id
        order by c.create_time Desc
        LIMIT #{page},#{size};
    </select>

    <select id="queryByPageCount" resultType="java.lang.Integer">
        select count(*) from cloud_file_trace c
        left join cloud_file f on c.file_id = f.id
    </select>
</mapper>
