SuggestConversionMapper.xml 1.87 KB
<?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>