<?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.jeeplus.pubmodules.knowledge.mapper.KnowledgeShareVisitMapper">
    <select id="selectByDetailId" resultType="com.jeeplus.pubmodules.knowledge.domain.KnowledgeShareVisit">
        select
            sv.user_id,
            sv.first_time,
            sv.last_time,
            sv.num,
            su.name as userName
        from knowledge_share_visit sv
        left join sys_user su on sv.user_id=su.id
        where sv.detail_id=#{id} and sv.del_flag=0
        order By sv.last_time DESC limit #{size}
    </select>
</mapper>