SuggestConversionMapper.xml 1.55 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="create_time" property="createTime" jdbcType="INTEGER" />
		<result column="update_time" property="updateTime" jdbcType="INTEGER" />
	</resultMap>
	<sql id="Base_Column_List">
		id, source, dest, create_time, updateTime
	</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="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, create_time, updateTime)
		values
		<foreach collection="list" item="item" index="index"
				 separator=",">
			(#{item.source, jdbcType=VARCHAR},
			#{item.dest, jdbcType=VARCHAR},
			#{item.createTime, jdbcType=INTEGER},
			#{item.updateTime, jdbcType=INTEGER})
		</foreach>
	</insert>
</mapper>