UserMapper.xml
1.1 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.UserMapper" >
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.User" >
<result column="id" property="id" jdbcType="INTEGER" />
<result column="nickname" property="nickname" jdbcType="VARCHAR" />
<result column="is_majia" property="isMajia" jdbcType="BIT" />
<result column="is_recommend" property="isRecommend" jdbcType="INTEGER" />
<result column="recommend_time" property="recommendTime" jdbcType="INTEGER" />
<result column="sort" property="sort" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, nickname, is_majia,
is_recommend, recommend_time, sort
</sql>
<select id="getPageLists" resultMap="BaseResultMap" timeout="20000">
select
<include refid="Base_Column_List" />
from user limit #{offset},#{pageSize}
</select>
<select id="count" resultType="java.lang.Integer" timeout="20000">
SELECT count(*) FROM user
</select>
</mapper>