分类: Java
2016-04-28 10:23:36
不管是自己实现还是利用插件方式,其根本就是利用:
- mysql的 limit beginrow , size(条数)
- ORACEL的 rownum >= 1 and rownum <= 10(1-10的记录)
这里继承了我们的Page类
- package com.elements.user.model;
- import java.util.Date;
- import com.elements.user.Page;
- public class User extends Page{
- /**
- * This field was generated by MyBatis Generator.
- * This field corresponds to the database column user.userId
- *
- * @mbggenerated Wed Apr 27 15:05:09 CST 2016
- */
- private Integer userid;
- /**
- * This field was generated by MyBatis Generator.
- * This field corresponds to the database column user.UserName
- *
- * @mbggenerated Wed Apr 27 15:05:09 CST 2016
- */
- private String username;
- /**
- * This field was generated by MyBatis Generator.
- * This field corresponds to the database column user.UserEmail
- *
- * @mbggenerated Wed Apr 27 15:05:09 CST 2016
- */
- private String useremail;
- /**
- * This field was generated by MyBatis Generator.
- * This field corresponds to the database column user.createTime
- *
- * @mbggenerated Wed Apr 27 15:05:09 CST 2016
- */
- private String createtime;
- /**
- * This field was generated by MyBatis Generator.
- * This field corresponds to the database column user.updateTime
- *
- * @mbggenerated Wed Apr 27 15:05:09 CST 2016
- */
- private String updatetime;
- /**
- * This method was generated by MyBatis Generator.
- * This method returns the value of the database column user.userId
- *
- * @return the value of user.userId
- *
- * @mbggenerated Wed Apr 27 15:05:09 CST 2016
- */
- public Integer getUserid() {
- return userid;
- }
- /**
- * This method was generated by MyBatis Generator.
- * This method sets the value of the database column user.userId
- *
- * @param userid the value for user.userId
- *
- * @mbggenerated Wed Apr 27 15:05:09 CST 2016
- */
- public void setUserid(Integer userid) {
- this.userid = userid;
- }
- /**
- * This method was generated by MyBatis Generator.
- * This method returns the value of the database column user.UserName
- *
- * @return the value of user.UserName
- *
- * @mbggenerated Wed Apr 27 15:05:09 CST 2016
- */
- public String getUsername() {
- return username;
- }
- /**
- * This method was generated by MyBatis Generator.
- * This method sets the value of the database column user.UserName
- *
- * @param username the value for user.UserName
- *
- * @mbggenerated Wed Apr 27 15:05:09 CST 2016
- */
- public void setUsername(String username) {
- this.username = username == null ? null : username.trim();
- }
- /**
- * This method was generated by MyBatis Generator.
- * This method returns the value of the database column user.UserEmail
- *
- * @return the value of user.UserEmail
- *
- * @mbggenerated Wed Apr 27 15:05:09 CST 2016
- */
- public String getUseremail() {
- return useremail;
- }
- /**
- * This method was generated by MyBatis Generator.
- * This method sets the value of the database column user.UserEmail
- *
- * @param useremail the value for user.UserEmail
- *
- * @mbggenerated Wed Apr 27 15:05:09 CST 2016
- */
- public void setUseremail(String useremail) {
- this.useremail = useremail == null ? null : useremail.trim();
- }
- /**
- * This method was generated by MyBatis Generator.
- * This method returns the value of the database column user.createTime
- *
- * @return the value of user.createTime
- *
- * @mbggenerated Wed Apr 27 15:05:09 CST 2016
- */
- public String getCreatetime() {
- return createtime;
- }
- /**
- * This method was generated by MyBatis Generator.
- * This method sets the value of the database column user.createTime
- *
- * @param createtime the value for user.createTime
- *
- * @mbggenerated Wed Apr 27 15:05:09 CST 2016
- */
- public void setCreatetime(String createtime) {
- this.createtime = createtime ;
- }
- /**
- * This method was generated by MyBatis Generator.
- * This method returns the value of the database column user.updateTime
- *
- * @return the value of user.updateTime
- *
- * @mbggenerated Wed Apr 27 15:05:09 CST 2016
- */
- public String getUpdatetime() {
- return updatetime;
- }
- /**
- * This method was generated by MyBatis Generator.
- * This method sets the value of the database column user.updateTime
- *
- * @param updatetime the value for user.updateTime
- *
- * @mbggenerated Wed Apr 27 15:05:09 CST 2016
- */
- public void setUpdatetime(String updatetime) {
- this.updatetime = updatetime;
- }
- @Override
- public String toString() {
- return "User [userid=" + userid + ", username=" + username
- + ", useremail=" + useremail + ", createtime=" + createtime
- + ", updatetime=" + updatetime + "]\n";
- }
- }