您的位置:首页 > 其它

mybatis关联字表分页查询实现(物理分页)

2016-09-01 13:17 543 查看

mapper.xml

<resultMap id="BaseResultMapOneToManey" type="cn.howso.resume.resume.entity.ResumeInfo">

        <id column="ID" jdbcType="INTEGER" property="id" />

        <result column="ABILITYID" jdbcType="VARCHAR" property="abilityid" />

        <result column="ABILITYKEY" jdbcType="VARCHAR" property="abilitykey" />

        <result column="JOB_SEEKER" jdbcType="VARCHAR" property="jobseeker" />

        <result column="SEX" jdbcType="INTEGER" property="sex" />

        <result column="SOURCE" jdbcType="VARCHAR" property="source" />

        <result column="APPLY_JOB" jdbcType="VARCHAR" property="applyjob" />

        <result column="BIRTHDAY" jdbcType="DATE" property="birthday" />

        <result column="IDENTIFY_NUM" jdbcType="VARCHAR" property="identifynum" />

        <result column="PHONE" jdbcType="VARCHAR" property="phone" />

        <result column="EMAIL" jdbcType="VARCHAR" property="email" />

        <result column="EDUCATION" jdbcType="VARCHAR" property="education" />

        <result column="PROFESSION" jdbcType="VARCHAR" property="profession" />

        <result column="SCHOOL" jdbcType="VARCHAR" property="school" />

        <result column="GRADUATION_DATE" jdbcType="DATE" property="graduationdate" />

        <result column="ANNEX" jdbcType="VARCHAR" property="annex" />

        <result column="REMARK" jdbcType="VARCHAR" property="remark" />

        <result column="UPLOAD_DEPT" jdbcType="VARCHAR" property="uploaddept" />

        <result column="UPLOAD_STAFF" jdbcType="VARCHAR" property="uploadstaff" />

        <result column="UPLOAD_DATE" jdbcType="DATE" property="uploaddate" />

        <result column="PROTECTION_DATE" jdbcType="DATE" property="protectiondate" />

        <result column="STATUS" jdbcType="INTEGER" property="status" />

        <result column="PHOTO_RESOURCE" jdbcType="VARCHAR" property="photoresource" />

        <result column="ABILITYDES" jdbcType="VARCHAR" property="abilitydes" />

        <result column="EVALUATE" jdbcType="VARCHAR" property="evaluate" />

        <result column="REUMESTATE" jdbcType="INTEGER" property="reumestate" />

  <collection property="homes" ofType="cn.howso.resume.resume.entity.ResumeHome">

      <id column="ID" jdbcType="INTEGER" property="id" />

         <result column="RESUME_ID" jdbcType="VARCHAR" property="resumeid" />

         <result column="RELATIONSHIP" jdbcType="VARCHAR" property="relationship" />

         <result column="NAME" jdbcType="VARCHAR" property="name" />

         <result column="OCCUPATION" jdbcType="VARCHAR" property="occupation" />

         <result column="PHONE" jdbcType="VARCHAR" property="phone" />

  </collection>

    </resultMap>

  <sql id="Limit_Data">

        <if test="page != null"  >

         limit #{page.start},#{page.size}

    </if>

    </sql>

<select id="findPageByWhereJoinHome" resultMap="BaseResultMapOneToManey" parameterType="java.util.Map">

   select * from (

    select * from t_resume_info

    <include refid="Limit_Data"></include>

    ) a

  LEFT JOIN t_resume_home c on a.id=c.RESUME_ID

  </select> 

mapper.java

 List<ResumeInfo> findPageByWhereJoinHome(Map<String, Object> map);

实体类:

package cn.howso.resume.resume.entity;

import java.io.Serializable;

import java.util.ArrayList;

import java.util.Date;

import java.util.List;

public class ResumeInfo implements Serializable {

    /** 简历信息编号 */

    private String id;

    /** 技能编号 */

    private String abilityid;

    /** 技能关键字 */

    private String abilitykey;

    /** 求职者姓名 */

    private String jobseeker;

    /** 性别 */

    private Object sex;

    /** 简历来源 */

    private String source;

    /** 应聘岗位 */

    private String applyjob;

    /** 出生日期 */

    private Date birthday;

    /** 身份证号码 */

    private String identifynum;

    /** 手机号码 */

    private String phone;

    /** 电子邮件 */

    private String email;

    /** 最高学历 */

    private String education;

    /** 毕业专业 */

    private String profession;

    /** 毕业院校 */

    private String school;

    /** 毕业日期 */

    private Date graduationdate;

    /** 简历附件 */

    private String annex;

    /** 简历备注 */

    private String remark;

    /** 上传部门 */

    private String uploaddept;

    /** 上传人员 */

    private String uploadstaff;

    /** 上传日期 */

    private Object uploaddate;

    /** 简历保护期 */

    private Object protectiondate;

    /** 简历保护期 */

    private Object status;

    /** 照片路径 */

    private String photoresource;

    /** 技术特长 */

    private String abilitydes;

    /** 个人评价 */

    private String evaluate;

    /** 简历状态(0可用、1招聘中、2带入职、3已入职) */

    private Integer reumestate;

   

    /**

     * 家庭信息

     */

    private List<ResumeHome> homes=new ArrayList<ResumeHome>();

    /**

     * 工作经历

     */

    private List<ResumeWork> works=new ArrayList<ResumeWork>();

    /**

     * 项目经验

     */

    private List<ResumeProject> projects=new ArrayList<ResumeProject>();

    /**

     * 教育信息

     */

    private List<ResumeEdu> edus=new ArrayList<ResumeEdu>();

    /**

     * 入职跟踪

     */

    private List<ResumeEntry> entrys=new ArrayList<ResumeEntry>();

    /**

     * 面试记录

     */

    private List<ResumeInterview> interview=new ArrayList<ResumeInterview>();

    /**

     * 培训经历

     */

    private List<ResumeTrain> trains=new ArrayList<ResumeTrain>();

    /**

     * 证书信息

     */

    private List<ResumeCert> certs=new ArrayList<ResumeCert>();

    /**

     * 下载信息

     */

    private List<ResumeDownload> downloads=new ArrayList<ResumeDownload>();

    public List<ResumeHome> getHomes() {

  return homes;

 }

 public void setHomes(List<ResumeHome> homes) {

  this.homes = homes;

 }

 public List<ResumeWork> getWorks() {

  return works;

 }

 public void setWorks(List<ResumeWork> works) {

  this.works = works;

 }

 public List<ResumeProject> getProjects() {

  return projects;

 }

 public void setProjects(List<ResumeProject> projects) {

  this.projects = projects;

 }

 public List<ResumeEdu> getEdus() {

  return edus;

 }

 public void setEdus(List<ResumeEdu> edus) {

  this.edus = edus;

 }

 public List<ResumeEntry> getEntrys() {

  return entrys;

 }

 public void setEntrys(List<ResumeEntry> entrys) {

  this.entrys = entrys;

 }

 public List<ResumeInterview> getInterview() {

  return interview;

 }

 public void setInterview(List<ResumeInterview> interview) {

  this.interview = interview;

 }

 public List<ResumeTrain> getTrains() {

  return trains;

 }

 public void setTrains(List<ResumeTrain> trains) {

  this.trains = trains;

 }

 public List<ResumeCert> getCerts() {

  return certs;

 }

 public void setCerts(List<ResumeCert> certs) {

  this.certs = certs;

 }

 public List<ResumeDownload> getDownloads() {

  return downloads;

 }

 public void setDownloads(List<ResumeDownload> downloads) {

  this.downloads = downloads;

 }

 /**

     * 获取 简历信息编号 的值

     * @return String

     */

    public String getId() {

        return id;

    }

   

    /**

     * 设置简历信息编号 的值

     * @param String id

     */

    public ResumeInfo setId(String id) {

        this.id = id;

        return this;

    }

    /**

     * 获取 技能编号 的值

     * @return String

     */

    public String getAbilityid() {

        return abilityid;

    }

   

    /**

     * 设置技能编号 的值

     * @param String abilityid

     */

    public ResumeInfo setAbilityid(String abilityid) {

        this.abilityid = abilityid;

        return this;

    }

    /**

     * 获取 技能关键字 的值

     * @return String

     */

    public String getAbilitykey() {

        return abilitykey;

    }

   

    /**

     * 设置技能关键字 的值

     * @param String abilitykey

     */

    public ResumeInfo setAbilitykey(String abilitykey) {

        this.abilitykey = abilitykey;

        return this;

    }

    /**

     * 获取 求职者姓名 的值

     * @return String

     */

    public String getJobseeker() {

        return jobseeker;

    }

   

    /**

     * 设置求职者姓名 的值

     * @param String jobseeker

     */

    public ResumeInfo setJobseeker(String jobseeker) {

        this.jobseeker = jobseeker;

        return this;

    }

    /**

     * 获取 性别 的值

     * @return Object

     */

    public Object getSex() {

        return sex;

    }

   

    /**

     * 设置性别 的值

     * @param Object sex

     */

    public ResumeInfo setSex(Object sex) {

        this.sex = sex;

        return this;

    }

    /**

     * 获取 简历来源 的值

     * @return String

     */

    public String getSource() {

        return source;

    }

   

    /**

     * 设置简历来源 的值

     * @param String source

     */

    public ResumeInfo setSource(String source) {

        this.source = source;

        return this;

    }

    /**

     * 获取 应聘岗位 的值

     * @return String

     */

    public String getApplyjob() {

        return applyjob;

    }

   

    /**

     * 设置应聘岗位 的值

     * @param String applyjob

     */

    public ResumeInfo setApplyjob(String applyjob) {

        this.applyjob = applyjob;

        return this;

    }

    /**

     * 获取 出生日期 的值

     * @return Date

     */

    public Date getBirthday() {

        return birthday;

    }

   

    /**

     * 设置出生日期 的值

     * @param Date birthday

     */

    public ResumeInfo setBirthday(Date birthday) {

        this.birthday = birthday;

        return this;

    }

    /**

     * 获取 身份证号码 的值

     * @return String

     */

    public String getIdentifynum() {

        return identifynum;

    }

   

    /**

     * 设置身份证号码 的值

     * @param String identifynum

     */

    public ResumeInfo setIdentifynum(String identifynum) {

        this.identifynum = identifynum;

        return this;

    }

    /**

     * 获取 手机号码 的值

     * @return String

     */

    public String getPhone() {

        return phone;

    }

   

    /**

     * 设置手机号码 的值

     * @param String phone

     */

    public ResumeInfo setPhone(String phone) {

        this.phone = phone;

        return this;

    }

    /**

     * 获取 电子邮件 的值

     * @return String

     */

    public String getEmail() {

        return email;

    }

   

    /**

     * 设置电子邮件 的值

     * @param String email

     */

    public ResumeInfo setEmail(String email) {

        this.email = email;

        return this;

    }

    /**

     * 获取 最高学历 的值

     * @return String

     */

    public String getEducation() {

        return education;

    }

   

    /**

     * 设置最高学历 的值

     * @param String education

     */

    public ResumeInfo setEducation(String education) {

        this.education = education;

        return this;

    }

    /**

     * 获取 毕业专业 的值

     * @return String

     */

    public String getProfession() {

        return profession;

    }

   

    /**

     * 设置毕业专业 的值

     * @param String profession

     */

    public ResumeInfo setProfession(String profession) {

        this.profession = profession;

        return this;

    }

    /**

     * 获取 毕业院校 的值

     * @return String

     */

    public String getSchool() {

        return school;

    }

   

    /**

     * 设置毕业院校 的值

     * @param String school

     */

    public ResumeInfo setSchool(String school) {

        this.school = school;

        return this;

    }

    /**

     * 获取 毕业日期 的值

     * @return Date

     */

    public Date getGraduationdate() {

        return graduationdate;

    }

   

    /**

     * 设置毕业日期 的值

     * @param Date graduationdate

     */

    public ResumeInfo setGraduationdate(Date graduationdate) {

        this.graduationdate = graduationdate;

        return this;

    }

    /**

     * 获取 简历附件 的值

     * @return String

     */

    public String getAnnex() {

        return annex;

    }

   

    /**

     * 设置简历附件 的值

     * @param String annex

     */

    public ResumeInfo setAnnex(String annex) {

        this.annex = annex;

        return this;

    }

    /**

     * 获取 简历备注 的值

     * @return String

     */

    public String getRemark() {

        return remark;

    }

   

    /**

     * 设置简历备注 的值

     * @param String remark

     */

    public ResumeInfo setRemark(String remark) {

        this.remark = remark;

        return this;

    }

    /**

     * 获取 上传部门 的值

     * @return String

     */

    public String getUploaddept() {

        return uploaddept;

    }

   

    /**

     * 设置上传部门 的值

     * @param String uploaddept

     */

    public ResumeInfo setUploaddept(String uploaddept) {

        this.uploaddept = uploaddept;

        return this;

    }

    /**

     * 获取 上传人员 的值

     * @return String

     */

    public String getUploadstaff() {

        return uploadstaff;

    }

   

    /**

     * 设置上传人员 的值

     * @param String uploadstaff

     */

    public ResumeInfo setUploadstaff(String uploadstaff) {

        this.uploadstaff = uploadstaff;

        return this;

    }

    /**

     * 获取 上传日期 的值

     * @return Object

     */

    public Object getUploaddate() {

        return uploaddate;

    }

   

    /**

     * 设置上传日期 的值

     * @param Object uploaddate

     */

    public ResumeInfo setUploaddate(Object uploaddate) {

        this.uploaddate = uploaddate;

        return this;

    }

    /**

     * 获取 简历保护期 的值

     * @return Object

     */

    public Object getProtectiondate() {

        return protectiondate;

    }

   

    /**

     * 设置简历保护期 的值

     * @param Object protectiondate

     */

    public ResumeInfo setProtectiondate(Object protectiondate) {

        this.protectiondate = protectiondate;

        return this;

    }

    /**

     * 获取 简历保护期 的值

     * @return Object

     */

    public Object getStatus() {

        return status;

    }

   

    /**

     * 设置简历保护期 的值

     * @param Object status

     */

    public ResumeInfo setStatus(Object status) {

        this.status = status;

        return this;

    }

    /**

     * 获取 照片路径 的值

     * @return String

     */

    public String getPhotoresource() {

        return photoresource;

    }

   

    /**

     * 设置照片路径 的值

     * @param String photoresource

     */

    public ResumeInfo setPhotoresource(String photoresource) {

        this.photoresource = photoresource;

        return this;

    }

    /**

     * 获取 技术特长 的值

     * @return String

     */

    public String getAbilitydes() {

        return abilitydes;

    }

   

    /**

     * 设置技术特长 的值

     * @param String abilitydes

     */

    public ResumeInfo setAbilitydes(String abilitydes) {

        this.abilitydes = abilitydes;

        return this;

    }

    /**

     * 获取 个人评价 的值

     * @return String

     */

    public String getEvaluate() {

        return evaluate;

    }

   

    /**

     * 设置个人评价 的值

     * @param String evaluate

     */

    public ResumeInfo setEvaluate(String evaluate) {

        this.evaluate = evaluate;

        return this;

    }

    /**

     * 获取 简历状态(0可用、1招聘中、2带入职、3已入职) 的值

     * @return Integer

     */

    public Integer getReumestate() {

        return reumestate;

    }

   

    /**

     * 设置简历状态(0可用、1招聘中、2带入职、3已入职) 的值

     * @param Integer reumestate

     */

    public ResumeInfo setReumestate(Integer reumestate) {

        this.reumestate = reumestate;

        return this;

    }

 public String toString() {

        StringBuffer sb = new StringBuffer();

        sb.append(this.getClass().getName());

        sb.append("; id=" + (id == null ? "null" : id.toString()));

        sb.append("; abilityid=" + (abilityid == null ? "null" : abilityid.toString()));

        sb.append("; abilitykey=" + (abilitykey == null ? "null" : abilitykey.toString()));

        sb.append("; jobseeker=" + (jobseeker == null ? "null" : jobseeker.toString()));

        sb.append("; sex=" + (sex == null ? "null" : sex.toString()));

        sb.append("; source=" + (source == null ? "null" : source.toString()));

        sb.append("; applyjob=" + (applyjob == null ? "null" : applyjob.toString()));

        sb.append("; birthday=" + (birthday == null ? "null" : birthday.toString()));

        sb.append("; identifynum=" + (identifynum == null ? "null" : identifynum.toString()));

        sb.append("; phone=" + (phone == null ? "null" : phone.toString()));

        sb.append("; email=" + (email == null ? "null" : email.toString()));

        sb.append("; education=" + (education == null ? "null" : education.toString()));

        sb.append("; profession=" + (profession == null ? "null" : profession.toString()));

        sb.append("; school=" + (school == null ? "null" : school.toString()));

        sb.append("; graduationdate=" + (graduationdate == null ? "null" : graduationdate.toString()));

        sb.append("; annex=" + (annex == null ? "null" : annex.toString()));

        sb.append("; remark=" + (remark == null ? "null" : remark.toString()));

        sb.append("; uploaddept=" + (uploaddept == null ? "null" : uploaddept.toString()));

        sb.append("; uploadstaff=" + (uploadstaff == null ? "null" : uploadstaff.toString()));

        sb.append("; uploaddate=" + (uploaddate == null ? "null" : uploaddate.toString()));

        sb.append("; protectiondate=" + (protectiondate == null ? "null" : protectiondate.toString()));

        sb.append("; status=" + (status == null ? "null" : status.toString()));

        sb.append("; photoresource=" + (photoresource == null ? "null" : photoresource.toString()));

        sb.append("; abilitydes=" + (abilitydes == null ? "null" : abilitydes.toString()));

        sb.append("; evaluate=" + (evaluate == null ? "null" : evaluate.toString()));

        sb.append("; reumestate=" + (reumestate == null ? "null" : reumestate.toString()));

        return sb.toString();

    }

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: