1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?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.tanpu.community.dao.mapper.community.VisitLogMapper">
<!-- 通用查询映射结果 -->
<sql id="Base_Column_List">
id,
ident,
visitor_id,
author_id,
ref_id,
ref_type,
duration,
create_time,
update_time,
delete_tag
</sql>
<resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.VisitLogEntity">
<id column="id" property="id" />
<result column="ident" property="ident" />
<result column="visitor_id" property="visitorId" />
<result column="author_id" property="authorId" />
<result column="ref_id" property="refId" />
<result column="ref_type" property="refType" />
<result column="duration" property="duration" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="delete_tag" property="deleteTag" />
</resultMap>
<!--auto generated by MybatisCodeHelper on 2022-02-17-->
<select id="queryLastByVisitorIdAndRefId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from visit_log
where visitor_id=#{visitorId} and ref_id=#{refId}
order by update_time desc limit 1
</select>
</mapper>