Browse Source

上传文件至 'src'

1801010606 6 năm trước cách đây
mục cha
commit
3960e27e7b
5 tập tin đã thay đổi với 253 bổ sung0 xóa
  1. 91 0
      src/PageBean.java
  2. 91 0
      src/Person.java
  3. 32 0
      src/PersonDao.java
  4. 24 0
      src/PersonService.java
  5. 15 0
      src/c3p0-config.xml

+ 91 - 0
src/PageBean.java

@@ -0,0 +1,91 @@
+package com.person.domain;
+
+import java.util.List;
+
+public class PageBean {
+	
+	//当前页
+	private int currentPage;
+	//总记录数
+	private int totalCount;
+	//总页数
+	private int totalPage;
+	//每页显示记录数
+	private int pageSize;
+	//开始位置
+	private int begin;
+	//每页数据list集合
+	private List<Person> list;
+	//查询用户姓名
+	private String realname;
+	//查询性别
+	private String gender;
+	//查询学历
+	private String education;
+	//查询简历
+	private String resume;
+	
+	
+	public String getRealname() {
+		return realname;
+	}
+	public void setRealname(String realname) {
+		this.realname = realname;
+	}
+	public String getGender() {
+		return gender;
+	}
+	public void setGender(String gender) {
+		this.gender = gender;
+	}
+	public String getEducation() {
+		return education;
+	}
+	public void setEducation(String education) {
+		this.education = education;
+	}
+	public String getResume() {
+		return resume;
+	}
+	public void setResume(String resume) {
+		this.resume = resume;
+	}
+	public int getCurrentPage() {
+		return currentPage;
+	}
+	public void setCurrentPage(int currentPage) {
+		this.currentPage = currentPage;
+	}
+	public int getTotalCount() {
+		return totalCount;
+	}
+	public void setTotalCount(int totalCount) {
+		this.totalCount = totalCount;
+	}
+	public int getTotalPage() {
+		return totalPage;
+	}
+	public void setTotalPage(int totalPage) {
+		this.totalPage = totalPage;
+	}
+	public int getPageSize() {
+		return pageSize;
+	}
+	public void setPageSize(int pageSize) {
+		this.pageSize = pageSize;
+	}
+	public int getBegin() {
+		return begin;
+	}
+	public void setBegin(int begin) {
+		this.begin = begin;
+	}
+	public List<Person> getList() {
+		return list;
+	}
+	public void setList(List<Person> list) {
+		this.list = list;
+	}
+	
+	
+}

+ 91 - 0
src/Person.java

@@ -0,0 +1,91 @@
+package com.person.domain;
+
+public class Person {
+	private String pid;
+	private String username;
+	private String password;
+	private String realname;
+	private String gender;
+	private String education;
+	private String love;
+	private String birthday;
+	private String phone;
+	private String resume;
+	private String rmark;
+	private int id;
+	
+	public int getId() {
+		return id;
+	}
+	public void setId(int id) {
+		this.id = id;
+	}
+	public String getPid() {
+		return pid;
+	}
+	public void setPid(String pid) {
+		this.pid = pid;
+	}
+	public String getUsername() {
+		return username;
+	}
+	public void setUsername(String username) {
+		this.username = username;
+	}
+	public String getPassword() {
+		return password;
+	}
+	public void setPassword(String password) {
+		this.password = password;
+	}
+	public String getRealname() {
+		return realname;
+	}
+	public void setRealname(String realname) {
+		this.realname = realname;
+	}
+	public String getGender() {
+		return gender;
+	}
+	public void setGender(String gender) {
+		this.gender = gender;
+	}
+	public String getEducation() {
+		return education;
+	}
+	public void setEducation(String education) {
+		this.education = education;
+	}
+	public String getLove() {
+		return love;
+	}
+	public void setLove(String love) {
+		this.love = love;
+	}
+	public String getBirthday() {
+		return birthday;
+	}
+	public void setBirthday(String birthday) {
+		this.birthday = birthday;
+	}
+	public String getPhone() {
+		return phone;
+	}
+	public void setPhone(String phone) {
+		this.phone = phone;
+	}
+	public String getResume() {
+		return resume;
+	}
+	public void setResume(String resume) {
+		this.resume = resume;
+	}
+	public String getRmark() {
+		return rmark;
+	}
+	public void setRmark(String rmark) {
+		this.rmark = rmark;
+	}
+	  
+	
+}

+ 32 - 0
src/PersonDao.java

@@ -0,0 +1,32 @@
+package com.person.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import com.person.domain.Person;
+
+public interface PersonDao {
+
+	void addPerson(Person p);
+
+	Person login(Person p);
+
+	List<Person> findAllPage(int begin, int pageSize);
+
+	int findCount();
+
+	Person findOne(String pid);
+
+	void update(Person p);
+
+	void delete(String pid);
+
+	List<Person> selectPerson(Map<String, String> map, int begin, int pageSize);
+
+	int selectCount(Map<String, String> map);
+
+	Boolean panduanUsername(Person p);
+
+	void register(Person p);
+
+}

+ 24 - 0
src/PersonService.java

@@ -0,0 +1,24 @@
+package com.person.service;
+
+import com.person.domain.PageBean;
+import com.person.domain.Person;
+
+public interface PersonService {
+
+	public int registerPerson(Person p);
+
+	public Person loginUser(Person p);
+
+	public PageBean findAllPage(int current);
+
+	public Person findOne(String pid);
+
+	public void update(Person p);
+
+	public void delete(String pid);
+
+	public PageBean selectPerson(Person p, int current);
+
+	public void addPerson(Person p);
+
+}

+ 15 - 0
src/c3p0-config.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<c3p0-config>
+	<default-config>
+		<property name="driverClass">com.mysql.jdbc.Driver</property>
+		<property name="jdbcUrl">jdbc:mysql:///personDB</property>
+		<property name="user">root</property>
+		<property name="password">110120799</property>
+	</default-config> <!-- This app is massive! -->
+	<!-- <named-config name="mysql11">
+		<property name="driverClass">com.mysql.jdbc.Driver</property>
+		<property name="jdbcUrl">jdbc:mysql:///WEB07</property>
+		<property name="user">root</property>
+		<property name="password">1234</property>
+	</named-config> -->
+</c3p0-config>