当前位置:   article > 正文

IDEA+Java+Servlet+JSP+Bootstrap+Mysql实现Web学生宿舍管理系统_基于java web 学生宿舍管理信息系统代码idea

基于java web 学生宿舍管理信息系统代码idea

目录

一、系统介绍

1.开发环境

2.技术选型

3.系统功能

4.数据库

5.工程截图

二、系统展示

1.登录界面

2.学生-主页面

3.学生-缺勤记录

4.学生-修改密码

5.宿舍管理员-主页面

6.宿舍管理员-学生查看

7.宿舍管理员-缺勤记录

8.宿舍管理员-修改密码

9.系统管理员-主页面

10.系统管理员-宿舍管理员管理

11.系统管理员-学生管理

12.系统管理员-宿舍楼管理

13.系统管理员-缺勤记录

14.系统管理员-修改密码

三、部分代码

DormBuildDao

DormManagerDao

RecordDao

StudentDao

UserDao

PropertiesUtil

login.jsp

mainAdmin.jsp

mainManager.jsp

mainStudent.jsp

四、其他

1.其他系统实现

1.JavaWeb系统系列实现

2.JavaSwing系统系列实现

2.获取源码

3.运行项目

4.备注

5.支持博主


一、系统介绍


1.开发环境

开发工具:IDEA2018.2

JDK版本:jdk1.8

Mysql版本:8.0.13


2.技术选型

1.后端:使用Java+Servlet进行开发,使用过滤器来验证用户是否登录,使用MVC进行分层。

2.数据库:使用JDBC连接数据库,使用getResourceAsStream获取数据库配置文件的信息。

3.前端:使用Bootstrap作为前端框架来开发,使用到jstl来遍历数据。jsp来展示页面。

3.系统功能

1.学生

1.登录系统

2.缺勤记录

缺勤记录查询

3.修改密码

4.退出系统

2.宿舍管理员

1.登录系统

2.学生查看

查看学生信息

3.缺勤记录管理

缺勤记录的增删改查。

4.修改密码

5.退出系统

3.系统管理员

1.登录系统

2.宿舍管理员管理

宿舍管理员信息的增删改查。

3.学生信息管理

学生信息的增删改查。

4.宿舍楼信息管理

宿舍楼信息的增删改查。

5.缺勤记录管理

缺勤记录删除

6.修改密码

7.退出系统

4.数据库

  1. /*
  2. Navicat Premium Data Transfer
  3. Source Server : Mysql
  4. Source Server Type : MySQL
  5. Source Server Version : 80013
  6. Source Host : localhost:3306
  7. Source Schema : jsp_servlet_drom
  8. Target Server Type : MySQL
  9. Target Server Version : 80013
  10. File Encoding : 65001
  11. Date: 22/07/2021 20:46:38
  12. */
  13. SET NAMES utf8mb4;
  14. SET FOREIGN_KEY_CHECKS = 0;
  15. -- ----------------------------
  16. -- Table structure for t_admin
  17. -- ----------------------------
  18. DROP TABLE IF EXISTS `t_admin`;
  19. CREATE TABLE `t_admin` (
  20. `adminId` int(11) NOT NULL AUTO_INCREMENT,
  21. `userName` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  22. `password` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  23. `name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  24. `sex` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  25. `tel` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  26. PRIMARY KEY (`adminId`) USING BTREE
  27. ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
  28. -- ----------------------------
  29. -- Records of t_admin
  30. -- ----------------------------
  31. INSERT INTO `t_admin` VALUES (1, 'admin', 'admin', '管理员', '男', '1828888888');
  32. -- ----------------------------
  33. -- Table structure for t_dorm
  34. -- ----------------------------
  35. DROP TABLE IF EXISTS `t_dorm`;
  36. CREATE TABLE `t_dorm` (
  37. `dormId` int(11) NOT NULL AUTO_INCREMENT,
  38. `dormBuildId` int(11) NULL DEFAULT NULL,
  39. `dormName` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  40. `dormType` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  41. `dormNumber` int(11) NULL DEFAULT NULL,
  42. `dormTel` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  43. PRIMARY KEY (`dormId`) USING BTREE
  44. ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
  45. -- ----------------------------
  46. -- Records of t_dorm
  47. -- ----------------------------
  48. INSERT INTO `t_dorm` VALUES (1, 1, '220', '男', 4, '110');
  49. -- ----------------------------
  50. -- Table structure for t_dormbuild
  51. -- ----------------------------
  52. DROP TABLE IF EXISTS `t_dormbuild`;
  53. CREATE TABLE `t_dormbuild` (
  54. `dormBuildId` int(11) NOT NULL AUTO_INCREMENT,
  55. `dormBuildName` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  56. `dormBuildDetail` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  57. PRIMARY KEY (`dormBuildId`) USING BTREE
  58. ) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
  59. -- ----------------------------
  60. -- Records of t_dormbuild
  61. -- ----------------------------
  62. INSERT INTO `t_dormbuild` VALUES (1, '1栋', '一栋信息介绍');
  63. INSERT INTO `t_dormbuild` VALUES (2, '2栋', '二栋信息介绍');
  64. INSERT INTO `t_dormbuild` VALUES (3, '3栋', '三栋信息介绍');
  65. INSERT INTO `t_dormbuild` VALUES (4, '4栋', '四栋信息介绍');
  66. INSERT INTO `t_dormbuild` VALUES (5, '5栋', '五栋信息介绍');
  67. -- ----------------------------
  68. -- Table structure for t_dormmanager
  69. -- ----------------------------
  70. DROP TABLE IF EXISTS `t_dormmanager`;
  71. CREATE TABLE `t_dormmanager` (
  72. `dormManId` int(11) NOT NULL AUTO_INCREMENT,
  73. `userName` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  74. `password` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  75. `dormBuildId` int(11) NULL DEFAULT NULL,
  76. `name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  77. `sex` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  78. `tel` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  79. PRIMARY KEY (`dormManId`) USING BTREE
  80. ) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
  81. -- ----------------------------
  82. -- Records of t_dormmanager
  83. -- ----------------------------
  84. INSERT INTO `t_dormmanager` VALUES (1, 'dromadmin', '123456', 4, '宿舍管理员', '男', '18212346589');
  85. -- ----------------------------
  86. -- Table structure for t_record
  87. -- ----------------------------
  88. DROP TABLE IF EXISTS `t_record`;
  89. CREATE TABLE `t_record` (
  90. `recordId` int(11) NOT NULL AUTO_INCREMENT,
  91. `studentNumber` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  92. `studentName` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  93. `dormBuildId` int(11) NULL DEFAULT NULL,
  94. `dormName` varchar(11) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  95. `date` date NULL DEFAULT NULL,
  96. `detail` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  97. PRIMARY KEY (`recordId`) USING BTREE
  98. ) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
  99. -- ----------------------------
  100. -- Records of t_record
  101. -- ----------------------------
  102. INSERT INTO `t_record` VALUES (1, '001', '李四', 4, '120', '2014-01-01', '回家');
  103. -- ----------------------------
  104. -- Table structure for t_student
  105. -- ----------------------------
  106. DROP TABLE IF EXISTS `t_student`;
  107. CREATE TABLE `t_student` (
  108. `studentId` int(11) NOT NULL AUTO_INCREMENT,
  109. `stuNum` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  110. `password` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  111. `name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  112. `dormBuildId` int(11) NULL DEFAULT NULL,
  113. `dormName` varchar(11) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  114. `sex` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  115. `tel` varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  116. PRIMARY KEY (`studentId`) USING BTREE
  117. ) ENGINE = InnoDB AUTO_INCREMENT = 32 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
  118. -- ----------------------------
  119. -- Records of t_student
  120. -- ----------------------------
  121. INSERT INTO `t_student` VALUES (1, '001', '123456', '李四', 4, '120', '男', '123456');
  122. INSERT INTO `t_student` VALUES (2, '002', '123456', '王五', 5, '201', '男', '123456');
  123. SET FOREIGN_KEY_CHECKS = 1;

5.工程截图

 

二、系统展示

1.登录界面

 

2.学生-主页面

 

3.学生-缺勤记录

 

 

4.学生-修改密码

 

5.宿舍管理员-主页面

 

6.宿舍管理员-学生查看

 

7.宿舍管理员-缺勤记录

 

8.宿舍管理员-修改密码

 

9.系统管理员-主页面

 

10.系统管理员-宿舍管理员管理

 

11.系统管理员-学生管理

 

12.系统管理员-宿舍楼管理

 

13.系统管理员-缺勤记录

 

14.系统管理员-修改密码

三、部分代码

DormBuildDao

  1. package com.lero.dao;
  2. import com.lero.model.DormBuild;
  3. import com.lero.model.DormManager;
  4. import com.lero.model.PageBean;
  5. import com.lero.util.StringUtil;
  6. import java.sql.Connection;
  7. import java.sql.PreparedStatement;
  8. import java.sql.ResultSet;
  9. import java.util.ArrayList;
  10. import java.util.List;
  11. public class DormBuildDao {
  12. public static String dormBuildName(Connection con, int dormBuildId) throws Exception {
  13. String sql = "select * from t_dormBuild where dormBuildId=?";
  14. PreparedStatement pstmt = con.prepareStatement(sql);
  15. pstmt.setInt(1, dormBuildId);
  16. ResultSet rs = pstmt.executeQuery();
  17. if (rs.next()) {
  18. return rs.getString("dormBuildName");
  19. }
  20. return null;
  21. }
  22. public List<DormBuild> dormBuildList(Connection con, PageBean pageBean, DormBuild s_dormBuild) throws Exception {
  23. List<DormBuild> dormBuildList = new ArrayList<DormBuild>();
  24. StringBuffer sb = new StringBuffer("select * from t_dormBuild t1");
  25. if (StringUtil.isNotEmpty(s_dormBuild.getDormBuildName())) {
  26. sb.append(" where t1.dormBuildName like '%" + s_dormBuild.getDormBuildName() + "%'");
  27. }
  28. if (pageBean != null) {
  29. sb.append(" limit " + pageBean.getStart() + "," + pageBean.getPageSize());
  30. }
  31. PreparedStatement pstmt = con.prepareStatement(sb.toString());
  32. ResultSet rs = pstmt.executeQuery();
  33. while (rs.next()) {
  34. DormBuild dormBuild = new DormBuild();
  35. dormBuild.setDormBuildId(rs.getInt("dormBuildId"));
  36. dormBuild.setDormBuildName(rs.getString("dormBuildName"));
  37. dormBuild.setDetail(rs.getString("dormBuildDetail"));
  38. dormBuildList.add(dormBuild);
  39. }
  40. return dormBuildList;
  41. }
  42. public int dormBuildCount(Connection con, DormBuild s_dormBuild) throws Exception {
  43. StringBuffer sb = new StringBuffer("select count(*) as total from t_dormBuild t1");
  44. if (StringUtil.isNotEmpty(s_dormBuild.getDormBuildName())) {
  45. sb.append(" where t1.dormBuildName like '%" + s_dormBuild.getDormBuildName() + "%'");
  46. }
  47. PreparedStatement pstmt = con.prepareStatement(sb.toString());
  48. ResultSet rs = pstmt.executeQuery();
  49. if (rs.next()) {
  50. return rs.getInt("total");
  51. } else {
  52. return 0;
  53. }
  54. }
  55. public DormBuild dormBuildShow(Connection con, String dormBuildId) throws Exception {
  56. String sql = "select * from t_dormBuild t1 where t1.dormBuildId=?";
  57. PreparedStatement pstmt = con.prepareStatement(sql);
  58. pstmt.setString(1, dormBuildId);
  59. ResultSet rs = pstmt.executeQuery();
  60. DormBuild dormBuild = new DormBuild();
  61. if (rs.next()) {
  62. dormBuild.setDormBuildId(rs.getInt("dormBuildId"));
  63. dormBuild.setDormBuildName(rs.getString("dormBuildName"));
  64. dormBuild.setDetail(rs.getString("dormBuildDetail"));
  65. }
  66. return dormBuild;
  67. }
  68. public int dormBuildAdd(Connection con, DormBuild dormBuild) throws Exception {
  69. String sql = "insert into t_dormBuild values(null,?,?)";
  70. PreparedStatement pstmt = con.prepareStatement(sql);
  71. pstmt.setString(1, dormBuild.getDormBuildName());
  72. pstmt.setString(2, dormBuild.getDetail());
  73. return pstmt.executeUpdate();
  74. }
  75. public int dormBuildDelete(Connection con, String dormBuildId) throws Exception {
  76. String sql = "delete from t_dormBuild where dormBuildId=?";
  77. PreparedStatement pstmt = con.prepareStatement(sql);
  78. pstmt.setString(1, dormBuildId);
  79. return pstmt.executeUpdate();
  80. }
  81. public int dormBuildUpdate(Connection con, DormBuild dormBuild) throws Exception {
  82. String sql = "update t_dormBuild set dormBuildName=?,dormBuildDetail=? where dormBuildId=?";
  83. PreparedStatement pstmt = con.prepareStatement(sql);
  84. pstmt.setString(1, dormBuild.getDormBuildName());
  85. pstmt.setString(2, dormBuild.getDetail());
  86. pstmt.setInt(3, dormBuild.getDormBuildId());
  87. return pstmt.executeUpdate();
  88. }
  89. public boolean existManOrDormWithId(Connection con, String dormBuildId) throws Exception {
  90. boolean isExist = false;
  91. // String sql="select * from t_dormBuild,t_dormManager,t_connection where dormManId=managerId and dormBuildId=buildId and dormBuildId=?";
  92. String sql = "select *from t_dormManager where dormBuildId=?";
  93. PreparedStatement pstmt = con.prepareStatement(sql);
  94. pstmt.setString(1, dormBuildId);
  95. ResultSet rs = pstmt.executeQuery();
  96. if (rs.next()) {
  97. isExist = true;
  98. } else {
  99. isExist = false;
  100. }
  101. String sql1 = "select * from t_dormBuild t1,t_dorm t2 where t1.dormBuildId=t2.dormBuildId and t1.dormBuildId=?";
  102. PreparedStatement p = con.prepareStatement(sql1);
  103. p.setString(1, dormBuildId);
  104. ResultSet r = pstmt.executeQuery();
  105. if (r.next()) {
  106. return isExist;
  107. } else {
  108. return false;
  109. }
  110. }
  111. public List<DormManager> dormManWithoutBuild(Connection con) throws Exception {
  112. List<DormManager> dormManagerList = new ArrayList<DormManager>();
  113. String sql = "SELECT * FROM t_dormManager WHERE dormBuildId IS NULL OR dormBuildId=0";
  114. PreparedStatement pstmt = con.prepareStatement(sql);
  115. ResultSet rs = pstmt.executeQuery();
  116. while (rs.next()) {
  117. DormManager dormManager = new DormManager();
  118. dormManager.setDormBuildId(rs.getInt("dormBuildId"));
  119. dormManager.setDormManagerId(rs.getInt("dormManId"));
  120. dormManager.setName(rs.getString("name"));
  121. dormManager.setUserName(rs.getString("userName"));
  122. dormManager.setSex(rs.getString("sex"));
  123. dormManager.setTel(rs.getString("tel"));
  124. dormManagerList.add(dormManager);
  125. }
  126. return dormManagerList;
  127. }
  128. public List<DormManager> dormManWithBuildId(Connection con, String dormBuildId) throws Exception {
  129. List<DormManager> dormManagerList = new ArrayList<DormManager>();
  130. String sql = "select *from t_dormManager where dormBuildId=?";
  131. PreparedStatement pstmt = con.prepareStatement(sql);
  132. pstmt.setString(1, dormBuildId);
  133. ResultSet rs = pstmt.executeQuery();
  134. while (rs.next()) {
  135. DormManager dormManager = new DormManager();
  136. dormManager.setDormBuildId(rs.getInt("dormBuildId"));
  137. dormManager.setDormManagerId(rs.getInt("dormManId"));
  138. dormManager.setName(rs.getString("name"));
  139. dormManager.setUserName(rs.getString("userName"));
  140. dormManager.setSex(rs.getString("sex"));
  141. dormManager.setTel(rs.getString("tel"));
  142. dormManagerList.add(dormManager);
  143. }
  144. return dormManagerList;
  145. }
  146. public int managerUpdateWithId(Connection con, String dormManagerId, String dormBuildId) throws Exception {
  147. String sql = "update t_dormManager set dormBuildId=? where dormManId=?";
  148. PreparedStatement pstmt = con.prepareStatement(sql);
  149. pstmt.setString(1, dormBuildId);
  150. pstmt.setString(2, dormManagerId);
  151. return pstmt.executeUpdate();
  152. }
  153. }

DormManagerDao

  1. package com.lero.dao;
  2. import com.lero.model.DormManager;
  3. import com.lero.model.PageBean;
  4. import com.lero.util.StringUtil;
  5. import java.sql.Connection;
  6. import java.sql.PreparedStatement;
  7. import java.sql.ResultSet;
  8. import java.util.ArrayList;
  9. import java.util.List;
  10. public class DormManagerDao {
  11. public List<DormManager> dormManagerList(Connection con, PageBean pageBean, DormManager s_dormManager) throws Exception {
  12. List<DormManager> dormManagerList = new ArrayList<DormManager>();
  13. StringBuffer sb = new StringBuffer("SELECT * FROM t_dormManager t1 ORDER BY t1.userName");
  14. if (StringUtil.isNotEmpty(s_dormManager.getName())) {
  15. sb.append(" where t1.name like '%" + s_dormManager.getName() + "%'");
  16. } else if (StringUtil.isNotEmpty(s_dormManager.getUserName())) {
  17. sb.append(" where t1.userName like '%" + s_dormManager.getUserName() + "%'");
  18. }
  19. if (pageBean != null) {
  20. sb.append(" limit " + pageBean.getStart() + "," + pageBean.getPageSize());
  21. }
  22. PreparedStatement pstmt = con.prepareStatement(sb.toString());
  23. ResultSet rs = pstmt.executeQuery();
  24. while (rs.next()) {
  25. DormManager dormManager = new DormManager();
  26. dormManager.setDormManagerId(rs.getInt("dormManId"));
  27. int dormBuildId = rs.getInt("dormBuildId");
  28. dormManager.setDormBuildId(dormBuildId);
  29. dormManager.setDormBuildName(DormBuildDao.dormBuildName(con, dormBuildId));
  30. dormManager.setName(rs.getString("name"));
  31. dormManager.setSex(rs.getString("sex"));
  32. dormManager.setUserName(rs.getString("userName"));
  33. dormManager.setTel(rs.getString("tel"));
  34. dormManager.setPassword(rs.getString("password"));
  35. dormManagerList.add(dormManager);
  36. }
  37. return dormManagerList;
  38. }
  39. public int dormManagerCount(Connection con, DormManager s_dormManager) throws Exception {
  40. StringBuffer sb = new StringBuffer("select count(*) as total from t_dormManager t1");
  41. if (StringUtil.isNotEmpty(s_dormManager.getName())) {
  42. sb.append(" where t1.name like '%" + s_dormManager.getName() + "%'");
  43. } else if (StringUtil.isNotEmpty(s_dormManager.getUserName())) {
  44. sb.append(" where t1.userName like '%" + s_dormManager.getUserName() + "%'");
  45. }
  46. PreparedStatement pstmt = con.prepareStatement(sb.toString());
  47. ResultSet rs = pstmt.executeQuery();
  48. if (rs.next()) {
  49. return rs.getInt("total");
  50. } else {
  51. return 0;
  52. }
  53. }
  54. public DormManager dormManagerShow(Connection con, String dormManagerId) throws Exception {
  55. String sql = "select * from t_dormManager t1 where t1.dormManId=?";
  56. PreparedStatement pstmt = con.prepareStatement(sql);
  57. pstmt.setString(1, dormManagerId);
  58. ResultSet rs = pstmt.executeQuery();
  59. DormManager dormManager = new DormManager();
  60. if (rs.next()) {
  61. dormManager.setDormManagerId(rs.getInt("dormManId"));
  62. dormManager.setDormBuildId(rs.getInt("dormBuildId"));
  63. dormManager.setName(rs.getString("name"));
  64. dormManager.setSex(rs.getString("sex"));
  65. dormManager.setUserName(rs.getString("userName"));
  66. dormManager.setTel(rs.getString("tel"));
  67. dormManager.setPassword(rs.getString("password"));
  68. }
  69. return dormManager;
  70. }
  71. public int dormManagerAdd(Connection con, DormManager dormManager) throws Exception {
  72. String sql = "insert into t_dormManager values(null,?,?,null,?,?,?)";
  73. PreparedStatement pstmt = con.prepareStatement(sql);
  74. pstmt.setString(1, dormManager.getUserName());
  75. pstmt.setString(2, dormManager.getPassword());
  76. pstmt.setString(3, dormManager.getName());
  77. pstmt.setString(4, dormManager.getSex());
  78. pstmt.setString(5, dormManager.getTel());
  79. return pstmt.executeUpdate();
  80. }
  81. public int dormManagerDelete(Connection con, String dormManagerId) throws Exception {
  82. String sql = "delete from t_dormManager where dormManId=?";
  83. PreparedStatement pstmt = con.prepareStatement(sql);
  84. pstmt.setString(1, dormManagerId);
  85. return pstmt.executeUpdate();
  86. }
  87. public int dormManagerUpdate(Connection con, DormManager dormManager) throws Exception {
  88. String sql = "update t_dormManager set userName=?,password=?,name=?,sex=?,tel=? where dormManId=?";
  89. PreparedStatement pstmt = con.prepareStatement(sql);
  90. pstmt.setString(1, dormManager.getUserName());
  91. pstmt.setString(2, dormManager.getPassword());
  92. pstmt.setString(3, dormManager.getName());
  93. pstmt.setString(4, dormManager.getSex());
  94. pstmt.setString(5, dormManager.getTel());
  95. pstmt.setInt(6, dormManager.getDormManagerId());
  96. return pstmt.executeUpdate();
  97. }
  98. public boolean haveManagerByUser(Connection con, String userName) throws Exception {
  99. String sql = "select * from t_dormmanager t1 where t1.userName=?";
  100. PreparedStatement pstmt = con.prepareStatement(sql);
  101. pstmt.setString(1, userName);
  102. ResultSet rs = pstmt.executeQuery();
  103. if (rs.next()) {
  104. return true;
  105. }
  106. return false;
  107. }
  108. }

RecordDao

  1. package com.lero.dao;
  2. import com.lero.model.DormBuild;
  3. import com.lero.model.Record;
  4. import com.lero.util.StringUtil;
  5. import java.sql.Connection;
  6. import java.sql.PreparedStatement;
  7. import java.sql.ResultSet;
  8. import java.util.ArrayList;
  9. import java.util.List;
  10. public class RecordDao {
  11. public List<Record> recordList(Connection con, Record s_record) throws Exception {
  12. List<Record> recordList = new ArrayList<Record>();
  13. StringBuffer sb = new StringBuffer("select * from t_record t1");
  14. if (StringUtil.isNotEmpty(s_record.getStudentNumber())) {
  15. sb.append(" and t1.studentNumber like '%" + s_record.getStudentNumber() + "%'");
  16. } else if (StringUtil.isNotEmpty(s_record.getStudentName())) {
  17. sb.append(" and t1.studentName like '%" + s_record.getStudentName() + "%'");
  18. }
  19. if (s_record.getDormBuildId() != 0) {
  20. sb.append(" and t1.dormBuildId=" + s_record.getDormBuildId());
  21. }
  22. if (StringUtil.isNotEmpty(s_record.getDate())) {
  23. sb.append(" and t1.date=" + s_record.getDate());
  24. }
  25. if (StringUtil.isNotEmpty(s_record.getStartDate())) {
  26. sb.append(" and TO_DAYS(t1.date)>=TO_DAYS('" + s_record.getStartDate() + "')");
  27. }
  28. if (StringUtil.isNotEmpty(s_record.getEndDate())) {
  29. sb.append(" and TO_DAYS(t1.date)<=TO_DAYS('" + s_record.getEndDate() + "')");
  30. }
  31. PreparedStatement pstmt = con.prepareStatement(sb.toString().replaceFirst("and", "where"));
  32. ResultSet rs = pstmt.executeQuery();
  33. while (rs.next()) {
  34. Record record = new Record();
  35. record.setRecordId(rs.getInt("recordId"));
  36. record.setStudentNumber(rs.getString("studentNumber"));
  37. record.setStudentName(rs.getString("studentName"));
  38. int dormBuildId = rs.getInt("dormBuildId");
  39. record.setDormBuildId(dormBuildId);
  40. record.setDormBuildName(DormBuildDao.dormBuildName(con, dormBuildId));
  41. record.setDormName(rs.getString("dormName"));
  42. record.setDate(rs.getString("date"));
  43. record.setDetail(rs.getString("detail"));
  44. recordList.add(record);
  45. }
  46. return recordList;
  47. }
  48. public List<Record> recordListWithBuild(Connection con, Record s_record, int buildId) throws Exception {
  49. List<Record> recordList = new ArrayList<Record>();
  50. StringBuffer sb = new StringBuffer("select * from t_record t1");
  51. if (StringUtil.isNotEmpty(s_record.getStudentNumber())) {
  52. sb.append(" and t1.studentNumber like '%" + s_record.getStudentNumber() + "%'");
  53. } else if (StringUtil.isNotEmpty(s_record.getStudentName())) {
  54. sb.append(" and t1.studentName like '%" + s_record.getStudentName() + "%'");
  55. }
  56. sb.append(" and t1.dormBuildId=" + buildId);
  57. if (StringUtil.isNotEmpty(s_record.getStartDate())) {
  58. sb.append(" and TO_DAYS(t1.date)>=TO_DAYS('" + s_record.getStartDate() + "')");
  59. }
  60. if (StringUtil.isNotEmpty(s_record.getEndDate())) {
  61. sb.append(" and TO_DAYS(t1.date)<=TO_DAYS('" + s_record.getEndDate() + "')");
  62. }
  63. PreparedStatement pstmt = con.prepareStatement(sb.toString().replaceFirst("and", "where"));
  64. ResultSet rs = pstmt.executeQuery();
  65. while (rs.next()) {
  66. Record record = new Record();
  67. record.setRecordId(rs.getInt("recordId"));
  68. record.setStudentNumber(rs.getString("studentNumber"));
  69. record.setStudentName(rs.getString("studentName"));
  70. int dormBuildId = rs.getInt("dormBuildId");
  71. record.setDormBuildId(dormBuildId);
  72. record.setDormBuildName(DormBuildDao.dormBuildName(con, dormBuildId));
  73. record.setDormName(rs.getString("dormName"));
  74. record.setDate(rs.getString("date"));
  75. record.setDetail(rs.getString("detail"));
  76. recordList.add(record);
  77. }
  78. return recordList;
  79. }
  80. public List<Record> recordListWithNumber(Connection con, Record s_record, String studentNumber) throws Exception {
  81. List<Record> recordList = new ArrayList<Record>();
  82. StringBuffer sb = new StringBuffer("select * from t_record t1");
  83. if (StringUtil.isNotEmpty(studentNumber)) {
  84. sb.append(" and t1.studentNumber =" + studentNumber);
  85. }
  86. if (StringUtil.isNotEmpty(s_record.getStartDate())) {
  87. sb.append(" and TO_DAYS(t1.date)>=TO_DAYS('" + s_record.getStartDate() + "')");
  88. }
  89. if (StringUtil.isNotEmpty(s_record.getEndDate())) {
  90. sb.append(" and TO_DAYS(t1.date)<=TO_DAYS('" + s_record.getEndDate() + "')");
  91. }
  92. PreparedStatement pstmt = con.prepareStatement(sb.toString().replaceFirst("and", "where"));
  93. ResultSet rs = pstmt.executeQuery();
  94. while (rs.next()) {
  95. Record record = new Record();
  96. record.setRecordId(rs.getInt("recordId"));
  97. record.setStudentNumber(rs.getString("studentNumber"));
  98. record.setStudentName(rs.getString("studentName"));
  99. int dormBuildId = rs.getInt("dormBuildId");
  100. record.setDormBuildId(dormBuildId);
  101. record.setDormBuildName(DormBuildDao.dormBuildName(con, dormBuildId));
  102. record.setDormName(rs.getString("dormName"));
  103. record.setDate(rs.getString("date"));
  104. record.setDetail(rs.getString("detail"));
  105. recordList.add(record);
  106. }
  107. return recordList;
  108. }
  109. public List<DormBuild> dormBuildList(Connection con) throws Exception {
  110. List<DormBuild> dormBuildList = new ArrayList<DormBuild>();
  111. String sql = "select * from t_dormBuild";
  112. PreparedStatement pstmt = con.prepareStatement(sql);
  113. ResultSet rs = pstmt.executeQuery();
  114. while (rs.next()) {
  115. DormBuild dormBuild = new DormBuild();
  116. dormBuild.setDormBuildId(rs.getInt("dormBuildId"));
  117. dormBuild.setDormBuildName(rs.getString("dormBuildName"));
  118. dormBuild.setDetail(rs.getString("dormBuildDetail"));
  119. dormBuildList.add(dormBuild);
  120. }
  121. return dormBuildList;
  122. }
  123. //
  124. // public int studentCount(Connection con, Student s_student)throws Exception {
  125. // StringBuffer sb = new StringBuffer("select count(*) as total from t_student t1");
  126. // if(StringUtil.isNotEmpty(s_student.getName())) {
  127. // sb.append(" and t1.name like '%"+s_student.getName()+"%'");
  128. // } else if(StringUtil.isNotEmpty(s_student.getStuNumber())) {
  129. // sb.append(" and t1.stuNum like '%"+s_student.getStuNumber()+"%'");
  130. // } else if(StringUtil.isNotEmpty(s_student.getDormName())) {
  131. // sb.append(" and t1.dormName like '%"+s_student.getDormName()+"%'");
  132. // }
  133. // if(s_student.getDormBuildId()!=0) {
  134. // sb.append(" and t1.dormBuildId="+s_student.getDormBuildId());
  135. // }
  136. // PreparedStatement pstmt = con.prepareStatement(sb.toString().replaceFirst("and", "where"));
  137. // ResultSet rs = pstmt.executeQuery();
  138. // if(rs.next()) {
  139. // return rs.getInt("total");
  140. // } else {
  141. // return 0;
  142. // }
  143. // }
  144. public Record recordShow(Connection con, String recordId) throws Exception {
  145. String sql = "select * from t_record t1 where t1.recordId=?";
  146. PreparedStatement pstmt = con.prepareStatement(sql);
  147. pstmt.setString(1, recordId);
  148. ResultSet rs = pstmt.executeQuery();
  149. Record record = new Record();
  150. if (rs.next()) {
  151. record.setRecordId(rs.getInt("recordId"));
  152. record.setStudentNumber(rs.getString("studentNumber"));
  153. record.setStudentName(rs.getString("studentName"));
  154. int dormBuildId = rs.getInt("dormBuildId");
  155. record.setDormBuildId(dormBuildId);
  156. record.setDormBuildName(DormBuildDao.dormBuildName(con, dormBuildId));
  157. record.setDormName(rs.getString("dormName"));
  158. record.setDate(rs.getString("date"));
  159. record.setDetail(rs.getString("detail"));
  160. }
  161. return record;
  162. }
  163. public int recordAdd(Connection con, Record record) throws Exception {
  164. String sql = "insert into t_record values(null,?,?,?,?,?,?)";
  165. PreparedStatement pstmt = con.prepareStatement(sql);
  166. pstmt.setString(1, record.getStudentNumber());
  167. pstmt.setString(2, record.getStudentName());
  168. pstmt.setInt(3, record.getDormBuildId());
  169. pstmt.setString(4, record.getDormName());
  170. pstmt.setString(5, record.getDate());
  171. pstmt.setString(6, record.getDetail());
  172. return pstmt.executeUpdate();
  173. }
  174. public int recordDelete(Connection con, String recordId) throws Exception {
  175. String sql = "delete from t_record where recordId=?";
  176. PreparedStatement pstmt = con.prepareStatement(sql);
  177. pstmt.setString(1, recordId);
  178. return pstmt.executeUpdate();
  179. }
  180. public int recordUpdate(Connection con, Record record) throws Exception {
  181. String sql = "update t_record set studentNumber=?,studentName=?,dormBuildId=?,dormName=?,detail=? where recordId=?";
  182. PreparedStatement pstmt = con.prepareStatement(sql);
  183. pstmt.setString(1, record.getStudentNumber());
  184. pstmt.setString(2, record.getStudentName());
  185. pstmt.setInt(3, record.getDormBuildId());
  186. pstmt.setString(4, record.getDormName());
  187. pstmt.setString(5, record.getDetail());
  188. pstmt.setInt(6, record.getRecordId());
  189. return pstmt.executeUpdate();
  190. }
  191. }

StudentDao

  1. package com.lero.dao;
  2. import com.lero.model.DormBuild;
  3. import com.lero.model.Student;
  4. import com.lero.util.StringUtil;
  5. import java.sql.Connection;
  6. import java.sql.PreparedStatement;
  7. import java.sql.ResultSet;
  8. import java.util.ArrayList;
  9. import java.util.List;
  10. public class StudentDao {
  11. // public List<Student> studentList(Connection con, PageBean pageBean, Student s_student)throws Exception {
  12. // List<Student> studentList = new ArrayList<Student>();
  13. // StringBuffer sb = new StringBuffer("select * from t_student t1");
  14. // if(StringUtil.isNotEmpty(s_student.getName())) {
  15. // sb.append(" and t1.name like '%"+s_student.getName()+"%'");
  16. // } else if(StringUtil.isNotEmpty(s_student.getStuNumber())) {
  17. // sb.append(" and t1.stuNum like '%"+s_student.getStuNumber()+"%'");
  18. // } else if(StringUtil.isNotEmpty(s_student.getDormName())) {
  19. // sb.append(" and t1.dormName like '%"+s_student.getDormName()+"%'");
  20. // }
  21. // if(s_student.getDormBuildId()!=0) {
  22. // sb.append(" and t1.dormBuildId="+s_student.getDormBuildId());
  23. // }
  24. // if(pageBean != null) {
  25. // sb.append(" limit "+pageBean.getStart()+","+pageBean.getPageSize());
  26. // }
  27. // PreparedStatement pstmt = con.prepareStatement(sb.toString().replaceFirst("and", "where"));
  28. // ResultSet rs = pstmt.executeQuery();
  29. // while(rs.next()) {
  30. // Student student=new Student();
  31. // student.setStudentId(rs.getInt("studentId"));
  32. // int dormBuildId = rs.getInt("dormBuildId");
  33. // student.setDormBuildId(dormBuildId);
  34. // student.setDormBuildName(DormBuildDao.dormBuildName(con, dormBuildId));
  35. // student.setDormName(rs.getString("dormName"));
  36. // student.setName(rs.getString("name"));
  37. // student.setSex(rs.getString("sex"));
  38. // student.setStuNumber(rs.getString("stuNum"));
  39. // student.setTel(rs.getString("tel"));
  40. // student.setPassword(rs.getString("password"));
  41. // studentList.add(student);
  42. // }
  43. // return studentList;
  44. // }
  45. public static Student getNameById(Connection con, String studentNumber, int dormBuildId) throws Exception {
  46. String sql = "select * from t_student t1 where t1.stuNum=? and t1.dormBuildId=?";
  47. PreparedStatement pstmt = con.prepareStatement(sql);
  48. pstmt.setString(1, studentNumber);
  49. pstmt.setInt(2, dormBuildId);
  50. ResultSet rs = pstmt.executeQuery();
  51. Student student = new Student();
  52. if (rs.next()) {
  53. student.setName(rs.getString("name"));
  54. student.setDormBuildId(rs.getInt("dormBuildId"));
  55. student.setDormName(rs.getString("dormName"));
  56. }
  57. return student;
  58. }
  59. public List<Student> studentList(Connection con, Student s_student) throws Exception {
  60. List<Student> studentList = new ArrayList<Student>();
  61. StringBuffer sb = new StringBuffer("select * from t_student t1");
  62. if (StringUtil.isNotEmpty(s_student.getName())) {
  63. sb.append(" and t1.name like '%" + s_student.getName() + "%'");
  64. } else if (StringUtil.isNotEmpty(s_student.getStuNumber())) {
  65. sb.append(" and t1.stuNum like '%" + s_student.getStuNumber() + "%'");
  66. } else if (StringUtil.isNotEmpty(s_student.getDormName())) {
  67. sb.append(" and t1.dormName like '%" + s_student.getDormName() + "%'");
  68. }
  69. if (s_student.getDormBuildId() != 0) {
  70. sb.append(" and t1.dormBuildId=" + s_student.getDormBuildId());
  71. }
  72. PreparedStatement pstmt = con.prepareStatement(sb.toString().replaceFirst("and", "where"));
  73. ResultSet rs = pstmt.executeQuery();
  74. while (rs.next()) {
  75. Student student = new Student();
  76. student.setStudentId(rs.getInt("studentId"));
  77. int dormBuildId = rs.getInt("dormBuildId");
  78. student.setDormBuildId(dormBuildId);
  79. student.setDormBuildName(DormBuildDao.dormBuildName(con, dormBuildId));
  80. student.setDormName(rs.getString("dormName"));
  81. student.setName(rs.getString("name"));
  82. student.setSex(rs.getString("sex"));
  83. student.setStuNumber(rs.getString("stuNum"));
  84. student.setTel(rs.getString("tel"));
  85. student.setPassword(rs.getString("password"));
  86. studentList.add(student);
  87. }
  88. return studentList;
  89. }
  90. public boolean haveNameByNumber(Connection con, String studentNumber) throws Exception {
  91. String sql = "select * from t_student t1 where t1.stuNum=?";
  92. PreparedStatement pstmt = con.prepareStatement(sql);
  93. pstmt.setString(1, studentNumber);
  94. ResultSet rs = pstmt.executeQuery();
  95. Student student = new Student();
  96. if (rs.next()) {
  97. student.setName(rs.getString("name"));
  98. student.setDormBuildId(rs.getInt("dormBuildId"));
  99. student.setDormName(rs.getString("dormName"));
  100. return true;
  101. }
  102. return false;
  103. }
  104. public List<Student> studentListWithBuild(Connection con, Student s_student, int buildId) throws Exception {
  105. List<Student> studentList = new ArrayList<Student>();
  106. StringBuffer sb = new StringBuffer("select * from t_student t1");
  107. if (StringUtil.isNotEmpty(s_student.getName())) {
  108. sb.append(" and t1.name like '%" + s_student.getName() + "%'");
  109. } else if (StringUtil.isNotEmpty(s_student.getStuNumber())) {
  110. sb.append(" and t1.stuNum like '%" + s_student.getStuNumber() + "%'");
  111. } else if (StringUtil.isNotEmpty(s_student.getDormName())) {
  112. sb.append(" and t1.dormName like '%" + s_student.getDormName() + "%'");
  113. }
  114. sb.append(" and t1.dormBuildId=" + buildId);
  115. PreparedStatement pstmt = con.prepareStatement(sb.toString().replaceFirst("and", "where"));
  116. ResultSet rs = pstmt.executeQuery();
  117. while (rs.next()) {
  118. Student student = new Student();
  119. student.setStudentId(rs.getInt("studentId"));
  120. int dormBuildId = rs.getInt("dormBuildId");
  121. student.setDormBuildId(dormBuildId);
  122. student.setDormBuildName(DormBuildDao.dormBuildName(con, dormBuildId));
  123. student.setDormName(rs.getString("dormName"));
  124. student.setName(rs.getString("name"));
  125. student.setSex(rs.getString("sex"));
  126. student.setStuNumber(rs.getString("stuNum"));
  127. student.setTel(rs.getString("tel"));
  128. student.setPassword(rs.getString("password"));
  129. studentList.add(student);
  130. }
  131. return studentList;
  132. }
  133. public List<DormBuild> dormBuildList(Connection con) throws Exception {
  134. List<DormBuild> dormBuildList = new ArrayList<DormBuild>();
  135. String sql = "select * from t_dormBuild";
  136. PreparedStatement pstmt = con.prepareStatement(sql);
  137. ResultSet rs = pstmt.executeQuery();
  138. while (rs.next()) {
  139. DormBuild dormBuild = new DormBuild();
  140. dormBuild.setDormBuildId(rs.getInt("dormBuildId"));
  141. dormBuild.setDormBuildName(rs.getString("dormBuildName"));
  142. dormBuild.setDetail(rs.getString("dormBuildDetail"));
  143. dormBuildList.add(dormBuild);
  144. }
  145. return dormBuildList;
  146. }
  147. public int studentCount(Connection con, Student s_student) throws Exception {
  148. StringBuffer sb = new StringBuffer("select count(*) as total from t_student t1");
  149. if (StringUtil.isNotEmpty(s_student.getName())) {
  150. sb.append(" and t1.name like '%" + s_student.getName() + "%'");
  151. } else if (StringUtil.isNotEmpty(s_student.getStuNumber())) {
  152. sb.append(" and t1.stuNum like '%" + s_student.getStuNumber() + "%'");
  153. } else if (StringUtil.isNotEmpty(s_student.getDormName())) {
  154. sb.append(" and t1.dormName like '%" + s_student.getDormName() + "%'");
  155. }
  156. if (s_student.getDormBuildId() != 0) {
  157. sb.append(" and t1.dormBuildId=" + s_student.getDormBuildId());
  158. }
  159. PreparedStatement pstmt = con.prepareStatement(sb.toString().replaceFirst("and", "where"));
  160. ResultSet rs = pstmt.executeQuery();
  161. if (rs.next()) {
  162. return rs.getInt("total");
  163. } else {
  164. return 0;
  165. }
  166. }
  167. public Student studentShow(Connection con, String studentId) throws Exception {
  168. String sql = "select * from t_student t1 where t1.studentId=?";
  169. PreparedStatement pstmt = con.prepareStatement(sql);
  170. pstmt.setString(1, studentId);
  171. ResultSet rs = pstmt.executeQuery();
  172. Student student = new Student();
  173. if (rs.next()) {
  174. student.setStudentId(rs.getInt("studentId"));
  175. int dormBuildId = rs.getInt("dormBuildId");
  176. student.setDormBuildId(dormBuildId);
  177. student.setDormBuildName(DormBuildDao.dormBuildName(con, dormBuildId));
  178. student.setDormName(rs.getString("dormName"));
  179. student.setName(rs.getString("name"));
  180. student.setSex(rs.getString("sex"));
  181. student.setStuNumber(rs.getString("stuNum"));
  182. student.setTel(rs.getString("tel"));
  183. student.setPassword(rs.getString("password"));
  184. }
  185. return student;
  186. }
  187. public int studentAdd(Connection con, Student student) throws Exception {
  188. String sql = "insert into t_student values(null,?,?,?,?,?,?,?)";
  189. PreparedStatement pstmt = con.prepareStatement(sql);
  190. pstmt.setString(1, student.getStuNumber());
  191. pstmt.setString(2, student.getPassword());
  192. pstmt.setString(3, student.getName());
  193. pstmt.setInt(4, student.getDormBuildId());
  194. pstmt.setString(5, student.getDormName());
  195. pstmt.setString(6, student.getSex());
  196. pstmt.setString(7, student.getTel());
  197. return pstmt.executeUpdate();
  198. }
  199. public int studentDelete(Connection con, String studentId) throws Exception {
  200. String sql = "delete from t_student where studentId=?";
  201. PreparedStatement pstmt = con.prepareStatement(sql);
  202. pstmt.setString(1, studentId);
  203. return pstmt.executeUpdate();
  204. }
  205. public int studentUpdate(Connection con, Student student) throws Exception {
  206. String sql = "update t_student set stuNum=?,password=?,name=?,dormBuildId=?,dormName=?,sex=?,tel=? where studentId=?";
  207. PreparedStatement pstmt = con.prepareStatement(sql);
  208. pstmt.setString(1, student.getStuNumber());
  209. pstmt.setString(2, student.getPassword());
  210. pstmt.setString(3, student.getName());
  211. pstmt.setInt(4, student.getDormBuildId());
  212. pstmt.setString(5, student.getDormName());
  213. pstmt.setString(6, student.getSex());
  214. pstmt.setString(7, student.getTel());
  215. pstmt.setInt(8, student.getStudentId());
  216. return pstmt.executeUpdate();
  217. }
  218. }

UserDao

  1. package com.lero.dao;
  2. import com.lero.model.Admin;
  3. import com.lero.model.DormManager;
  4. import com.lero.model.Student;
  5. import java.sql.Connection;
  6. import java.sql.PreparedStatement;
  7. import java.sql.ResultSet;
  8. public class UserDao {
  9. public Admin Login(Connection con, Admin admin) throws Exception {
  10. Admin resultAdmin = null;
  11. String sql = "select * from t_admin where userName=? and password=?";
  12. PreparedStatement pstmt = con.prepareStatement(sql);
  13. pstmt.setString(1, admin.getUserName());
  14. pstmt.setString(2, admin.getPassword());
  15. ResultSet rs = pstmt.executeQuery();
  16. if (rs.next()) {
  17. resultAdmin = new Admin();
  18. resultAdmin.setAdminId(rs.getInt("adminId"));
  19. resultAdmin.setUserName(rs.getString("userName"));
  20. resultAdmin.setPassword(rs.getString("password"));
  21. resultAdmin.setName(rs.getString("name"));
  22. resultAdmin.setSex(rs.getString("sex"));
  23. resultAdmin.setTel(rs.getString("tel"));
  24. }
  25. return resultAdmin;
  26. }
  27. public DormManager Login(Connection con, DormManager dormManager) throws Exception {
  28. DormManager resultDormManager = null;
  29. String sql = "select * from t_dormmanager where userName=? and password=?";
  30. PreparedStatement pstmt = con.prepareStatement(sql);
  31. pstmt.setString(1, dormManager.getUserName());
  32. pstmt.setString(2, dormManager.getPassword());
  33. ResultSet rs = pstmt.executeQuery();
  34. if (rs.next()) {
  35. resultDormManager = new DormManager();
  36. resultDormManager.setDormManagerId(rs.getInt("dormManId"));
  37. resultDormManager.setUserName(rs.getString("userName"));
  38. resultDormManager.setPassword(rs.getString("password"));
  39. resultDormManager.setDormBuildId(rs.getInt("dormBuildId"));
  40. resultDormManager.setName(rs.getString("name"));
  41. resultDormManager.setSex(rs.getString("sex"));
  42. resultDormManager.setTel(rs.getString("tel"));
  43. }
  44. return resultDormManager;
  45. }
  46. public Student Login(Connection con, Student student) throws Exception {
  47. Student resultStudent = null;
  48. String sql = "select * from t_student where stuNum=? and password=?";
  49. PreparedStatement pstmt = con.prepareStatement(sql);
  50. pstmt.setString(1, student.getStuNumber());
  51. pstmt.setString(2, student.getPassword());
  52. ResultSet rs = pstmt.executeQuery();
  53. if (rs.next()) {
  54. resultStudent = new Student();
  55. resultStudent.setStudentId(rs.getInt("studentId"));
  56. resultStudent.setStuNumber(rs.getString("stuNum"));
  57. resultStudent.setPassword(rs.getString("password"));
  58. int dormBuildId = rs.getInt("dormBuildId");
  59. resultStudent.setDormBuildId(dormBuildId);
  60. resultStudent.setDormBuildName(DormBuildDao.dormBuildName(con, dormBuildId));
  61. resultStudent.setDormName(rs.getString("dormName"));
  62. resultStudent.setName(rs.getString("name"));
  63. resultStudent.setSex(rs.getString("sex"));
  64. resultStudent.setTel(rs.getString("tel"));
  65. }
  66. return resultStudent;
  67. }
  68. public int adminUpdate(Connection con, int adminId, String password) throws Exception {
  69. String sql = "update t_admin set password=? where adminId=?";
  70. PreparedStatement pstmt = con.prepareStatement(sql);
  71. pstmt.setString(1, password);
  72. pstmt.setInt(2, adminId);
  73. return pstmt.executeUpdate();
  74. }
  75. public int managerUpdate(Connection con, int managerId, String password) throws Exception {
  76. String sql = "update t_dormmanager set password=? where dormManId=?";
  77. PreparedStatement pstmt = con.prepareStatement(sql);
  78. pstmt.setString(1, password);
  79. pstmt.setInt(2, managerId);
  80. return pstmt.executeUpdate();
  81. }
  82. public int studentUpdate(Connection con, int studentId, String password) throws Exception {
  83. String sql = "update t_student set password=? where studentId=?";
  84. PreparedStatement pstmt = con.prepareStatement(sql);
  85. pstmt.setString(1, password);
  86. pstmt.setInt(2, studentId);
  87. return pstmt.executeUpdate();
  88. }
  89. }

PropertiesUtil

  1. package com.lero.util;
  2. import java.io.IOException;
  3. import java.io.InputStream;
  4. import java.util.Properties;
  5. public class PropertiesUtil {
  6. public static String getValue(String key) {
  7. Properties prop = new Properties();
  8. InputStream in = new PropertiesUtil().getClass().getResourceAsStream("/dorm.properties");
  9. try {
  10. prop.load(in);
  11. } catch (IOException e) {
  12. e.printStackTrace();
  13. }
  14. return (String) prop.get(key);
  15. }
  16. }

login.jsp

  1. <%@ page language="java" contentType="text/html; charset=utf-8"
  2. pageEncoding="utf-8" %>
  3. <%@ page import="com.lero.model.Admin" %>
  4. <%@ page import="com.lero.model.DormManager" %>
  5. <%@ page import="com.lero.model.Student" %>
  6. <%
  7. if (request.getAttribute("user") == null) {
  8. String userName = null;
  9. String password = null;
  10. String userType = null;
  11. String remember = null;
  12. Cookie[] cookies = request.getCookies();
  13. for (int i = 0; cookies != null && i < cookies.length; i++) {
  14. if (cookies[i].getName().equals("dormuser")) {
  15. userName = cookies[i].getValue().split("-")[0];
  16. password = cookies[i].getValue().split("-")[1];
  17. userType = cookies[i].getValue().split("-")[2];
  18. remember = cookies[i].getValue().split("-")[3];
  19. }
  20. }
  21. if (userName == null) {
  22. userName = "";
  23. }
  24. if (password == null) {
  25. password = "";
  26. }
  27. if (userType == null) {
  28. userType = "";
  29. } else if ("admin".equals(userType)) {
  30. pageContext.setAttribute("user", new Admin(userName, password));
  31. pageContext.setAttribute("userType", 1);
  32. } else if ("dormManager".equals(userType)) {
  33. pageContext.setAttribute("user", new DormManager(userName, password));
  34. pageContext.setAttribute("userType", 2);
  35. } else if ("student".equals(userType)) {
  36. pageContext.setAttribute("user", new Student(userName, password));
  37. pageContext.setAttribute("userType", 3);
  38. }
  39. if ("yes".equals(remember)) {
  40. pageContext.setAttribute("remember", 1);
  41. }
  42. }
  43. %>
  44. <html lang="zh">
  45. <head>
  46. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  47. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  48. <title>宿舍管理系统登录</title>
  49. <link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.css" rel="stylesheet">
  50. <link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
  51. <script src="${pageContext.request.contextPath}/bootstrap/js/jQuery.js"></script>
  52. <script src="${pageContext.request.contextPath}/bootstrap/js/bootstrap.js"></script>
  53. <script type="text/javascript">
  54. function checkForm() {
  55. var userName = document.getElementById("userName").value;
  56. var password = document.getElementById("password").value;
  57. var userTypes = document.getElementsByName("userType");
  58. var userType = null;
  59. for (var i = 0; i < userTypes.length; i++) {
  60. if (userTypes[i].checked) {
  61. userType = userTypes[i].value;
  62. break;
  63. }
  64. }
  65. if (userName == null || userName == "") {
  66. document.getElementById("error").innerHTML = "用户名不能为空";
  67. return false;
  68. }
  69. if (password == null || password == "") {
  70. document.getElementById("error").innerHTML = "密码不能为空";
  71. return false;
  72. }
  73. if (userType == null || userType == "") {
  74. document.getElementById("error").innerHTML = "请选择用户类型";
  75. return false;
  76. }
  77. return true;
  78. }
  79. </script>
  80. <style type="text/css">
  81. body {
  82. padding-top: 200px;
  83. padding-bottom: 40px;
  84. background-image: url('images/bg.jpg');
  85. background-position: center;
  86. background-repeat: no-repeat;
  87. background-attachment: fixed;
  88. }
  89. .radio {
  90. padding-top: 10px;
  91. padding-bottom: 10px;
  92. }
  93. .form-signin-heading {
  94. text-align: center;
  95. }
  96. .form-signin {
  97. max-width: 300px;
  98. padding: 19px 29px 0px;
  99. margin: 0 auto 20px;
  100. background-color: #fff;
  101. border: 1px solid #e5e5e5;
  102. -webkit-border-radius: 5px;
  103. -moz-border-radius: 5px;
  104. border-radius: 5px;
  105. -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  106. -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  107. box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  108. }
  109. .form-signin .form-signin-heading,
  110. .form-signin .checkbox {
  111. margin-bottom: 10px;
  112. }
  113. .form-signin input[type="text"],
  114. .form-signin input[type="password"] {
  115. font-size: 16px;
  116. height: auto;
  117. margin-bottom: 15px;
  118. padding: 7px 9px;
  119. }
  120. </style>
  121. </head>
  122. <body>
  123. <div class="container">
  124. <form name="myForm" class="form-signin" action="login" method="post" onsubmit="return checkForm()">
  125. <h2 class="form-signin-heading"><font color="gray">宿舍管理系统</font></h2>
  126. <input id="userName" name="userName" value="${user.userName }" type="text" class="input-block-level"
  127. placeholder="账号">
  128. <input id="password" name="password" value="${user.password }" type="password" class="input-block-level"
  129. placeholder="密码">
  130. <label class="radio inline">
  131. <input id="admin" type="radio" name="userType" value="admin" checked/> 系统管理员
  132. </label>
  133. <label class="radio inline">
  134. <input id="dormManager" type="radio" name="userType" value="dormManager" ${userType==2?'checked':''} />
  135. 宿舍管理员
  136. </label>
  137. <label class="radio inline">
  138. <input id="student" type="radio" name="userType" value="student" ${userType==3?'checked':''}/> 学生
  139. </label>
  140. <label class="checkbox">
  141. <input id="remember" name="remember" type="checkbox" value="remember-me" ${remember==1?'checked':''}>记住我
  142. &nbsp;&nbsp;&nbsp;&nbsp; <font id="error" color="red">${error }</font>
  143. </label>
  144. <button class="btn btn-large btn-primary" type="submit">登录</button>
  145. &nbsp;&nbsp;&nbsp;&nbsp;
  146. <button class="btn btn-large btn-primary" type="button">重置</button>
  147. <p align="center" style="padding-top: 15px;">版权所有2021</p>
  148. </form>
  149. </div>
  150. </body>
  151. </html>

mainAdmin.jsp

  1. <%@ page language="java" contentType="text/html; charset=utf-8"
  2. pageEncoding="utf-8" %>
  3. <html lang="zh">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>宿舍管理系统</title>
  8. <link href="${pageContext.request.contextPath}/style/dorm.css" rel="stylesheet">
  9. <link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.css" rel="stylesheet">
  10. <link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
  11. <link href="${pageContext.request.contextPath}/bootstrap-datetimepicker-master/css/bootstrap-datetimepicker.min.css"
  12. rel="stylesheet" media="screen">
  13. <link rel="stylesheet" type="text/css"
  14. href="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/dataTables.bootstra.css">
  15. <script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/jquery.js"></script>
  16. <script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/jquery.dataTables.js"></script>
  17. <script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/bootstrap.min.js"></script>
  18. <script type="text/javascript"
  19. src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/dataTables.bootstrap.js"></script>
  20. <script type="text/javascript"
  21. src="${pageContext.request.contextPath}/bootstrap-datetimepicker-master/js/bootstrap-datetimepicker.js"
  22. charset="UTF-8"></script>
  23. <script type="text/javascript"
  24. src="${pageContext.request.contextPath}/bootstrap-datetimepicker-master/js/locales/bootstrap-datetimepicker.fr.js"
  25. charset="UTF-8"></script>
  26. <script src="${pageContext.request.contextPath}/bootstrap/js/bootstrap.js"></script>
  27. <script type="text/javascript">
  28. $(document).ready(function () {
  29. $("#DataTables_Table_0_wrapper .row-fluid").remove();
  30. });
  31. </script>
  32. <style type="text/css">
  33. .bs-docs-sidenav {
  34. background-color: #fff;
  35. border-radius: 6px;
  36. box-shadow: 0 1px 4px rgba(0, 0, 0, 0.067);
  37. padding: 0;
  38. width: 228px;
  39. }
  40. .bs-docs-sidenav > li > a {
  41. border: 1px solid #e5e5e5;
  42. display: block;
  43. padding: 8px 14px;
  44. margin: 0 0 -1px;
  45. }
  46. .bs-docs-sidenav > li:first-child > a {
  47. border-radius: 6px 6px 0 0;
  48. }
  49. .bs-docs-sidenav > li:last-child > a {
  50. border-radius: 0 0 6px 6px;
  51. }
  52. .bs-docs-sidenav > .active > a {
  53. border: 0 none;
  54. box-shadow: 1px 0 0 rgba(0, 0, 0, 0.1) inset, -1px 0 0 rgba(0, 0, 0, 0.1) inset;
  55. padding: 9px 15px;
  56. position: relative;
  57. text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
  58. z-index: 2;
  59. }
  60. .bs-docs-sidenav .icon-chevron-right {
  61. float: right;
  62. margin-right: -6px;
  63. margin-top: 2px;
  64. opacity: 0.25;
  65. }
  66. .bs-docs-sidenav > li > a:hover {
  67. background-color: #f5f5f5;
  68. }
  69. .bs-docs-sidenav a:hover .icon-chevron-right {
  70. opacity: 0.5;
  71. }
  72. .bs-docs-sidenav .active .icon-chevron-right, .bs-docs-sidenav .active a:hover .icon-chevron-right {
  73. background-image: url("../img/glyphicons-halflings-white.png");
  74. opacity: 1;
  75. }
  76. </style>
  77. </head>
  78. <body>
  79. <div class="container-fluid" style="padding-right: 0px;padding-left: 0px;">
  80. <div region="north" style="height: 100px;background-image: url('images/bg.jpg')">
  81. <div align="left" style="width: 80%;height:100px ;float: left;padding-top: 40px;padding-left: 30px;"><font
  82. color="white" size="6">宿舍管理系统</font></div>
  83. <div style="padding-top: 70px;padding-right: 20px;">当前用户:&nbsp;<font color="red">${currentUser.userName }</font>
  84. </div>
  85. </div>
  86. </div>
  87. <div class="container-fluid">
  88. <div class="row-fluid">
  89. <div class="span2 bs-docs-sidebar">
  90. <ul class="nav nav-list bs-docs-sidenav">
  91. <li><a href="blank"><i class="icon-chevron-right"></i>首页</a></li>
  92. <li><a href="dormManager?action=list"><i class="icon-chevron-right"></i>宿舍管理员管理</a></li>
  93. <li><a href="student?action=list"><i class="icon-chevron-right"></i>学生管理</a></li>
  94. <li><a href="dormBuild?action=list"><i class="icon-chevron-right"></i>宿舍楼管理</a></li>
  95. <li><a href="record?action=list"><i class="icon-chevron-right"></i>缺勤记录</a></li>
  96. <li><a href="password?action=preChange"><i class="icon-chevron-right"></i>修改密码</a></li>
  97. <li><a href="login.jsp"><i class="icon-chevron-right"></i>退出系统</a></li>
  98. </ul>
  99. </div>
  100. <div class="span10">
  101. <jsp:include page="${mainPage==null?'admin/blank.jsp':mainPage}"></jsp:include>
  102. </div>
  103. </div>
  104. </div>
  105. </body>
  106. </html>

mainManager.jsp

  1. <%@ page language="java" contentType="text/html; charset=utf-8"
  2. pageEncoding="utf-8" %>
  3. <html lang="zh">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>宿舍管理系统</title>
  8. <link href="${pageContext.request.contextPath}/style/dorm.css" rel="stylesheet">
  9. <link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.css" rel="stylesheet">
  10. <link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
  11. <link href="${pageContext.request.contextPath}/bootstrap-datetimepicker-master/css/bootstrap-datetimepicker.min.css"
  12. rel="stylesheet" media="screen">
  13. <link rel="stylesheet" type="text/css"
  14. href="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/dataTables.bootstra.css">
  15. <script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/jquery.js"></script>
  16. <script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/jquery.dataTables.js"></script>
  17. <script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/bootstrap.min.js"></script>
  18. <script type="text/javascript"
  19. src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/dataTables.bootstrap.js"></script>
  20. <script type="text/javascript"
  21. src="${pageContext.request.contextPath}/bootstrap-datetimepicker-master/js/bootstrap-datetimepicker.js"
  22. charset="UTF-8"></script>
  23. <script type="text/javascript"
  24. src="${pageContext.request.contextPath}/bootstrap-datetimepicker-master/js/locales/bootstrap-datetimepicker.fr.js"
  25. charset="UTF-8"></script>
  26. <script src="${pageContext.request.contextPath}/bootstrap/js/bootstrap.js"></script>
  27. <script type="text/javascript">
  28. $(document).ready(function () {
  29. $("#DataTables_Table_0_wrapper .row-fluid").remove();
  30. });
  31. </script>
  32. <style type="text/css">
  33. .bs-docs-sidenav {
  34. background-color: #fff;
  35. border-radius: 6px;
  36. box-shadow: 0 1px 4px rgba(0, 0, 0, 0.067);
  37. padding: 0;
  38. width: 228px;
  39. }
  40. .bs-docs-sidenav > li > a {
  41. border: 1px solid #e5e5e5;
  42. display: block;
  43. padding: 8px 14px;
  44. margin: 0 0 -1px;
  45. }
  46. .bs-docs-sidenav > li:first-child > a {
  47. border-radius: 6px 6px 0 0;
  48. }
  49. .bs-docs-sidenav > li:last-child > a {
  50. border-radius: 0 0 6px 6px;
  51. }
  52. .bs-docs-sidenav > .active > a {
  53. border: 0 none;
  54. box-shadow: 1px 0 0 rgba(0, 0, 0, 0.1) inset, -1px 0 0 rgba(0, 0, 0, 0.1) inset;
  55. padding: 9px 15px;
  56. position: relative;
  57. text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
  58. z-index: 2;
  59. }
  60. .bs-docs-sidenav .icon-chevron-right {
  61. float: right;
  62. margin-right: -6px;
  63. margin-top: 2px;
  64. opacity: 0.25;
  65. }
  66. .bs-docs-sidenav > li > a:hover {
  67. background-color: #f5f5f5;
  68. }
  69. .bs-docs-sidenav a:hover .icon-chevron-right {
  70. opacity: 0.5;
  71. }
  72. .bs-docs-sidenav .active .icon-chevron-right, .bs-docs-sidenav .active a:hover .icon-chevron-right {
  73. background-image: url("../img/glyphicons-halflings-white.png");
  74. opacity: 1;
  75. }
  76. </style>
  77. </head>
  78. <body>
  79. <div class="container-fluid" style="padding-right: 0px;padding-left: 0px;">
  80. <div region="north" style="height: 100px;background-image: url('images/bg.jpg')">
  81. <div align="left" style="width: 80%;height:100px ;float: left;padding-top: 40px;padding-left: 30px;"><font
  82. color="white" size="6">宿舍管理系统</font></div>
  83. <div style="padding-top: 70px;padding-right: 20px;">当前用户:&nbsp;<font color="red">${currentUser.userName }</font>
  84. </div>
  85. </div>
  86. </div>
  87. <div class="container-fluid">
  88. <div class="row-fluid">
  89. <div class="span2 bs-docs-sidebar">
  90. <ul class="nav nav-list bs-docs-sidenav">
  91. <li><a href="blank"><i class="icon-chevron-right"></i>首页</a></li>
  92. <li><a href="student?action=list"><i class="icon-chevron-right"></i>学生查看</a></li>
  93. <li><a href="record?action=list"><i class="icon-chevron-right"></i>缺勤记录</a></li>
  94. <li><a href="password?action=preChange"><i class="icon-chevron-right"></i>修改密码</a></li>
  95. <li><a href="login.jsp"><i class="icon-chevron-right"></i>退出系统</a></li>
  96. </ul>
  97. </div>
  98. <div class="span10">
  99. <jsp:include page="${mainPage==null?'admin/blank.jsp':mainPage}"></jsp:include>
  100. </div>
  101. </div>
  102. </div>
  103. </body>
  104. </html>

mainStudent.jsp

  1. <%@ page language="java" contentType="text/html; charset=utf-8"
  2. pageEncoding="utf-8" %>
  3. <html lang="zh">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>宿舍管理系统</title>
  8. <link href="${pageContext.request.contextPath}/style/dorm.css" rel="stylesheet">
  9. <link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.css" rel="stylesheet">
  10. <link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
  11. <link href="${pageContext.request.contextPath}/bootstrap-datetimepicker-master/css/bootstrap-datetimepicker.min.css"
  12. rel="stylesheet" media="screen">
  13. <link rel="stylesheet" type="text/css"
  14. href="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/dataTables.bootstra.css">
  15. <script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/jquery.js"></script>
  16. <script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/jquery.dataTables.js"></script>
  17. <script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/bootstrap.min.js"></script>
  18. <script type="text/javascript"
  19. src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/dataTables.bootstrap.js"></script>
  20. <script type="text/javascript"
  21. src="${pageContext.request.contextPath}/bootstrap-datetimepicker-master/js/bootstrap-datetimepicker.js"
  22. charset="UTF-8"></script>
  23. <script type="text/javascript"
  24. src="${pageContext.request.contextPath}/bootstrap-datetimepicker-master/js/locales/bootstrap-datetimepicker.fr.js"
  25. charset="UTF-8"></script>
  26. <script src="${pageContext.request.contextPath}/bootstrap/js/bootstrap.js"></script>
  27. <script type="text/javascript">
  28. $(document).ready(function () {
  29. $("#DataTables_Table_0_wrapper .row-fluid").remove();
  30. });
  31. </script>
  32. <style type="text/css">
  33. .bs-docs-sidenav {
  34. background-color: #fff;
  35. border-radius: 6px;
  36. box-shadow: 0 1px 4px rgba(0, 0, 0, 0.067);
  37. padding: 0;
  38. width: 228px;
  39. }
  40. .bs-docs-sidenav > li > a {
  41. border: 1px solid #e5e5e5;
  42. display: block;
  43. padding: 8px 14px;
  44. margin: 0 0 -1px;
  45. }
  46. .bs-docs-sidenav > li:first-child > a {
  47. border-radius: 6px 6px 0 0;
  48. }
  49. .bs-docs-sidenav > li:last-child > a {
  50. border-radius: 0 0 6px 6px;
  51. }
  52. .bs-docs-sidenav > .active > a {
  53. border: 0 none;
  54. box-shadow: 1px 0 0 rgba(0, 0, 0, 0.1) inset, -1px 0 0 rgba(0, 0, 0, 0.1) inset;
  55. padding: 9px 15px;
  56. position: relative;
  57. text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
  58. z-index: 2;
  59. }
  60. .bs-docs-sidenav .icon-chevron-right {
  61. float: right;
  62. margin-right: -6px;
  63. margin-top: 2px;
  64. opacity: 0.25;
  65. }
  66. .bs-docs-sidenav > li > a:hover {
  67. background-color: #f5f5f5;
  68. }
  69. .bs-docs-sidenav a:hover .icon-chevron-right {
  70. opacity: 0.5;
  71. }
  72. .bs-docs-sidenav .active .icon-chevron-right, .bs-docs-sidenav .active a:hover .icon-chevron-right {
  73. background-image: url("../img/glyphicons-halflings-white.png");
  74. opacity: 1;
  75. }
  76. </style>
  77. </head>
  78. <body>
  79. <div class="container-fluid" style="padding-right: 0px;padding-left: 0px;">
  80. <div region="north" style="height: 100px;background-image: url('images/bg.jpg')">
  81. <div align="left" style="width: 80%;height:100px ;float: left;padding-top: 40px;padding-left: 30px;"><font
  82. color="white" size="6">宿舍管理系统</font></div>
  83. <div style="padding-top: 70px;padding-right: 20px;">当前用户:&nbsp;<font color="red">${currentUser.userName }</font>
  84. </div>
  85. </div>
  86. </div>
  87. <div class="container-fluid">
  88. <div class="row-fluid">
  89. <div class="span2 bs-docs-sidebar">
  90. <ul class="nav nav-list bs-docs-sidenav">
  91. <li><a href="blank"><i class="icon-chevron-right"></i>首页</a></li>
  92. <li><a href="record?action=list"><i class="icon-chevron-right"></i>缺勤记录</a></li>
  93. <li><a href="password?action=preChange"><i class="icon-chevron-right"></i>修改密码</a></li>
  94. <li><a href="login.jsp"><i class="icon-chevron-right"></i>退出系统</a></li>
  95. </ul>
  96. </div>
  97. <div class="span10">
  98. <jsp:include page="${mainPage==null?'admin/blank.jsp':mainPage}"></jsp:include>
  99. </div>
  100. </div>
  101. </div>
  102. </body>
  103. </html>

四、其他

1.其他系统实现

1.JavaWeb系统系列实现

Java+JSP实现学生图书管理系统

Java+JSP实现学生信息管理系统

Java+JSP实现用户信息管理系统

Java+Servlet+JSP实现航空订票系统

Java+Servlet+JSP实现新闻发布系统

Java+Servlet+JSP实现学生信息管理系统

Java+Servlet+JSP实现学生选课管理系统

Java+Servlet+JSP实现学生成绩管理系统-1

Java+Servlet+JSP实现学生成绩管理系统-2

Java+Servlet+JSP实现宠物诊所管理系统

Java+SSM+JSP实现网上考试系统

Java+SSH+JSP实现在线考试系统

Java+Springboot+Mybatis+Bootstrap+Maven实现网上商城系统

2.JavaSwing系统系列实现

Java+Swing实现斗地主游戏

Java+Swing实现图书管理系统

Java+Swing实现医院管理系统

Java+Swing实现考试管理系统

Java+Swing实现仓库管理系统-1

Java+Swing实现仓库管理系统-2

Java+Swing实现自助取款机系统

Java+Swing实现通讯录管理系统

Java+Swing实现停车场管理系统

Java+Swing实现学生信息管理系统

Java+Swing实现学生宿舍管理系统

Java+Swing实现学生选课管理系统

Java+Swing实现学生成绩管理系统

Java+Swing实现学校教材管理系统

Java+Swing实现学校教务管理系统

Java+Swing实现企业人事管理系统

Java+Swing实现电子相册管理系统

Java+Swing实现超市管理系统-TXT存储数据

Java+Swing实现自助取款机系统-TXT存储数据

Java+Swing实现宠物商店管理系统-TXT存储数据

2.获取源码

点击以下链接获取源码,数据库文件在sql文件下面。

Java+Servlet+JSP+Bootstrap+Mysql学生宿舍管理系统源码

3.运行项目

请点击以下链接,部署你的项目。

IDEA如何导入JavaWeb项目超详细视频教程

4.备注

如有侵权请联系我删除。

5.支持博主

如果您觉得此文对您有帮助,请点赞加关注加收藏。祝您生活愉快!想要获取其他资源可关注左侧微信公众号获取!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/631620
推荐阅读
相关标签
  

闽ICP备14008679号