SuggestConversionMapper.xml
1.87 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
<?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.SuggestConversionMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.SuggestConversion">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="source" property="source" jdbcType="VARCHAR" />
<result column="dest" property="dest" jdbcType="VARCHAR" />
<result column="update_time" property="updateTime" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List">
id, source, dest, update_time
</sql>
<select id="selectTotalCount" resultType="java.lang.Integer" timeout="20000">
SELECT count(1) FROM suggest_conversion
</select>
<select id="selectPageList" resultMap="BaseResultMap" timeout="20000">
select
<include refid="Base_Column_List" />
from suggest_conversion limit #{offset},#{pageSize}
</select>
<select id="selectBySource" resultMap="BaseResultMap" timeout="20000">
select
<include refid="Base_Column_List" />
from suggest_conversion where source = #{source,jdbcType=VARCHAR}
</select>
<select id="selectAll" resultMap="BaseResultMap" timeout="20000">
select * from suggest_conversion
</select>
<insert id="insertBatch" parameterType="java.util.List" timeout="20000">
insert ignore into suggest_conversion (source, dest, update_time)
values
<foreach collection="list" item="item" index="index"
separator=",">
(#{item.source, jdbcType=VARCHAR},
#{item.dest, jdbcType=VARCHAR},
#{item.updateTime, jdbcType=INTEGER})
</foreach>
</insert>
<update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.SuggestConversion" timeout="20000">
update suggest_conversion
set dest = #{dest,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>