TopicMapper.xml 1.61 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.TopicMapper" >
  <resultMap id="BaseResultMap" type="com.yoho.search.dal.model.Topic" >
    <result column="id" property="id" jdbcType="INTEGER" />
    <result column="title" property="title" jdbcType="VARCHAR" />
    <result column="title_tc" property="titleTc" jdbcType="VARCHAR" />
    <result column="city_id" property="cityId" jdbcType="INTEGER" />
    <result column="is_top" property="isTop" jdbcType="INTEGER" />
    <result column="top_time" property="topTime" jdbcType="INTEGER" />
    <result column="publish_time" property="publishTime" jdbcType="INTEGER" />
    <result column="description" property="description" jdbcType="VARCHAR" />
    <result column="description_tc" property="descriptionTc" jdbcType="VARCHAR" />
    <result column="is_recommend" property="isRecommend" jdbcType="INTEGER" />
    <result column="sort" property="sort" jdbcType="INTEGER" />
    <result column="recommend_time" property="recommendTime" jdbcType="INTEGER" />
  </resultMap>
  <sql id="Base_Column_List" >
      id, title, title_tc,
      city_id, is_top, top_time,
      publish_time, description, description_tc,
      is_recommend, sort, recommend_time
  </sql>
  <select id="getPageLists" resultMap="BaseResultMap" timeout="20000">
    select
    <include refid="Base_Column_List" />
    from topic limit #{offset},#{pageSize}
  </select>
  <select id="count" resultType="java.lang.Integer" timeout="20000">
    SELECT count(*) FROM topic
  </select>
</mapper>