EsWordDefMapper.xml
2.09 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
40
41
42
43
44
45
46
47
48
49
50
51
52
<?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.EsWordDefMapper">
<insert id="insert" parameterType="com.yoho.search.dal.model.EsWordDef" timeout="20000">
insert ignore into es_word_def (id, word_type, word, status, last_update_time)
values (#{id, jdbcType=INTEGER},#{wordType, jdbcType=INTEGER},#{word, jdbcType=VARCHAR},#{status, jdbcType=INTEGER},#{lastUpdateTime, jdbcType=INTEGER})
</insert>
<insert id="insertBatch" parameterType="java.util.List" timeout="20000">
insert ignore into es_word_def (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="selectCountByPrimaryKey" resultType="java.lang.Integer"
parameterType="java.lang.Integer" timeout="20000">
select count(id) COUNT from es_word_def where id = #{id, jdbcType=INTEGER} LIMIT 1
</select>
<select id="selectByWordType" resultType="java.lang.String"
timeout="20000">
select word from es_word_def where word_type = #{wordType, jdbcType=INTEGER}
</select>
<update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.EsWordDef" timeout="20000">
update es_word_def
set word_type = #{wordType,jdbcType=INTEGER},
word = #{word, jdbcType=VARCHAR},
status = #{status, jdbcType=INTEGER},
last_update_time = #{lastUpdateTime, jdbcType=INTEGER}
where id = #{id, jdbcType=INTEGER}
</update>
<update id="updateStatusBatch" timeout="60000">
update es_word_def set status = #{status, jdbcType=INTEGER},
last_update_time = #{lastUpdateTime, jdbcType=INTEGER}
where word in
<foreach item="item" index="index" collection="list" open="("
separator="," close=")">
#{item}
</foreach>
</update>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" timeout="20000">
delete from es_word_def where id = #{id, jdbcType=INTEGER}
</delete>
</mapper>