精华内容
下载资源
问答
  • 宿舍管理系统
    2021-09-23 23:48:38

    开发工具:idea
    数据库:mysql

     

    宿舍管理系统

    宿舍管理系统

    宿舍管理系统

    宿舍管理系统


    系统运用了MySQL为后台数据库,easyui作为前台技术,使用了当前较为流行的框架spring MVC+hibernate+spring架构,应用服务器使用了tomcat,以eclipse为开发工具,
    系统基本功能需求
    主要实现的是学生宿舍管理系统,在设计该系统时,应尽可能的贴近用户,便于用户操作。系统在实现上应该具有如下功能:

    1. 系统要求用户输入正确的账号和密码才能进入系统。

    2. 系统提供普通用户管理权限,可根据角色进行权限分配,能根据实施情况,增加或者删除多余宿舍,同时根据现有情况预估房间的需求量。

    3. 系统应该提供学生的入住信息的录入,转换宿舍以及退宿舍的信息登记。

    4. 系统应提供普通用户的信息查询功能(按多种方式查询)及统计功能。

    5. 系统应提供信息维护功能,对学生信息修改,删除。

    6. 系统应提供超级管理员增加、删除用户账户的功能。

    7. 系统应提供宿舍评分功能。

    8. 系统应提供宿舍损坏情况统计功能。
      3.1.2 功能模块
      宿舍管理系统主要实现的功能有:学生管理、宿舍管理、评分管理、损坏管理、访客管理、班级管

    更多相关内容
  • 学生宿舍管理系统课程设计报告=代码
  • 随着科技的发展,智能化管理越来越重要。大学生在宿舍的时间超过了 1/3...学生宿舍管理系统能够合理安排新生分配宿舍,不浪费公共资源,减轻学校管理压力,同时减少宿舍内同学之间的矛盾,促使学生享受舒适的校园生活。
  • JavaWeb宿舍管理系统项目源码 下载

    千次下载 2017-04-22 15:44:23
    项目分管理员、宿舍管理员以及学生三个类型。 管理员:宿舍管理员管理、学生管理、宿舍管理、缺勤记录、修改密码、退出登录。 宿舍管理员:学生查看、缺勤记录、修改密码、退出登录。 学生:缺勤记录、修改密码、...
  • 项目描述 Java+MySQL+EasyUI框架,实现的宿舍管理系统的项目 运行环境 jdk7+tomcat7+mysql+IntelliJ IDEA 项目技术(必填) jsp+java servlet+easyui+jquery+css
  • 上传的资源为学生宿舍管理系统(内含前台与后台管理),基本语言采用的是Java+jsp的动态web项目,内含mysql数据库脚本与项目源代码,该管理系统基于Java Web开发技术主要实现了学生信息、宿舍信息、管理员信息、考勤...
  • 使用MyEclipse开发,简单使用mysql管理学生住宿信息
  • Java+JSP+Mysql实现Web学生宿舍管理系统,sql在sql文件夹下面;系统实现管理员登录系统,管理员对宿舍信息的增删改查。

    目录

    一、系统介绍

    1.开发环境

    2.技术选型

    3.系统功能

    4.数据库文件

    5.系统截图

    二、系统展示

    1.登录系统

    2.系统主页

    3.新增宿舍

    4.修改宿舍

    三、部分代码 

    AdminDaoImpl

    DormDaoImpl

    dorm-add.jsp

    dorm-add-do.jsp

    四、其他

    1.更多系统

    Java+JSP系统系列实现

    Java+Servlet系统系列实现

    Java+SSM系统系列实现

    Java+SSH系统系列实现

    Java+Springboot系统系列实现

    2.源码下载

    3.运行项目

    4.备注

    5.支持博主


    一、系统介绍

    1.开发环境

    开发工具:IDEA2018

    JDK版本:Jdk1.8

    Mysql版本:8.0.13

    2.技术选型

    Java+Jsp+Mysql

    3.系统功能

    1.登录系统;

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

    4.数据库文件

    /*
     Navicat Premium Data Transfer
    
     Source Server         : MYSQL
     Source Server Type    : MySQL
     Source Server Version : 80013
     Source Host           : localhost:3306
     Source Schema         : jsp_dorm_management
    
     Target Server Type    : MySQL
     Target Server Version : 80013
     File Encoding         : 65001
    
     Date: 28/02/2022 17:24:06
    */
    
    SET NAMES utf8mb4;
    SET FOREIGN_KEY_CHECKS = 0;
    
    -- ----------------------------
    -- Table structure for admin
    -- ----------------------------
    DROP TABLE IF EXISTS `admin`;
    CREATE TABLE `admin`  (
      `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
      `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL
    ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;
    
    -- ----------------------------
    -- Records of admin
    -- ----------------------------
    INSERT INTO `admin` VALUES ('admin', 'admin');
    
    -- ----------------------------
    -- Table structure for dorm
    -- ----------------------------
    DROP TABLE IF EXISTS `dorm`;
    CREATE TABLE `dorm`  (
      `id` int(11) NOT NULL,
      `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
      `num` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
      `head` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL
    ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
    
    -- ----------------------------
    -- Records of dorm
    -- ----------------------------
    INSERT INTO `dorm` VALUES (1001, '燕园一栋', '4', '张三');
    INSERT INTO `dorm` VALUES (1002, '燕园二栋', '4', '李四');
    INSERT INTO `dorm` VALUES (1003, '燕园三栋', '4', '王五');
    INSERT INTO `dorm` VALUES (1004, '燕园四栋', '4', '赵六');
    
    SET FOREIGN_KEY_CHECKS = 1;
    

    5.系统截图

    二、系统展示

    1.登录系统

    2.系统主页

    3.新增宿舍

    4.修改宿舍

    三、部分代码 

    AdminDaoImpl

    package com.sjsq.dao.impl;
    
    import com.sjsq.dao.AdminDao;
    import com.sjsq.utils.DBUtil;
    import com.sjsq.entity.Admin;
    
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    
    /**
     * @author: shuijianshiqing
     * @date: 2022-02-25
     * @description: 登录系统实现
     */
    public class AdminDaoImpl implements AdminDao {
    
        /**
         * 登录系统
         * @param admin
         * @return
         */
        @Override
        public Admin login(Admin admin) {
            Connection con = null;
            PreparedStatement ps = null;
            ResultSet rs = null;
            try {
                // 1.获取数据库连接
                con = DBUtil.getConnection();
                // 2.写sql
                String sql = "select * from admin where username = ? and password = ?";
                // 3.预编译
                ps = con.prepareStatement(sql);
                // 4.设置值
                ps.setObject(1, admin.getUsername());
                ps.setObject(2, admin.getPassword());
                rs = ps.executeQuery();
                Admin adminLogin = null;
                if (rs.next()) {
                    adminLogin = new Admin();
                    // 从数据库中获取值到实体类的setter方法中
                    adminLogin.setUsername(rs.getString("username"));
                    adminLogin.setPassword(rs.getString("password"));
    
                    // 返回的是你查询出来的完整的对象
                    return adminLogin;
    
                }
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            } catch (SQLException e) {
                e.printStackTrace();
            } finally {
                // 关闭资源,避免出现异常
                DBUtil.close(con, ps, rs);
            }
            return null;
        }
    
    }
    


    DormDaoImpl

    package com.sjsq.dao.impl;
    
    import com.sjsq.dao.DormDao;
    import com.sjsq.entity.Dorm;
    import com.sjsq.utils.DBUtil;
    
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.ArrayList;
    import java.util.List;
    
    /**
     * @author: shuijianshiqing
     * @date: 2022-02-25
     * @description:
     */
    public class DormDaoImpl implements DormDao {
        @Override
        public List<Dorm> selectAll(String sql, Object[] arr) {
            Connection con = null;
            PreparedStatement ps = null;
            ResultSet rs = null;
    
            try {
                // 1.连接数据库
                con = DBUtil.getConnection();
                // 2.预编译
                ps = con.prepareStatement(sql);
                if (arr != null) {
                    for (int i = 0; i < arr.length; i++) {
                        // 传入sql的参数,向上转型,某个栏位的查询
                        ps.setObject(i + 1, arr[i]);
                    }
                }
                // 3.执行sql
                rs = ps.executeQuery();
                // 4.保存查询出来的数据到list
                List<Dorm> list = new ArrayList<>();
                while (rs.next()) {
    
                    Dorm dorm = new Dorm();
    
                    dorm.setId(rs.getInt("id"));
                    dorm.setName(rs.getString("name"));
                    dorm.setNum(rs.getString("num"));
                    dorm.setHead(rs.getString("head"));
    
                    list.add(dorm);
                }
                return list;
    
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                // 关闭链接,避免数据库连接过多
                DBUtil.close(con, ps, rs);
            }
            return null;
        }
    
        @Override
        public Dorm selectDorm(Integer id) {
    
            Connection con = null;
            PreparedStatement ps = null;
            ResultSet rs = null;
            try {
                // 1.连接数据库
                con = DBUtil.getConnection();
                // 2.预编译
                String sql = "select * from dorm where id = ?";
                ps = con.prepareStatement(sql);
                ps.setInt(1,id);
                // 3.执行sql
                rs = ps.executeQuery();
                while (rs.next()){
                    Dorm dorm = new Dorm();
                    dorm.setId(rs.getInt("id"));
                    dorm.setName(rs.getString("name"));
                    dorm.setNum(rs.getString("num"));
                    dorm.setHead(rs.getString("head"));
    
                    return dorm;
                }
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            } catch (SQLException e) {
                e.printStackTrace();
            }finally {
                // 关闭资源,避免出现异常
                DBUtil.close(con,ps,rs);
            }
            return null;
        }
    
        @Override
        public boolean addDorm(Dorm dorm) {
            String sql = "insert into dorm values (?,?,?,?)";
            List<Object> list = new ArrayList<Object>();
    
            list.add(dorm.getId());
            list.add(dorm.getName());
            list.add(dorm.getNum());
            list.add(dorm.getHead());
    
            boolean flag = DBUtil.addUpdateDelete(sql,list.toArray());
            if(flag){
                return true;
            }else {
                return false;
            }
        }
    
        @Override
        public boolean updateDorm(Dorm dorm) {
            String sql = "update dorm set name=?,num=?,head=? where id=?";
            List<Object> list = new ArrayList<Object>();
    
    
            list.add(dorm.getName());
            list.add(dorm.getNum());
            list.add(dorm.getHead());
            // 注意id在最后面
            list.add(dorm.getId());
    
            boolean flag = DBUtil.addUpdateDelete(sql,list.toArray());
            if(flag){
                return true;
            }else {
                return false;
            }
        }
    
        @Override
        public boolean deleteDorm(Integer id) {
            String sql = "delete from dorm where id=?";
            List<Object> list = new ArrayList<Object>();
    
            list.add(id);
    
            boolean flag = DBUtil.addUpdateDelete(sql,list.toArray());
            if(flag){
                return true;
            }else {
                return false;
            }
        }
    }
    

    dorm-add.jsp

    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>新增宿舍</title>
        <link rel="stylesheet" type="text/css" href="css/common.css">
    </head>
    <body>
    <%-- 头部 --%>
    <jsp:include page="top.jsp"/>
    
    <h1>新增宿舍</h1>
    <hr/>
    
    <div id="before">
        <a href="javascript: window.history.go(-1)">返回上一级</a>
    </div>
    </br>
    
    <form action="dorm-add-do.jsp" method="post" name="addForm">
        <div>
            <tr>
                <label>宿舍编号:</label>
                <input type="text" name="id" id="id" placeholder="请输入宿舍编号">
            </tr>
        </div>
        <div>
            <tr>
                <label>宿舍名称:</label>
                <input type="text" name="name" id="name" placeholder="请输入宿舍名称">
            </tr>
        </div>
        <div>
            <tr>
                <label>宿舍人数:</label>
                <input type="text" name="num" id="num" placeholder="请输入宿舍人数">
            </tr>
        </div>
    
        <div>
            <tr>
                <label>宿舍长名:</label>
                <input type="text" name="headname" id="headname" placeholder="请输入宿舍长名">
            </tr>
        </div>
    
        <br>
        <div id="submit">
            <tr>
                <button type="submit" onclick="return checkForm()">添加</button>
                <button type="reset">重置</button>
    
            </tr>
        </div>
    </form>
    
    <script type="text/javascript">
        function checkForm() {
            var id = addForm.id.value;
            var name = addForm.name.value;
            // 教职工号和姓名不能为空
            if (id == "" || id == null) {
                alert("请输入宿舍编号");
                addForm.id.focus();
                return false;
            } else if (name == "" || name == null) {
                alert("请输入宿舍名称");
                addForm.name.focus();
                return false;
            }
            return true;
        }
    </script>
    
    <%-- 底部 --%>
    <jsp:include page="bottom.jsp"/>
    </body>
    </html>
    

    dorm-add-do.jsp

    <%@ page import="com.sjsq.entity.Dorm" %>
    <%@ page import="com.sjsq.service.DormService" %>
    <%@ page import="com.sjsq.service.impl.DormServiceImpl" %>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <html>
    <head>
        <title>新增宿舍</title>
    </head>
    <body>
    <%
        // 设置获取注册时的编码为UTF-8
        request.setCharacterEncoding("UTF-8");
    
        //获取teacher-add.jsp页面提交的账号和密码,注意传过来的是字符串需要进行转化为对应的类型
        Integer id = Integer.parseInt(request.getParameter("id"));
        String name = request.getParameter("name");
        String num = request.getParameter("num");
        String head = request.getParameter("headname");
    
    
    
        // 将信息保存到实体类中
        Dorm dorm = new Dorm();
    
        dorm.setId(id);
        dorm.setName(name);
        dorm.setNum(num);
        dorm.setHead(head);
    
        System.out.println("添加的宿舍信息");
        System.out.println(dorm);
    
    
    
        // 将数据写入到数据库
        DormService dormService = new DormServiceImpl();
        boolean flag = dormService.addDorm(dorm);
    
        if(flag){
            response.sendRedirect("main.jsp");
        }else{
            response.sendRedirect("error.jsp");
        }
    %>
    </body>
    </html>
    

    四、其他

    1.更多系统

    Java+JSP系统系列实现

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

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

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

    Java+JSP实现教师信息管理系统

    Java+Servlet系统系列实现

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

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

    Java+Servlet+JSP学生宿舍管理系统

    Java+Servlet+JSP实现图书管理系统

    Java+Servlet+JSP实现停车场管理系统

    Java+Servlet+JSP实现房屋租赁管理系统

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

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

    Java+Servlet+JSPl实现学生选课签到系统

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

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

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

    Java+SSM系统系列实现

    J​​​ava+SSM+JSP实现网上考试系统

    Java+SSM+JSP实现宠物商城系统

    Java+SSM+JSP实现超市管理系统

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

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

    Java+SSM+JSP实现药品信息管理系统

    Java+SSM+JSP+Maven实现网上书城系统

    Java+SSM+JSP+Maven实现学校教务管理系统

    Java+SSH系统系列实现

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

    Java+SSH+JSP实现医院在线挂号系统

    Java+Springboot系统系列实现

    Java+Springboot+H-ui+Maven实现营销管理系统

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

    Java+Springboot+Bootstrap+Maven实现景区旅游管理系统

    1.更多JavaWeb系统请关注专栏。

    https://blog.csdn.net/helongqiang/category_10020130.htmlhttps://blog.csdn.net/helongqiang/category_10020130.html

    2.更多JavaSwing系统请关注专栏。

    https://blog.csdn.net/helongqiang/category_6229101.htmlhttps://blog.csdn.net/helongqiang/category_6229101.html

    2.源码下载

    sql在sql文件夹下面

    Java+JSP+Mysql实现Web学生宿舍管理系统

    3.运行项目

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

    4.备注

    如有侵权请联系我删除。

    5.支持博主

    如果您觉得此文对您有帮助,请点赞加关注加收藏。祝您生活愉快!

    展开全文
  • 目录 一、系统介绍 1.开发环境 2.技术选型 ...10.系统管理员-宿舍管理员管理 11.系统管理员-学生管理 12.系统管理员-宿舍楼管理 13.系统管理员-缺勤记录 14.系统管理员-修改密码 三、部分代码

    目录

    一、系统介绍

    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.数据库

    /*
     Navicat Premium Data Transfer
    
     Source Server         : Mysql
     Source Server Type    : MySQL
     Source Server Version : 80013
     Source Host           : localhost:3306
     Source Schema         : jsp_servlet_drom
    
     Target Server Type    : MySQL
     Target Server Version : 80013
     File Encoding         : 65001
    
     Date: 22/07/2021 20:46:38
    */
    
    SET NAMES utf8mb4;
    SET FOREIGN_KEY_CHECKS = 0;
    
    -- ----------------------------
    -- Table structure for t_admin
    -- ----------------------------
    DROP TABLE IF EXISTS `t_admin`;
    CREATE TABLE `t_admin`  (
      `adminId` int(11) NOT NULL AUTO_INCREMENT,
      `userName` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      `password` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      `name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      `sex` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      `tel` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      PRIMARY KEY (`adminId`) USING BTREE
    ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
    
    -- ----------------------------
    -- Records of t_admin
    -- ----------------------------
    INSERT INTO `t_admin` VALUES (1, 'admin', 'admin', '管理员', '男', '1828888888');
    
    -- ----------------------------
    -- Table structure for t_dorm
    -- ----------------------------
    DROP TABLE IF EXISTS `t_dorm`;
    CREATE TABLE `t_dorm`  (
      `dormId` int(11) NOT NULL AUTO_INCREMENT,
      `dormBuildId` int(11) NULL DEFAULT NULL,
      `dormName` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      `dormType` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      `dormNumber` int(11) NULL DEFAULT NULL,
      `dormTel` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      PRIMARY KEY (`dormId`) USING BTREE
    ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
    
    -- ----------------------------
    -- Records of t_dorm
    -- ----------------------------
    INSERT INTO `t_dorm` VALUES (1, 1, '220', '男', 4, '110');
    
    -- ----------------------------
    -- Table structure for t_dormbuild
    -- ----------------------------
    DROP TABLE IF EXISTS `t_dormbuild`;
    CREATE TABLE `t_dormbuild`  (
      `dormBuildId` int(11) NOT NULL AUTO_INCREMENT,
      `dormBuildName` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      `dormBuildDetail` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      PRIMARY KEY (`dormBuildId`) USING BTREE
    ) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
    
    -- ----------------------------
    -- Records of t_dormbuild
    -- ----------------------------
    INSERT INTO `t_dormbuild` VALUES (1, '1栋', '一栋信息介绍');
    INSERT INTO `t_dormbuild` VALUES (2, '2栋', '二栋信息介绍');
    INSERT INTO `t_dormbuild` VALUES (3, '3栋', '三栋信息介绍');
    INSERT INTO `t_dormbuild` VALUES (4, '4栋', '四栋信息介绍');
    INSERT INTO `t_dormbuild` VALUES (5, '5栋', '五栋信息介绍');
    
    -- ----------------------------
    -- Table structure for t_dormmanager
    -- ----------------------------
    DROP TABLE IF EXISTS `t_dormmanager`;
    CREATE TABLE `t_dormmanager`  (
      `dormManId` int(11) NOT NULL AUTO_INCREMENT,
      `userName` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      `password` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      `dormBuildId` int(11) NULL DEFAULT NULL,
      `name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      `sex` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      `tel` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      PRIMARY KEY (`dormManId`) USING BTREE
    ) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
    
    -- ----------------------------
    -- Records of t_dormmanager
    -- ----------------------------
    INSERT INTO `t_dormmanager` VALUES (1, 'dromadmin', '123456', 4, '宿舍管理员', '男', '18212346589');
    
    -- ----------------------------
    -- Table structure for t_record
    -- ----------------------------
    DROP TABLE IF EXISTS `t_record`;
    CREATE TABLE `t_record`  (
      `recordId` int(11) NOT NULL AUTO_INCREMENT,
      `studentNumber` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      `studentName` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      `dormBuildId` int(11) NULL DEFAULT NULL,
      `dormName` varchar(11) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      `date` date NULL DEFAULT NULL,
      `detail` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      PRIMARY KEY (`recordId`) USING BTREE
    ) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
    
    -- ----------------------------
    -- Records of t_record
    -- ----------------------------
    INSERT INTO `t_record` VALUES (1, '001', '李四', 4, '120', '2014-01-01', '回家');
    
    -- ----------------------------
    -- Table structure for t_student
    -- ----------------------------
    DROP TABLE IF EXISTS `t_student`;
    CREATE TABLE `t_student`  (
      `studentId` int(11) NOT NULL AUTO_INCREMENT,
      `stuNum` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      `password` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      `name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      `dormBuildId` int(11) NULL DEFAULT NULL,
      `dormName` varchar(11) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      `sex` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      `tel` varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
      PRIMARY KEY (`studentId`) USING BTREE
    ) ENGINE = InnoDB AUTO_INCREMENT = 32 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
    
    -- ----------------------------
    -- Records of t_student
    -- ----------------------------
    INSERT INTO `t_student` VALUES (1, '001', '123456', '李四', 4, '120', '男', '123456');
    INSERT INTO `t_student` VALUES (2, '002', '123456', '王五', 5, '201', '男', '123456');
    
    SET FOREIGN_KEY_CHECKS = 1;
    

    5.工程截图

     

    二、系统展示

    1.登录界面

     

    2.学生-主页面

     

    3.学生-缺勤记录

     

     

    4.学生-修改密码

     

    5.宿舍管理员-主页面

     

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

     

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

     

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

     

    9.系统管理员-主页面

     

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

     

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

     

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

     

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

     

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

    三、部分代码

    DormBuildDao

    package com.lero.dao;
    
    import com.lero.model.DormBuild;
    import com.lero.model.DormManager;
    import com.lero.model.PageBean;
    import com.lero.util.StringUtil;
    
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.util.ArrayList;
    import java.util.List;
    
    public class DormBuildDao {
    
        public static String dormBuildName(Connection con, int dormBuildId) throws Exception {
            String sql = "select * from t_dormBuild where dormBuildId=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setInt(1, dormBuildId);
            ResultSet rs = pstmt.executeQuery();
            if (rs.next()) {
                return rs.getString("dormBuildName");
            }
            return null;
        }
    
        public List<DormBuild> dormBuildList(Connection con, PageBean pageBean, DormBuild s_dormBuild) throws Exception {
            List<DormBuild> dormBuildList = new ArrayList<DormBuild>();
            StringBuffer sb = new StringBuffer("select * from t_dormBuild t1");
            if (StringUtil.isNotEmpty(s_dormBuild.getDormBuildName())) {
                sb.append(" where t1.dormBuildName like '%" + s_dormBuild.getDormBuildName() + "%'");
            }
            if (pageBean != null) {
                sb.append(" limit " + pageBean.getStart() + "," + pageBean.getPageSize());
            }
            PreparedStatement pstmt = con.prepareStatement(sb.toString());
            ResultSet rs = pstmt.executeQuery();
            while (rs.next()) {
                DormBuild dormBuild = new DormBuild();
                dormBuild.setDormBuildId(rs.getInt("dormBuildId"));
                dormBuild.setDormBuildName(rs.getString("dormBuildName"));
                dormBuild.setDetail(rs.getString("dormBuildDetail"));
                dormBuildList.add(dormBuild);
            }
            return dormBuildList;
        }
    
        public int dormBuildCount(Connection con, DormBuild s_dormBuild) throws Exception {
            StringBuffer sb = new StringBuffer("select count(*) as total from t_dormBuild t1");
            if (StringUtil.isNotEmpty(s_dormBuild.getDormBuildName())) {
                sb.append(" where t1.dormBuildName like '%" + s_dormBuild.getDormBuildName() + "%'");
            }
            PreparedStatement pstmt = con.prepareStatement(sb.toString());
            ResultSet rs = pstmt.executeQuery();
            if (rs.next()) {
                return rs.getInt("total");
            } else {
                return 0;
            }
        }
    
        public DormBuild dormBuildShow(Connection con, String dormBuildId) throws Exception {
            String sql = "select * from t_dormBuild t1 where t1.dormBuildId=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, dormBuildId);
            ResultSet rs = pstmt.executeQuery();
            DormBuild dormBuild = new DormBuild();
            if (rs.next()) {
                dormBuild.setDormBuildId(rs.getInt("dormBuildId"));
                dormBuild.setDormBuildName(rs.getString("dormBuildName"));
                dormBuild.setDetail(rs.getString("dormBuildDetail"));
            }
            return dormBuild;
        }
    
        public int dormBuildAdd(Connection con, DormBuild dormBuild) throws Exception {
            String sql = "insert into t_dormBuild values(null,?,?)";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, dormBuild.getDormBuildName());
            pstmt.setString(2, dormBuild.getDetail());
            return pstmt.executeUpdate();
        }
    
        public int dormBuildDelete(Connection con, String dormBuildId) throws Exception {
            String sql = "delete from t_dormBuild where dormBuildId=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, dormBuildId);
            return pstmt.executeUpdate();
        }
    
        public int dormBuildUpdate(Connection con, DormBuild dormBuild) throws Exception {
            String sql = "update t_dormBuild set dormBuildName=?,dormBuildDetail=? where dormBuildId=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, dormBuild.getDormBuildName());
            pstmt.setString(2, dormBuild.getDetail());
            pstmt.setInt(3, dormBuild.getDormBuildId());
            return pstmt.executeUpdate();
        }
    
        public boolean existManOrDormWithId(Connection con, String dormBuildId) throws Exception {
            boolean isExist = false;
    //		String sql="select * from t_dormBuild,t_dormManager,t_connection where dormManId=managerId and dormBuildId=buildId and dormBuildId=?";
            String sql = "select *from t_dormManager where dormBuildId=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, dormBuildId);
            ResultSet rs = pstmt.executeQuery();
            if (rs.next()) {
                isExist = true;
            } else {
                isExist = false;
            }
            String sql1 = "select * from t_dormBuild t1,t_dorm t2 where t1.dormBuildId=t2.dormBuildId and t1.dormBuildId=?";
            PreparedStatement p = con.prepareStatement(sql1);
            p.setString(1, dormBuildId);
            ResultSet r = pstmt.executeQuery();
            if (r.next()) {
                return isExist;
            } else {
                return false;
            }
        }
    
        public List<DormManager> dormManWithoutBuild(Connection con) throws Exception {
            List<DormManager> dormManagerList = new ArrayList<DormManager>();
            String sql = "SELECT * FROM t_dormManager WHERE dormBuildId IS NULL OR dormBuildId=0";
            PreparedStatement pstmt = con.prepareStatement(sql);
            ResultSet rs = pstmt.executeQuery();
            while (rs.next()) {
                DormManager dormManager = new DormManager();
                dormManager.setDormBuildId(rs.getInt("dormBuildId"));
                dormManager.setDormManagerId(rs.getInt("dormManId"));
                dormManager.setName(rs.getString("name"));
                dormManager.setUserName(rs.getString("userName"));
                dormManager.setSex(rs.getString("sex"));
                dormManager.setTel(rs.getString("tel"));
                dormManagerList.add(dormManager);
            }
            return dormManagerList;
        }
    
        public List<DormManager> dormManWithBuildId(Connection con, String dormBuildId) throws Exception {
            List<DormManager> dormManagerList = new ArrayList<DormManager>();
            String sql = "select *from t_dormManager where dormBuildId=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, dormBuildId);
            ResultSet rs = pstmt.executeQuery();
            while (rs.next()) {
                DormManager dormManager = new DormManager();
                dormManager.setDormBuildId(rs.getInt("dormBuildId"));
                dormManager.setDormManagerId(rs.getInt("dormManId"));
                dormManager.setName(rs.getString("name"));
                dormManager.setUserName(rs.getString("userName"));
                dormManager.setSex(rs.getString("sex"));
                dormManager.setTel(rs.getString("tel"));
                dormManagerList.add(dormManager);
            }
            return dormManagerList;
        }
    
        public int managerUpdateWithId(Connection con, String dormManagerId, String dormBuildId) throws Exception {
            String sql = "update t_dormManager set dormBuildId=? where dormManId=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, dormBuildId);
            pstmt.setString(2, dormManagerId);
            return pstmt.executeUpdate();
        }
    }
    

    DormManagerDao

    package com.lero.dao;
    
    import com.lero.model.DormManager;
    import com.lero.model.PageBean;
    import com.lero.util.StringUtil;
    
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.util.ArrayList;
    import java.util.List;
    
    public class DormManagerDao {
    
        public List<DormManager> dormManagerList(Connection con, PageBean pageBean, DormManager s_dormManager) throws Exception {
            List<DormManager> dormManagerList = new ArrayList<DormManager>();
            StringBuffer sb = new StringBuffer("SELECT * FROM t_dormManager t1 ORDER BY t1.userName");
            if (StringUtil.isNotEmpty(s_dormManager.getName())) {
                sb.append(" where t1.name like '%" + s_dormManager.getName() + "%'");
            } else if (StringUtil.isNotEmpty(s_dormManager.getUserName())) {
                sb.append(" where t1.userName like '%" + s_dormManager.getUserName() + "%'");
            }
            if (pageBean != null) {
                sb.append(" limit " + pageBean.getStart() + "," + pageBean.getPageSize());
            }
            PreparedStatement pstmt = con.prepareStatement(sb.toString());
            ResultSet rs = pstmt.executeQuery();
            while (rs.next()) {
                DormManager dormManager = new DormManager();
                dormManager.setDormManagerId(rs.getInt("dormManId"));
                int dormBuildId = rs.getInt("dormBuildId");
                dormManager.setDormBuildId(dormBuildId);
                dormManager.setDormBuildName(DormBuildDao.dormBuildName(con, dormBuildId));
                dormManager.setName(rs.getString("name"));
                dormManager.setSex(rs.getString("sex"));
                dormManager.setUserName(rs.getString("userName"));
                dormManager.setTel(rs.getString("tel"));
                dormManager.setPassword(rs.getString("password"));
                dormManagerList.add(dormManager);
            }
            return dormManagerList;
        }
    
        public int dormManagerCount(Connection con, DormManager s_dormManager) throws Exception {
            StringBuffer sb = new StringBuffer("select count(*) as total from t_dormManager t1");
            if (StringUtil.isNotEmpty(s_dormManager.getName())) {
                sb.append(" where t1.name like '%" + s_dormManager.getName() + "%'");
            } else if (StringUtil.isNotEmpty(s_dormManager.getUserName())) {
                sb.append(" where t1.userName like '%" + s_dormManager.getUserName() + "%'");
            }
            PreparedStatement pstmt = con.prepareStatement(sb.toString());
            ResultSet rs = pstmt.executeQuery();
            if (rs.next()) {
                return rs.getInt("total");
            } else {
                return 0;
            }
        }
    
        public DormManager dormManagerShow(Connection con, String dormManagerId) throws Exception {
            String sql = "select * from t_dormManager t1 where t1.dormManId=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, dormManagerId);
            ResultSet rs = pstmt.executeQuery();
            DormManager dormManager = new DormManager();
            if (rs.next()) {
                dormManager.setDormManagerId(rs.getInt("dormManId"));
                dormManager.setDormBuildId(rs.getInt("dormBuildId"));
                dormManager.setName(rs.getString("name"));
                dormManager.setSex(rs.getString("sex"));
                dormManager.setUserName(rs.getString("userName"));
                dormManager.setTel(rs.getString("tel"));
                dormManager.setPassword(rs.getString("password"));
            }
            return dormManager;
        }
    
        public int dormManagerAdd(Connection con, DormManager dormManager) throws Exception {
            String sql = "insert into t_dormManager values(null,?,?,null,?,?,?)";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, dormManager.getUserName());
            pstmt.setString(2, dormManager.getPassword());
            pstmt.setString(3, dormManager.getName());
            pstmt.setString(4, dormManager.getSex());
            pstmt.setString(5, dormManager.getTel());
            return pstmt.executeUpdate();
        }
    
        public int dormManagerDelete(Connection con, String dormManagerId) throws Exception {
            String sql = "delete from t_dormManager where dormManId=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, dormManagerId);
            return pstmt.executeUpdate();
        }
    
        public int dormManagerUpdate(Connection con, DormManager dormManager) throws Exception {
            String sql = "update t_dormManager set userName=?,password=?,name=?,sex=?,tel=? where dormManId=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, dormManager.getUserName());
            pstmt.setString(2, dormManager.getPassword());
            pstmt.setString(3, dormManager.getName());
            pstmt.setString(4, dormManager.getSex());
            pstmt.setString(5, dormManager.getTel());
            pstmt.setInt(6, dormManager.getDormManagerId());
            return pstmt.executeUpdate();
        }
    
        public boolean haveManagerByUser(Connection con, String userName) throws Exception {
            String sql = "select * from t_dormmanager t1 where t1.userName=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, userName);
            ResultSet rs = pstmt.executeQuery();
            if (rs.next()) {
                return true;
            }
            return false;
        }
    
    
    }
    

    RecordDao

    package com.lero.dao;
    
    import com.lero.model.DormBuild;
    import com.lero.model.Record;
    import com.lero.util.StringUtil;
    
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.util.ArrayList;
    import java.util.List;
    
    public class RecordDao {
        public List<Record> recordList(Connection con, Record s_record) throws Exception {
            List<Record> recordList = new ArrayList<Record>();
            StringBuffer sb = new StringBuffer("select * from t_record t1");
            if (StringUtil.isNotEmpty(s_record.getStudentNumber())) {
                sb.append(" and t1.studentNumber like '%" + s_record.getStudentNumber() + "%'");
            } else if (StringUtil.isNotEmpty(s_record.getStudentName())) {
                sb.append(" and t1.studentName like '%" + s_record.getStudentName() + "%'");
            }
            if (s_record.getDormBuildId() != 0) {
                sb.append(" and t1.dormBuildId=" + s_record.getDormBuildId());
            }
            if (StringUtil.isNotEmpty(s_record.getDate())) {
                sb.append(" and t1.date=" + s_record.getDate());
            }
            if (StringUtil.isNotEmpty(s_record.getStartDate())) {
                sb.append(" and TO_DAYS(t1.date)>=TO_DAYS('" + s_record.getStartDate() + "')");
            }
            if (StringUtil.isNotEmpty(s_record.getEndDate())) {
                sb.append(" and TO_DAYS(t1.date)<=TO_DAYS('" + s_record.getEndDate() + "')");
            }
            PreparedStatement pstmt = con.prepareStatement(sb.toString().replaceFirst("and", "where"));
            ResultSet rs = pstmt.executeQuery();
            while (rs.next()) {
                Record record = new Record();
                record.setRecordId(rs.getInt("recordId"));
                record.setStudentNumber(rs.getString("studentNumber"));
                record.setStudentName(rs.getString("studentName"));
                int dormBuildId = rs.getInt("dormBuildId");
                record.setDormBuildId(dormBuildId);
                record.setDormBuildName(DormBuildDao.dormBuildName(con, dormBuildId));
                record.setDormName(rs.getString("dormName"));
                record.setDate(rs.getString("date"));
                record.setDetail(rs.getString("detail"));
                recordList.add(record);
            }
            return recordList;
        }
    
        public List<Record> recordListWithBuild(Connection con, Record s_record, int buildId) throws Exception {
            List<Record> recordList = new ArrayList<Record>();
            StringBuffer sb = new StringBuffer("select * from t_record t1");
            if (StringUtil.isNotEmpty(s_record.getStudentNumber())) {
                sb.append(" and t1.studentNumber like '%" + s_record.getStudentNumber() + "%'");
            } else if (StringUtil.isNotEmpty(s_record.getStudentName())) {
                sb.append(" and t1.studentName like '%" + s_record.getStudentName() + "%'");
            }
            sb.append(" and t1.dormBuildId=" + buildId);
            if (StringUtil.isNotEmpty(s_record.getStartDate())) {
                sb.append(" and TO_DAYS(t1.date)>=TO_DAYS('" + s_record.getStartDate() + "')");
            }
            if (StringUtil.isNotEmpty(s_record.getEndDate())) {
                sb.append(" and TO_DAYS(t1.date)<=TO_DAYS('" + s_record.getEndDate() + "')");
            }
            PreparedStatement pstmt = con.prepareStatement(sb.toString().replaceFirst("and", "where"));
            ResultSet rs = pstmt.executeQuery();
            while (rs.next()) {
                Record record = new Record();
                record.setRecordId(rs.getInt("recordId"));
                record.setStudentNumber(rs.getString("studentNumber"));
                record.setStudentName(rs.getString("studentName"));
                int dormBuildId = rs.getInt("dormBuildId");
                record.setDormBuildId(dormBuildId);
                record.setDormBuildName(DormBuildDao.dormBuildName(con, dormBuildId));
                record.setDormName(rs.getString("dormName"));
                record.setDate(rs.getString("date"));
                record.setDetail(rs.getString("detail"));
                recordList.add(record);
            }
            return recordList;
        }
    
        public List<Record> recordListWithNumber(Connection con, Record s_record, String studentNumber) throws Exception {
            List<Record> recordList = new ArrayList<Record>();
            StringBuffer sb = new StringBuffer("select * from t_record t1");
            if (StringUtil.isNotEmpty(studentNumber)) {
                sb.append(" and t1.studentNumber =" + studentNumber);
            }
            if (StringUtil.isNotEmpty(s_record.getStartDate())) {
                sb.append(" and TO_DAYS(t1.date)>=TO_DAYS('" + s_record.getStartDate() + "')");
            }
            if (StringUtil.isNotEmpty(s_record.getEndDate())) {
                sb.append(" and TO_DAYS(t1.date)<=TO_DAYS('" + s_record.getEndDate() + "')");
            }
            PreparedStatement pstmt = con.prepareStatement(sb.toString().replaceFirst("and", "where"));
            ResultSet rs = pstmt.executeQuery();
            while (rs.next()) {
                Record record = new Record();
                record.setRecordId(rs.getInt("recordId"));
                record.setStudentNumber(rs.getString("studentNumber"));
                record.setStudentName(rs.getString("studentName"));
                int dormBuildId = rs.getInt("dormBuildId");
                record.setDormBuildId(dormBuildId);
                record.setDormBuildName(DormBuildDao.dormBuildName(con, dormBuildId));
                record.setDormName(rs.getString("dormName"));
                record.setDate(rs.getString("date"));
                record.setDetail(rs.getString("detail"));
                recordList.add(record);
            }
            return recordList;
        }
    
        public List<DormBuild> dormBuildList(Connection con) throws Exception {
            List<DormBuild> dormBuildList = new ArrayList<DormBuild>();
            String sql = "select * from t_dormBuild";
            PreparedStatement pstmt = con.prepareStatement(sql);
            ResultSet rs = pstmt.executeQuery();
            while (rs.next()) {
                DormBuild dormBuild = new DormBuild();
                dormBuild.setDormBuildId(rs.getInt("dormBuildId"));
                dormBuild.setDormBuildName(rs.getString("dormBuildName"));
                dormBuild.setDetail(rs.getString("dormBuildDetail"));
                dormBuildList.add(dormBuild);
            }
            return dormBuildList;
        }
    //	
    //	public int studentCount(Connection con, Student s_student)throws Exception {
    //		StringBuffer sb = new StringBuffer("select count(*) as total from t_student t1");
    //		if(StringUtil.isNotEmpty(s_student.getName())) {
    //			sb.append(" and t1.name like '%"+s_student.getName()+"%'");
    //		} else if(StringUtil.isNotEmpty(s_student.getStuNumber())) {
    //			sb.append(" and t1.stuNum like '%"+s_student.getStuNumber()+"%'");
    //		} else if(StringUtil.isNotEmpty(s_student.getDormName())) {
    //			sb.append(" and t1.dormName like '%"+s_student.getDormName()+"%'");
    //		}
    //		if(s_student.getDormBuildId()!=0) {
    //			sb.append(" and t1.dormBuildId="+s_student.getDormBuildId());
    //		}
    //		PreparedStatement pstmt = con.prepareStatement(sb.toString().replaceFirst("and", "where"));
    //		ResultSet rs = pstmt.executeQuery();
    //		if(rs.next()) {
    //			return rs.getInt("total");
    //		} else {
    //			return 0;
    //		}
    //	}
    
        public Record recordShow(Connection con, String recordId) throws Exception {
            String sql = "select * from t_record t1 where t1.recordId=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, recordId);
            ResultSet rs = pstmt.executeQuery();
            Record record = new Record();
            if (rs.next()) {
                record.setRecordId(rs.getInt("recordId"));
                record.setStudentNumber(rs.getString("studentNumber"));
                record.setStudentName(rs.getString("studentName"));
                int dormBuildId = rs.getInt("dormBuildId");
                record.setDormBuildId(dormBuildId);
                record.setDormBuildName(DormBuildDao.dormBuildName(con, dormBuildId));
                record.setDormName(rs.getString("dormName"));
                record.setDate(rs.getString("date"));
                record.setDetail(rs.getString("detail"));
            }
            return record;
        }
    
        public int recordAdd(Connection con, Record record) throws Exception {
            String sql = "insert into t_record values(null,?,?,?,?,?,?)";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, record.getStudentNumber());
            pstmt.setString(2, record.getStudentName());
            pstmt.setInt(3, record.getDormBuildId());
            pstmt.setString(4, record.getDormName());
            pstmt.setString(5, record.getDate());
            pstmt.setString(6, record.getDetail());
            return pstmt.executeUpdate();
        }
    
        public int recordDelete(Connection con, String recordId) throws Exception {
            String sql = "delete from t_record where recordId=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, recordId);
            return pstmt.executeUpdate();
        }
    
        public int recordUpdate(Connection con, Record record) throws Exception {
            String sql = "update t_record set studentNumber=?,studentName=?,dormBuildId=?,dormName=?,detail=? where recordId=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, record.getStudentNumber());
            pstmt.setString(2, record.getStudentName());
            pstmt.setInt(3, record.getDormBuildId());
            pstmt.setString(4, record.getDormName());
            pstmt.setString(5, record.getDetail());
            pstmt.setInt(6, record.getRecordId());
            return pstmt.executeUpdate();
        }
    
    
    }
    

    StudentDao

    package com.lero.dao;
    
    import com.lero.model.DormBuild;
    import com.lero.model.Student;
    import com.lero.util.StringUtil;
    
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.util.ArrayList;
    import java.util.List;
    
    public class StudentDao {
    
    //	public List<Student> studentList(Connection con, PageBean pageBean, Student s_student)throws Exception {
    //		List<Student> studentList = new ArrayList<Student>();
    //		StringBuffer sb = new StringBuffer("select * from t_student t1");
    //		if(StringUtil.isNotEmpty(s_student.getName())) {
    //			sb.append(" and t1.name like '%"+s_student.getName()+"%'");
    //		} else if(StringUtil.isNotEmpty(s_student.getStuNumber())) {
    //			sb.append(" and t1.stuNum like '%"+s_student.getStuNumber()+"%'");
    //		} else if(StringUtil.isNotEmpty(s_student.getDormName())) {
    //			sb.append(" and t1.dormName like '%"+s_student.getDormName()+"%'");
    //		}
    //		if(s_student.getDormBuildId()!=0) {
    //			sb.append(" and t1.dormBuildId="+s_student.getDormBuildId());
    //		}
    //		if(pageBean != null) {
    //			sb.append(" limit "+pageBean.getStart()+","+pageBean.getPageSize());
    //		}
    //		PreparedStatement pstmt = con.prepareStatement(sb.toString().replaceFirst("and", "where"));
    //		ResultSet rs = pstmt.executeQuery();
    //		while(rs.next()) {
    //			Student student=new Student();
    //			student.setStudentId(rs.getInt("studentId"));
    //			int dormBuildId = rs.getInt("dormBuildId");
    //			student.setDormBuildId(dormBuildId);
    //			student.setDormBuildName(DormBuildDao.dormBuildName(con, dormBuildId));
    //			student.setDormName(rs.getString("dormName"));
    //			student.setName(rs.getString("name"));
    //			student.setSex(rs.getString("sex"));
    //			student.setStuNumber(rs.getString("stuNum"));
    //			student.setTel(rs.getString("tel"));
    //			student.setPassword(rs.getString("password"));
    //			studentList.add(student);
    //		}
    //		return studentList;
    //	}
    
        public static Student getNameById(Connection con, String studentNumber, int dormBuildId) throws Exception {
            String sql = "select * from t_student t1 where t1.stuNum=? and t1.dormBuildId=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, studentNumber);
            pstmt.setInt(2, dormBuildId);
            ResultSet rs = pstmt.executeQuery();
            Student student = new Student();
            if (rs.next()) {
                student.setName(rs.getString("name"));
                student.setDormBuildId(rs.getInt("dormBuildId"));
                student.setDormName(rs.getString("dormName"));
            }
            return student;
        }
    
        public List<Student> studentList(Connection con, Student s_student) throws Exception {
            List<Student> studentList = new ArrayList<Student>();
            StringBuffer sb = new StringBuffer("select * from t_student t1");
            if (StringUtil.isNotEmpty(s_student.getName())) {
                sb.append(" and t1.name like '%" + s_student.getName() + "%'");
            } else if (StringUtil.isNotEmpty(s_student.getStuNumber())) {
                sb.append(" and t1.stuNum like '%" + s_student.getStuNumber() + "%'");
            } else if (StringUtil.isNotEmpty(s_student.getDormName())) {
                sb.append(" and t1.dormName like '%" + s_student.getDormName() + "%'");
            }
            if (s_student.getDormBuildId() != 0) {
                sb.append(" and t1.dormBuildId=" + s_student.getDormBuildId());
            }
            PreparedStatement pstmt = con.prepareStatement(sb.toString().replaceFirst("and", "where"));
            ResultSet rs = pstmt.executeQuery();
            while (rs.next()) {
                Student student = new Student();
                student.setStudentId(rs.getInt("studentId"));
                int dormBuildId = rs.getInt("dormBuildId");
                student.setDormBuildId(dormBuildId);
                student.setDormBuildName(DormBuildDao.dormBuildName(con, dormBuildId));
                student.setDormName(rs.getString("dormName"));
                student.setName(rs.getString("name"));
                student.setSex(rs.getString("sex"));
                student.setStuNumber(rs.getString("stuNum"));
                student.setTel(rs.getString("tel"));
                student.setPassword(rs.getString("password"));
                studentList.add(student);
            }
            return studentList;
        }
    
        public boolean haveNameByNumber(Connection con, String studentNumber) throws Exception {
            String sql = "select * from t_student t1 where t1.stuNum=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, studentNumber);
            ResultSet rs = pstmt.executeQuery();
            Student student = new Student();
            if (rs.next()) {
                student.setName(rs.getString("name"));
                student.setDormBuildId(rs.getInt("dormBuildId"));
                student.setDormName(rs.getString("dormName"));
                return true;
            }
            return false;
        }
    
        public List<Student> studentListWithBuild(Connection con, Student s_student, int buildId) throws Exception {
            List<Student> studentList = new ArrayList<Student>();
            StringBuffer sb = new StringBuffer("select * from t_student t1");
            if (StringUtil.isNotEmpty(s_student.getName())) {
                sb.append(" and t1.name like '%" + s_student.getName() + "%'");
            } else if (StringUtil.isNotEmpty(s_student.getStuNumber())) {
                sb.append(" and t1.stuNum like '%" + s_student.getStuNumber() + "%'");
            } else if (StringUtil.isNotEmpty(s_student.getDormName())) {
                sb.append(" and t1.dormName like '%" + s_student.getDormName() + "%'");
            }
            sb.append(" and t1.dormBuildId=" + buildId);
            PreparedStatement pstmt = con.prepareStatement(sb.toString().replaceFirst("and", "where"));
            ResultSet rs = pstmt.executeQuery();
            while (rs.next()) {
                Student student = new Student();
                student.setStudentId(rs.getInt("studentId"));
                int dormBuildId = rs.getInt("dormBuildId");
                student.setDormBuildId(dormBuildId);
                student.setDormBuildName(DormBuildDao.dormBuildName(con, dormBuildId));
                student.setDormName(rs.getString("dormName"));
                student.setName(rs.getString("name"));
                student.setSex(rs.getString("sex"));
                student.setStuNumber(rs.getString("stuNum"));
                student.setTel(rs.getString("tel"));
                student.setPassword(rs.getString("password"));
                studentList.add(student);
            }
            return studentList;
        }
    
        public List<DormBuild> dormBuildList(Connection con) throws Exception {
            List<DormBuild> dormBuildList = new ArrayList<DormBuild>();
            String sql = "select * from t_dormBuild";
            PreparedStatement pstmt = con.prepareStatement(sql);
            ResultSet rs = pstmt.executeQuery();
            while (rs.next()) {
                DormBuild dormBuild = new DormBuild();
                dormBuild.setDormBuildId(rs.getInt("dormBuildId"));
                dormBuild.setDormBuildName(rs.getString("dormBuildName"));
                dormBuild.setDetail(rs.getString("dormBuildDetail"));
                dormBuildList.add(dormBuild);
            }
            return dormBuildList;
        }
    
        public int studentCount(Connection con, Student s_student) throws Exception {
            StringBuffer sb = new StringBuffer("select count(*) as total from t_student t1");
            if (StringUtil.isNotEmpty(s_student.getName())) {
                sb.append(" and t1.name like '%" + s_student.getName() + "%'");
            } else if (StringUtil.isNotEmpty(s_student.getStuNumber())) {
                sb.append(" and t1.stuNum like '%" + s_student.getStuNumber() + "%'");
            } else if (StringUtil.isNotEmpty(s_student.getDormName())) {
                sb.append(" and t1.dormName like '%" + s_student.getDormName() + "%'");
            }
            if (s_student.getDormBuildId() != 0) {
                sb.append(" and t1.dormBuildId=" + s_student.getDormBuildId());
            }
            PreparedStatement pstmt = con.prepareStatement(sb.toString().replaceFirst("and", "where"));
            ResultSet rs = pstmt.executeQuery();
            if (rs.next()) {
                return rs.getInt("total");
            } else {
                return 0;
            }
        }
    
        public Student studentShow(Connection con, String studentId) throws Exception {
            String sql = "select * from t_student t1 where t1.studentId=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, studentId);
            ResultSet rs = pstmt.executeQuery();
            Student student = new Student();
            if (rs.next()) {
                student.setStudentId(rs.getInt("studentId"));
                int dormBuildId = rs.getInt("dormBuildId");
                student.setDormBuildId(dormBuildId);
                student.setDormBuildName(DormBuildDao.dormBuildName(con, dormBuildId));
                student.setDormName(rs.getString("dormName"));
                student.setName(rs.getString("name"));
                student.setSex(rs.getString("sex"));
                student.setStuNumber(rs.getString("stuNum"));
                student.setTel(rs.getString("tel"));
                student.setPassword(rs.getString("password"));
            }
            return student;
        }
    
        public int studentAdd(Connection con, Student student) throws Exception {
            String sql = "insert into t_student values(null,?,?,?,?,?,?,?)";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, student.getStuNumber());
            pstmt.setString(2, student.getPassword());
            pstmt.setString(3, student.getName());
            pstmt.setInt(4, student.getDormBuildId());
            pstmt.setString(5, student.getDormName());
            pstmt.setString(6, student.getSex());
            pstmt.setString(7, student.getTel());
            return pstmt.executeUpdate();
        }
    
        public int studentDelete(Connection con, String studentId) throws Exception {
            String sql = "delete from t_student where studentId=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, studentId);
            return pstmt.executeUpdate();
        }
    
        public int studentUpdate(Connection con, Student student) throws Exception {
            String sql = "update t_student set stuNum=?,password=?,name=?,dormBuildId=?,dormName=?,sex=?,tel=? where studentId=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, student.getStuNumber());
            pstmt.setString(2, student.getPassword());
            pstmt.setString(3, student.getName());
            pstmt.setInt(4, student.getDormBuildId());
            pstmt.setString(5, student.getDormName());
            pstmt.setString(6, student.getSex());
            pstmt.setString(7, student.getTel());
            pstmt.setInt(8, student.getStudentId());
            return pstmt.executeUpdate();
        }
    
    
    }
    

    UserDao

    package com.lero.dao;
    
    import com.lero.model.Admin;
    import com.lero.model.DormManager;
    import com.lero.model.Student;
    
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    
    public class UserDao {
    
        public Admin Login(Connection con, Admin admin) throws Exception {
            Admin resultAdmin = null;
            String sql = "select * from t_admin where userName=? and password=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, admin.getUserName());
            pstmt.setString(2, admin.getPassword());
            ResultSet rs = pstmt.executeQuery();
            if (rs.next()) {
                resultAdmin = new Admin();
                resultAdmin.setAdminId(rs.getInt("adminId"));
                resultAdmin.setUserName(rs.getString("userName"));
                resultAdmin.setPassword(rs.getString("password"));
                resultAdmin.setName(rs.getString("name"));
                resultAdmin.setSex(rs.getString("sex"));
                resultAdmin.setTel(rs.getString("tel"));
            }
            return resultAdmin;
        }
    
        public DormManager Login(Connection con, DormManager dormManager) throws Exception {
            DormManager resultDormManager = null;
            String sql = "select * from t_dormmanager where userName=? and password=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, dormManager.getUserName());
            pstmt.setString(2, dormManager.getPassword());
            ResultSet rs = pstmt.executeQuery();
            if (rs.next()) {
                resultDormManager = new DormManager();
                resultDormManager.setDormManagerId(rs.getInt("dormManId"));
                resultDormManager.setUserName(rs.getString("userName"));
                resultDormManager.setPassword(rs.getString("password"));
                resultDormManager.setDormBuildId(rs.getInt("dormBuildId"));
                resultDormManager.setName(rs.getString("name"));
                resultDormManager.setSex(rs.getString("sex"));
                resultDormManager.setTel(rs.getString("tel"));
            }
            return resultDormManager;
        }
    
        public Student Login(Connection con, Student student) throws Exception {
            Student resultStudent = null;
            String sql = "select * from t_student where stuNum=? and password=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, student.getStuNumber());
            pstmt.setString(2, student.getPassword());
            ResultSet rs = pstmt.executeQuery();
            if (rs.next()) {
                resultStudent = new Student();
                resultStudent.setStudentId(rs.getInt("studentId"));
                resultStudent.setStuNumber(rs.getString("stuNum"));
                resultStudent.setPassword(rs.getString("password"));
                int dormBuildId = rs.getInt("dormBuildId");
                resultStudent.setDormBuildId(dormBuildId);
                resultStudent.setDormBuildName(DormBuildDao.dormBuildName(con, dormBuildId));
                resultStudent.setDormName(rs.getString("dormName"));
                resultStudent.setName(rs.getString("name"));
                resultStudent.setSex(rs.getString("sex"));
                resultStudent.setTel(rs.getString("tel"));
            }
            return resultStudent;
        }
    
        public int adminUpdate(Connection con, int adminId, String password) throws Exception {
            String sql = "update t_admin set password=? where adminId=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, password);
            pstmt.setInt(2, adminId);
            return pstmt.executeUpdate();
        }
    
        public int managerUpdate(Connection con, int managerId, String password) throws Exception {
            String sql = "update t_dormmanager set password=? where dormManId=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, password);
            pstmt.setInt(2, managerId);
            return pstmt.executeUpdate();
        }
    
        public int studentUpdate(Connection con, int studentId, String password) throws Exception {
            String sql = "update t_student set password=? where studentId=?";
            PreparedStatement pstmt = con.prepareStatement(sql);
            pstmt.setString(1, password);
            pstmt.setInt(2, studentId);
            return pstmt.executeUpdate();
        }
    
    }
    

    PropertiesUtil

    package com.lero.util;
    
    import java.io.IOException;
    import java.io.InputStream;
    import java.util.Properties;
    
    public class PropertiesUtil {
    
        public static String getValue(String key) {
            Properties prop = new Properties();
            InputStream in = new PropertiesUtil().getClass().getResourceAsStream("/dorm.properties");
            try {
                prop.load(in);
            } catch (IOException e) {
                e.printStackTrace();
            }
            return (String) prop.get(key);
        }
    }
    

    login.jsp

    <%@ page language="java" contentType="text/html; charset=utf-8"
             pageEncoding="utf-8" %>
    <%@ page import="com.lero.model.Admin" %>
    <%@ page import="com.lero.model.DormManager" %>
    <%@ page import="com.lero.model.Student" %>
    <%
        if (request.getAttribute("user") == null) {
            String userName = null;
            String password = null;
            String userType = null;
            String remember = null;
    
            Cookie[] cookies = request.getCookies();
            for (int i = 0; cookies != null && i < cookies.length; i++) {
                if (cookies[i].getName().equals("dormuser")) {
                    userName = cookies[i].getValue().split("-")[0];
                    password = cookies[i].getValue().split("-")[1];
                    userType = cookies[i].getValue().split("-")[2];
                    remember = cookies[i].getValue().split("-")[3];
                }
            }
    
            if (userName == null) {
                userName = "";
            }
    
            if (password == null) {
                password = "";
            }
    
            if (userType == null) {
                userType = "";
            } else if ("admin".equals(userType)) {
                pageContext.setAttribute("user", new Admin(userName, password));
                pageContext.setAttribute("userType", 1);
            } else if ("dormManager".equals(userType)) {
                pageContext.setAttribute("user", new DormManager(userName, password));
                pageContext.setAttribute("userType", 2);
            } else if ("student".equals(userType)) {
                pageContext.setAttribute("user", new Student(userName, password));
                pageContext.setAttribute("userType", 3);
            }
    
            if ("yes".equals(remember)) {
                pageContext.setAttribute("remember", 1);
            }
    
        }
    %>
    <html lang="zh">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>宿舍管理系统登录</title>
        <link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
        <script src="${pageContext.request.contextPath}/bootstrap/js/jQuery.js"></script>
        <script src="${pageContext.request.contextPath}/bootstrap/js/bootstrap.js"></script>
        <script type="text/javascript">
            function checkForm() {
                var userName = document.getElementById("userName").value;
                var password = document.getElementById("password").value;
                var userTypes = document.getElementsByName("userType");
                var userType = null;
                for (var i = 0; i < userTypes.length; i++) {
                    if (userTypes[i].checked) {
                        userType = userTypes[i].value;
                        break;
                    }
                }
                if (userName == null || userName == "") {
                    document.getElementById("error").innerHTML = "用户名不能为空";
                    return false;
                }
                if (password == null || password == "") {
                    document.getElementById("error").innerHTML = "密码不能为空";
                    return false;
                }
                if (userType == null || userType == "") {
                    document.getElementById("error").innerHTML = "请选择用户类型";
                    return false;
                }
                return true;
            }
        </script>
    
        <style type="text/css">
            body {
                padding-top: 200px;
                padding-bottom: 40px;
                background-image: url('images/bg.jpg');
                background-position: center;
                background-repeat: no-repeat;
                background-attachment: fixed;
            }
    
            .radio {
                padding-top: 10px;
                padding-bottom: 10px;
            }
    
            .form-signin-heading {
                text-align: center;
            }
    
            .form-signin {
                max-width: 300px;
                padding: 19px 29px 0px;
                margin: 0 auto 20px;
                background-color: #fff;
                border: 1px solid #e5e5e5;
                -webkit-border-radius: 5px;
                -moz-border-radius: 5px;
                border-radius: 5px;
                -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
                -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
                box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
            }
    
            .form-signin .form-signin-heading,
            .form-signin .checkbox {
                margin-bottom: 10px;
            }
    
            .form-signin input[type="text"],
            .form-signin input[type="password"] {
                font-size: 16px;
                height: auto;
                margin-bottom: 15px;
                padding: 7px 9px;
            }
        </style>
    
    </head>
    <body>
    <div class="container">
        <form name="myForm" class="form-signin" action="login" method="post" onsubmit="return checkForm()">
            <h2 class="form-signin-heading"><font color="gray">宿舍管理系统</font></h2>
            <input id="userName" name="userName" value="${user.userName }" type="text" class="input-block-level"
                   placeholder="账号">
            <input id="password" name="password" value="${user.password }" type="password" class="input-block-level"
                   placeholder="密码">
            <label class="radio inline">
                <input id="admin" type="radio" name="userType" value="admin" checked/> 系统管理员
            </label>
            <label class="radio inline">
                <input id="dormManager" type="radio" name="userType" value="dormManager" ${userType==2?'checked':''} />
                宿舍管理员
            </label>
            <label class="radio inline">
                <input id="student" type="radio" name="userType" value="student"  ${userType==3?'checked':''}/> 学生
            </label>
            <label class="checkbox">
                <input id="remember" name="remember" type="checkbox" value="remember-me" ${remember==1?'checked':''}>记住我
                &nbsp;&nbsp;&nbsp;&nbsp; <font id="error" color="red">${error }</font>
            </label>
            <button class="btn btn-large btn-primary" type="submit">登录</button>
            &nbsp;&nbsp;&nbsp;&nbsp;
            <button class="btn btn-large btn-primary" type="button">重置</button>
    
            <p align="center" style="padding-top: 15px;">版权所有2021</p>
        </form>
    </div>
    </body>
    </html>

    mainAdmin.jsp

    <%@ page language="java" contentType="text/html; charset=utf-8"
             pageEncoding="utf-8" %>
    <html lang="zh">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>宿舍管理系统</title>
        <link href="${pageContext.request.contextPath}/style/dorm.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath}/bootstrap-datetimepicker-master/css/bootstrap-datetimepicker.min.css"
              rel="stylesheet" media="screen">
        <link rel="stylesheet" type="text/css"
              href="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/dataTables.bootstra.css">
        <script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/jquery.js"></script>
        <script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/jquery.dataTables.js"></script>
        <script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/bootstrap.min.js"></script>
        <script type="text/javascript"
                src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/dataTables.bootstrap.js"></script>
        <script type="text/javascript"
                src="${pageContext.request.contextPath}/bootstrap-datetimepicker-master/js/bootstrap-datetimepicker.js"
                charset="UTF-8"></script>
        <script type="text/javascript"
                src="${pageContext.request.contextPath}/bootstrap-datetimepicker-master/js/locales/bootstrap-datetimepicker.fr.js"
                charset="UTF-8"></script>
        <script src="${pageContext.request.contextPath}/bootstrap/js/bootstrap.js"></script>
    
        <script type="text/javascript">
            $(document).ready(function () {
                $("#DataTables_Table_0_wrapper .row-fluid").remove();
            });
        </script>
        <style type="text/css">
            .bs-docs-sidenav {
                background-color: #fff;
                border-radius: 6px;
                box-shadow: 0 1px 4px rgba(0, 0, 0, 0.067);
                padding: 0;
                width: 228px;
            }
    
            .bs-docs-sidenav > li > a {
                border: 1px solid #e5e5e5;
                display: block;
                padding: 8px 14px;
                margin: 0 0 -1px;
            }
    
            .bs-docs-sidenav > li:first-child > a {
                border-radius: 6px 6px 0 0;
            }
    
            .bs-docs-sidenav > li:last-child > a {
                border-radius: 0 0 6px 6px;
            }
    
            .bs-docs-sidenav > .active > a {
                border: 0 none;
                box-shadow: 1px 0 0 rgba(0, 0, 0, 0.1) inset, -1px 0 0 rgba(0, 0, 0, 0.1) inset;
                padding: 9px 15px;
                position: relative;
                text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
                z-index: 2;
            }
    
            .bs-docs-sidenav .icon-chevron-right {
                float: right;
                margin-right: -6px;
                margin-top: 2px;
                opacity: 0.25;
            }
    
            .bs-docs-sidenav > li > a:hover {
                background-color: #f5f5f5;
            }
    
            .bs-docs-sidenav a:hover .icon-chevron-right {
                opacity: 0.5;
            }
    
            .bs-docs-sidenav .active .icon-chevron-right, .bs-docs-sidenav .active a:hover .icon-chevron-right {
                background-image: url("../img/glyphicons-halflings-white.png");
                opacity: 1;
            }
        </style>
    
    </head>
    <body>
    <div class="container-fluid" style="padding-right: 0px;padding-left: 0px;">
        <div region="north" style="height: 100px;background-image: url('images/bg.jpg')">
            <div align="left" style="width: 80%;height:100px ;float: left;padding-top: 40px;padding-left: 30px;"><font
                    color="white" size="6">宿舍管理系统</font></div>
            <div style="padding-top: 70px;padding-right: 20px;">当前用户:&nbsp;<font color="red">${currentUser.userName }</font>
            </div>
        </div>
    </div>
    <div class="container-fluid">
        <div class="row-fluid">
            <div class="span2 bs-docs-sidebar">
                <ul class="nav nav-list bs-docs-sidenav">
                    <li><a href="blank"><i class="icon-chevron-right"></i>首页</a></li>
                    <li><a href="dormManager?action=list"><i class="icon-chevron-right"></i>宿舍管理员管理</a></li>
                    <li><a href="student?action=list"><i class="icon-chevron-right"></i>学生管理</a></li>
                    <li><a href="dormBuild?action=list"><i class="icon-chevron-right"></i>宿舍楼管理</a></li>
                    <li><a href="record?action=list"><i class="icon-chevron-right"></i>缺勤记录</a></li>
                    <li><a href="password?action=preChange"><i class="icon-chevron-right"></i>修改密码</a></li>
                    <li><a href="login.jsp"><i class="icon-chevron-right"></i>退出系统</a></li>
                </ul>
            </div>
            <div class="span10">
                <jsp:include page="${mainPage==null?'admin/blank.jsp':mainPage}"></jsp:include>
            </div>
        </div>
    </div>
    </body>
    </html>

    mainManager.jsp

    <%@ page language="java" contentType="text/html; charset=utf-8"
             pageEncoding="utf-8" %>
    <html lang="zh">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>宿舍管理系统</title>
        <link href="${pageContext.request.contextPath}/style/dorm.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath}/bootstrap-datetimepicker-master/css/bootstrap-datetimepicker.min.css"
              rel="stylesheet" media="screen">
        <link rel="stylesheet" type="text/css"
              href="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/dataTables.bootstra.css">
        <script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/jquery.js"></script>
        <script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/jquery.dataTables.js"></script>
        <script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/bootstrap.min.js"></script>
        <script type="text/javascript"
                src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/dataTables.bootstrap.js"></script>
        <script type="text/javascript"
                src="${pageContext.request.contextPath}/bootstrap-datetimepicker-master/js/bootstrap-datetimepicker.js"
                charset="UTF-8"></script>
        <script type="text/javascript"
                src="${pageContext.request.contextPath}/bootstrap-datetimepicker-master/js/locales/bootstrap-datetimepicker.fr.js"
                charset="UTF-8"></script>
        <script src="${pageContext.request.contextPath}/bootstrap/js/bootstrap.js"></script>
    
        <script type="text/javascript">
            $(document).ready(function () {
                $("#DataTables_Table_0_wrapper .row-fluid").remove();
            });
        </script>
        <style type="text/css">
            .bs-docs-sidenav {
                background-color: #fff;
                border-radius: 6px;
                box-shadow: 0 1px 4px rgba(0, 0, 0, 0.067);
                padding: 0;
                width: 228px;
            }
    
            .bs-docs-sidenav > li > a {
                border: 1px solid #e5e5e5;
                display: block;
                padding: 8px 14px;
                margin: 0 0 -1px;
            }
    
            .bs-docs-sidenav > li:first-child > a {
                border-radius: 6px 6px 0 0;
            }
    
            .bs-docs-sidenav > li:last-child > a {
                border-radius: 0 0 6px 6px;
            }
    
            .bs-docs-sidenav > .active > a {
                border: 0 none;
                box-shadow: 1px 0 0 rgba(0, 0, 0, 0.1) inset, -1px 0 0 rgba(0, 0, 0, 0.1) inset;
                padding: 9px 15px;
                position: relative;
                text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
                z-index: 2;
            }
    
            .bs-docs-sidenav .icon-chevron-right {
                float: right;
                margin-right: -6px;
                margin-top: 2px;
                opacity: 0.25;
            }
    
            .bs-docs-sidenav > li > a:hover {
                background-color: #f5f5f5;
            }
    
            .bs-docs-sidenav a:hover .icon-chevron-right {
                opacity: 0.5;
            }
    
            .bs-docs-sidenav .active .icon-chevron-right, .bs-docs-sidenav .active a:hover .icon-chevron-right {
                background-image: url("../img/glyphicons-halflings-white.png");
                opacity: 1;
            }
        </style>
    
    </head>
    <body>
    <div class="container-fluid" style="padding-right: 0px;padding-left: 0px;">
        <div region="north" style="height: 100px;background-image: url('images/bg.jpg')">
            <div align="left" style="width: 80%;height:100px ;float: left;padding-top: 40px;padding-left: 30px;"><font
                    color="white" size="6">宿舍管理系统</font></div>
            <div style="padding-top: 70px;padding-right: 20px;">当前用户:&nbsp;<font color="red">${currentUser.userName }</font>
            </div>
        </div>
    </div>
    <div class="container-fluid">
        <div class="row-fluid">
            <div class="span2 bs-docs-sidebar">
                <ul class="nav nav-list bs-docs-sidenav">
                    <li><a href="blank"><i class="icon-chevron-right"></i>首页</a></li>
                    <li><a href="student?action=list"><i class="icon-chevron-right"></i>学生查看</a></li>
                    <li><a href="record?action=list"><i class="icon-chevron-right"></i>缺勤记录</a></li>
                    <li><a href="password?action=preChange"><i class="icon-chevron-right"></i>修改密码</a></li>
                    <li><a href="login.jsp"><i class="icon-chevron-right"></i>退出系统</a></li>
                </ul>
            </div>
            <div class="span10">
                <jsp:include page="${mainPage==null?'admin/blank.jsp':mainPage}"></jsp:include>
            </div>
        </div>
    </div>
    </body>
    </html>

    mainStudent.jsp

    <%@ page language="java" contentType="text/html; charset=utf-8"
             pageEncoding="utf-8" %>
    <html lang="zh">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>宿舍管理系统</title>
        <link href="${pageContext.request.contextPath}/style/dorm.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath}/bootstrap-datetimepicker-master/css/bootstrap-datetimepicker.min.css"
              rel="stylesheet" media="screen">
        <link rel="stylesheet" type="text/css"
              href="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/dataTables.bootstra.css">
        <script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/jquery.js"></script>
        <script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/jquery.dataTables.js"></script>
        <script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/bootstrap.min.js"></script>
        <script type="text/javascript"
                src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/dataTables.bootstrap.js"></script>
        <script type="text/javascript"
                src="${pageContext.request.contextPath}/bootstrap-datetimepicker-master/js/bootstrap-datetimepicker.js"
                charset="UTF-8"></script>
        <script type="text/javascript"
                src="${pageContext.request.contextPath}/bootstrap-datetimepicker-master/js/locales/bootstrap-datetimepicker.fr.js"
                charset="UTF-8"></script>
        <script src="${pageContext.request.contextPath}/bootstrap/js/bootstrap.js"></script>
    
        <script type="text/javascript">
            $(document).ready(function () {
                $("#DataTables_Table_0_wrapper .row-fluid").remove();
            });
        </script>
        <style type="text/css">
            .bs-docs-sidenav {
                background-color: #fff;
                border-radius: 6px;
                box-shadow: 0 1px 4px rgba(0, 0, 0, 0.067);
                padding: 0;
                width: 228px;
            }
    
            .bs-docs-sidenav > li > a {
                border: 1px solid #e5e5e5;
                display: block;
                padding: 8px 14px;
                margin: 0 0 -1px;
            }
    
            .bs-docs-sidenav > li:first-child > a {
                border-radius: 6px 6px 0 0;
            }
    
            .bs-docs-sidenav > li:last-child > a {
                border-radius: 0 0 6px 6px;
            }
    
            .bs-docs-sidenav > .active > a {
                border: 0 none;
                box-shadow: 1px 0 0 rgba(0, 0, 0, 0.1) inset, -1px 0 0 rgba(0, 0, 0, 0.1) inset;
                padding: 9px 15px;
                position: relative;
                text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
                z-index: 2;
            }
    
            .bs-docs-sidenav .icon-chevron-right {
                float: right;
                margin-right: -6px;
                margin-top: 2px;
                opacity: 0.25;
            }
    
            .bs-docs-sidenav > li > a:hover {
                background-color: #f5f5f5;
            }
    
            .bs-docs-sidenav a:hover .icon-chevron-right {
                opacity: 0.5;
            }
    
            .bs-docs-sidenav .active .icon-chevron-right, .bs-docs-sidenav .active a:hover .icon-chevron-right {
                background-image: url("../img/glyphicons-halflings-white.png");
                opacity: 1;
            }
        </style>
    
    </head>
    <body>
    <div class="container-fluid" style="padding-right: 0px;padding-left: 0px;">
        <div region="north" style="height: 100px;background-image: url('images/bg.jpg')">
            <div align="left" style="width: 80%;height:100px ;float: left;padding-top: 40px;padding-left: 30px;"><font
                    color="white" size="6">宿舍管理系统</font></div>
            <div style="padding-top: 70px;padding-right: 20px;">当前用户:&nbsp;<font color="red">${currentUser.userName }</font>
            </div>
        </div>
    </div>
    <div class="container-fluid">
        <div class="row-fluid">
            <div class="span2 bs-docs-sidebar">
                <ul class="nav nav-list bs-docs-sidenav">
                    <li><a href="blank"><i class="icon-chevron-right"></i>首页</a></li>
                    <li><a href="record?action=list"><i class="icon-chevron-right"></i>缺勤记录</a></li>
                    <li><a href="password?action=preChange"><i class="icon-chevron-right"></i>修改密码</a></li>
                    <li><a href="login.jsp"><i class="icon-chevron-right"></i>退出系统</a></li>
                </ul>
            </div>
            <div class="span10">
                <jsp:include page="${mainPage==null?'admin/blank.jsp':mainPage}"></jsp:include>
            </div>
        </div>
    </div>
    </body>
    </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.支持博主

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

    展开全文
  • 符合大部分高校的实训要求,学生宿舍管理系统,使用Java swing完成界面设计,数据库用的是MySQL,工具使用的是IDEA,学生宿舍管理系统的用户有宿管和学生,宿管有最高的权限,学生只有部分权限,附有源码和数据库...
  • 高校学生宿舍管理系统,是一个很好的毕业设计或者课程设计,功能齐全,页面美观。 系统运行环境: 项目开发语言:Java语言 项目开发工具:idea等 项目开发技术:后台采用springmvc技术 服务器软件:tomcat7.0 数据库...
  • ssm学生宿舍管理系统,maven多模块搭建,实现用户分角色登录+分页等技术 项目描述 maven分模块项目+SSM宿舍管理系统+spring mvc+jquery+bootstrap+多模块+svn+分角色登录+分页+拦截器+收邮件。发邮件等。。。。。。 ...
  • SpringBoot+Vue+Shiro+Mysql+Redis的员工宿舍信息管理系统
  • 基于ssm框架开发. 简单的Javaweb 课程设计. 宿舍管理系统,包含课程设计书
  • <Context path="/" docBase="F:/IDEA_workspace/deploy_apps_workspace/demo1/yao.demos.war"/> 地址改成自己的;path为/;表示不加项目名访问; 启动完成过后为 访问路径:http:127.0.0.1(端口)/login
  • 项目采用SpringBoot +Maven多模块开发,数据库使用mysql,数据库脚本文件在dorm-web/src/main/resources/sql文件夹中。可以自己部署到IDEA开发工具中运行。
  • (2)宿舍分配管理 根据给定的宿舍信息与学生信息,按照一定的规则自动地给还未分配宿舍的 学生分配宿舍,学生可在该宿舍内自选床位,最终的宿舍分配信息可以以文件形 式(如 Excel 表格)导出。 (3)宿舍日常管理 ...
  • 学生宿舍管理系统(前端部分)

    千次阅读 多人点赞 2021-05-13 13:07:48
    前几天的五一作业内容叫我们写一个学生宿舍管理系统。 可。。。就只有五天啊! 所以,经过重重考虑,得出两种解决方法: 1.从网上找源码,保证5天内完成,但交了作业却失去了意义。 2.自己写,先把最简单的前端部分...

    前几天的五一作业内容叫我们写一个学生宿舍管理系统。
    可。。。就只有五天啊!

    所以,经过重重考虑,得出两种解决方法
    1.从网上找源码,保证5天内完成,但交了作业却失去了意义。
    2.自己写,先把最简单的前端部分完成,后端等以后有时间自己补。

    什么,选1!因为俺要兼职,要玩耍,时间不够,直接找源码交最简单。
    等等等,那可不行,俺可是好学生,自己写自己写,简单点无所谓,心意到了就行!
    在这里插入图片描述
    按照书里的要求,宿舍学生宿舍管理系统的要求是这样的:
    在这里插入图片描述
    了解了要求后,那可不得开始干活了。
    前端部分,我们引用了layui,jquery框架,js,css,h5进行编码。可以说是怎么简单怎么来吧。

    首先,登录注册得有吧。
    登录界面:
    登录对象有:学生,宿舍管理员,辅导员可供选择,点击注册按钮会跳转到注册界面,并加入了简单的登录注册验证功能。
    其实本来想再加上session来验证的,但没下载Node.js,
    所以就只给了简单的字符串验证了。
    在这里插入图片描述
    注册界面:
    在这里插入图片描述
    搞完注册登录后,进入主界面home:
    左侧的菜单栏是按照第一张图的体系结构设计的。
    菜单栏最大是分层是两层,第三层在中间显示部分中展示。
    这样做的目的是为了左侧菜单栏更美观,避免分层过多,过于杂乱。
    其中主页有快捷入口,点击进入对应的模块;
    当然,也可以自己在下面寻找进入模块。
    在这里插入图片描述
    学生信息浏览部分的表格数据是直接写入h5的,是死数据。后期等有时间可以改为动态数据导入。
    在这里插入图片描述

    学生信息登录:
    在这里插入图片描述

    学生信息修改:
    在这里插入图片描述

    入住管理:
    在这里插入图片描述
    期末注销:
    在这里插入图片描述
    来访查询:
    在这里插入图片描述
    来访登记:
    在这里插入图片描述
    来访登记可以选择来访时间,结束时间,过程时间。点击弹出相应控件。
    在这里插入图片描述
    人员统计:
    在这里插入图片描述
    报表:
    在这里插入图片描述
    点击退出返回登录界面等。。。。。。。。。。

    模块有点多,就不细讲了。
    其实大部分界面都差不多的,也有少部分没写的界面,
    但总体上实现了学生管理系统所需要的前端界面
    如果想要源码,请转☞

    [学生宿舍管理系统(前端部分!)]

    学生宿舍管理系统(前端部分!)

    期待你的点赞关注!
    在这里插入图片描述

    展开全文
  • java 学生宿舍管理系统,两套源码均可运行,总有一套适合你,可以运行,有数据库文件,导入库即可,小白可以操作。亲测可以运行的,eclipse / idea 均可。
  • 该项目实现了学生信息、宿舍信息、管理员信息、考勤信息等的管理功能,学生、宿管、系统管理员登录后系统显示不同的界面。数据库采用的是mysql,功能结构层次非常清晰,是Java学习参考非常难得的好项目。
  • 《基于javaweb宿舍管理系统》该项目采用技术:jsp +servlet +mysql+jdbc+css+js等相关技术,项目含有源码、课设报告、配套开发软件、软件安装教程、项目发布教程等 下面是资料信息截图: 下面是系统运行起来后的...
  • 校园宿舍管理系统课程设计报告

    千次阅读 多人点赞 2019-06-19 15:52:00
     题 目 校园宿舍管理系统  授课老师 袁飞   目录 第一章系统概述..............................................................................................................................
  • 宿舍管理系统.zip

    2020-09-01 12:55:42
    大二课程设计资料,含报告,程序源代码,数据库结构,可运行jar程序包。 用java.awt编写的UI界面系统,mysql建立数据库,连接数据库实现用户的注册,登录验证功能
  • java,myeclipse
  • 学生宿舍管理系统

    2015-01-07 02:28:57
    本课程设计任务的目的是要求学生按照分析、设计、编码、调试和测试的软件开发过程独立完成一个学生宿舍基本情况管理系统,并能最终实现本系统的功能要求。
  • 简单的Java项目--学生宿舍管理系统

    万次阅读 多人点赞 2020-09-08 19:56:49
    最开始想做的事项目就是学生成绩管理系统,考虑到在学习学校课程中最常见就是完成学生成绩管理系统,为了检验自己的能力学生成绩管理系统就不在考虑范畴之中,因此便完成了学生宿舍管理系统。 2、项目功能 用户登录 ...
  • JAVA学生宿舍后台管理系统源码
  • 随着每年高校大学生不断的扩招,人数的增加导致宿舍管理压力巨大。学校宿舍作为高校管理的组成部分,现如今还有部分高校,通过纸质的方式登记学生进出宿舍的情况,这不仅工作效率低下,而且使得的管理上也极其反映...
  • 基于SSM宿舍管理系统

    千次阅读 2022-03-12 19:10:11
    学生管理、班级管理、宿舍管理、卫生管理等 项目截图: 部分代码: /** * 添加宿舍卫生信息 */ @RequestMapping(value = "/addDormClean" ,method = RequestMethod.POST) @ResponseBody public ...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 766
精华内容 306
关键字:

idea宿舍管理系统