DynSegWordMapper.xml
1.42 KB
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.yoho.search.dal.DynSegWordMapper">
<resultMap id="DynSegWordResultMap" type="com.yoho.search.dal.model.DynSegWord">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="word_type" property="wordType" jdbcType="INTEGER" />
<result column="word" property="word" jdbcType="VARCHAR" />
<result column="last_update_time" property="lastUpdateTime"
jdbcType="INTEGER" />
</resultMap>
<sql id="DynSegWord_Column_List">
id, word_type, word, last_update_time
</sql>
<insert id="insertBatch" parameterType="java.util.List" timeout="20000">
insert ignore into dyn_seg_word (word_type, word, last_update_time)
values
<foreach collection="list" item="item" index="index"
separator=",">
(#{item.wordType,jdbcType=INTEGER},
#{item.word,jdbcType=VARCHAR},
#{item.lastUpdateTime,jdbcType=INTEGER})
</foreach>
</insert>
<select id="selectByWordType" resultMap="DynSegWordResultMap"
timeout="20000">
select
<include refid="DynSegWord_Column_List" />
from dyn_seg_word where word_type = #{wordType,jdbcType=INTEGER}
</select>
<select id="selectWordsCount" resultType="java.lang.Integer"
timeout="20000">
SELECT count(1) FROM dyn_seg_word where
last_update_time >=
#{updateSinceThisTime,jdbcType=INTEGER} LIMIT 1
</select>
</mapper>