diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..27083c3
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+sims_war.war
+out
+/hello.txt
+.idea
diff --git a/README.md b/README.md
index daead5d..d9cf5a3 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,102 @@
-# text1
+# 学生信息管理系统SIMS
+纯Servlet技术的学生信息管理系统,没有SpringMVC、Spring Boot框架
+## 项目简介
+
+面向教学信息以及学生及老师的信息管理要求,学生信息管理系统应运而生,它能提供线上的信息管理,从而高效的处理数据。方便方便对学生及老师各类数据进行大数据分析。
+
+## 项目演示
+
+> https://sims.rawchen.com
+
+## 技术栈
+
+Jsp+Servlet+Layui+Druid+JDBC-Template+JQuery+Js+Ajax+Json+EL/JSTL+BeanUtils
+
+服务器: Tomcat_8.5.53
+
+数据库: MySQL_5.6.46
+
+开发工具:IDEA_2019.1.3
+
+界面制作:Layui
+
+## 项目使用说明
+
+1. 导入结构和数据:sims.sql
+
+2. 解压下载zip重命名sims-master文件夹为sims,IDEA打开该sims项目
+
+3. 修改配置数据库连接文件:druid.properties
+
+4. 为项目添加Tomcat配置,Deployment下Application context设置为:/sims
+
+ 管理员 帐号:admin 密码:admin
+
+ 学生 帐号:1812123206 密码:123
+
+ 老师 帐号:9912123206 密码:123
+
+## 功能描述
+
+
+
+
+
+## 数据库设计
+
+
+
+
+## 代码结构
+
+
+
+
+
+
+
+## 功能实现部分截图
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/screenshots/1.jpg b/screenshots/1.jpg
new file mode 100644
index 0000000..8233ff3
Binary files /dev/null and b/screenshots/1.jpg differ
diff --git a/screenshots/gnmk.png b/screenshots/gnmk.png
new file mode 100644
index 0000000..d324c53
Binary files /dev/null and b/screenshots/gnmk.png differ
diff --git a/screenshots/gnsx1.png b/screenshots/gnsx1.png
new file mode 100644
index 0000000..f9b3aa1
Binary files /dev/null and b/screenshots/gnsx1.png differ
diff --git a/screenshots/gnsx2.png b/screenshots/gnsx2.png
new file mode 100644
index 0000000..945cd2a
Binary files /dev/null and b/screenshots/gnsx2.png differ
diff --git a/screenshots/gnsx3.png b/screenshots/gnsx3.png
new file mode 100644
index 0000000..cd67cb5
Binary files /dev/null and b/screenshots/gnsx3.png differ
diff --git a/screenshots/gnsx4.png b/screenshots/gnsx4.png
new file mode 100644
index 0000000..f67f5b9
Binary files /dev/null and b/screenshots/gnsx4.png differ
diff --git a/screenshots/gnsx5.png b/screenshots/gnsx5.png
new file mode 100644
index 0000000..56a21ca
Binary files /dev/null and b/screenshots/gnsx5.png differ
diff --git a/screenshots/gnsx6.png b/screenshots/gnsx6.png
new file mode 100644
index 0000000..de6310d
Binary files /dev/null and b/screenshots/gnsx6.png differ
diff --git a/screenshots/gnsx7.png b/screenshots/gnsx7.png
new file mode 100644
index 0000000..5b5191d
Binary files /dev/null and b/screenshots/gnsx7.png differ
diff --git a/screenshots/jgt1.jpg b/screenshots/jgt1.jpg
new file mode 100644
index 0000000..163feea
Binary files /dev/null and b/screenshots/jgt1.jpg differ
diff --git a/screenshots/jgt2.jpg b/screenshots/jgt2.jpg
new file mode 100644
index 0000000..af8f85b
Binary files /dev/null and b/screenshots/jgt2.jpg differ
diff --git a/screenshots/sql.png b/screenshots/sql.png
new file mode 100644
index 0000000..94c8008
Binary files /dev/null and b/screenshots/sql.png differ
diff --git a/sims.iml b/sims.iml
new file mode 100644
index 0000000..bd3b431
--- /dev/null
+++ b/sims.iml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sims.sql b/sims.sql
new file mode 100644
index 0000000..fc6370a
--- /dev/null
+++ b/sims.sql
@@ -0,0 +1,240 @@
+/*
+ Navicat Premium Data Transfer
+
+ Source Server : MySQL
+ Source Server Type : MySQL
+ Source Server Version : 50646
+ Source Host : localhost:3306
+ Source Schema : sims
+
+ Target Server Type : MySQL
+ Target Server Version : 50646
+ File Encoding : 65001
+
+ Date: 28/05/2020 00:12:40
+*/
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for admin
+-- ----------------------------
+DROP TABLE IF EXISTS `admin`;
+CREATE TABLE `admin` (
+ `a_id` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `a_password` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ PRIMARY KEY (`a_id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
+
+-- ----------------------------
+-- Records of admin
+-- ----------------------------
+INSERT INTO `admin` VALUES ('admin', 'admin');
+
+-- ----------------------------
+-- Table structure for college_department_class
+-- ----------------------------
+DROP TABLE IF EXISTS `college_department_class`;
+CREATE TABLE `college_department_class` (
+ `college` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `department` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `cclass` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ PRIMARY KEY (`college`, `department`, `cclass`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
+
+-- ----------------------------
+-- Records of college_department_class
+-- ----------------------------
+INSERT INTO `college_department_class` VALUES ('应用数学学院', '数学', '数学1');
+INSERT INTO `college_department_class` VALUES ('应用数学学院', '数学', '数学2');
+INSERT INTO `college_department_class` VALUES ('应用数学学院', '数理基础科学', '数理基础1');
+INSERT INTO `college_department_class` VALUES ('应用数学学院', '数理基础科学', '数理基础2');
+INSERT INTO `college_department_class` VALUES ('软件工程学院', '新媒体', '18新媒体1');
+INSERT INTO `college_department_class` VALUES ('软件工程学院', '新媒体', '18新媒体2');
+INSERT INTO `college_department_class` VALUES ('软件工程学院', '软件工程', '18软件(理软)1');
+INSERT INTO `college_department_class` VALUES ('软件工程学院', '软件工程', '18软件(理软)2');
+INSERT INTO `college_department_class` VALUES ('软件工程学院', '软件工程', '19软件(理软)1');
+INSERT INTO `college_department_class` VALUES ('软件工程学院', '软件工程', '19软件(理软)2');
+
+-- ----------------------------
+-- Table structure for complaint
+-- ----------------------------
+DROP TABLE IF EXISTS `complaint`;
+CREATE TABLE `complaint` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `cdate` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `content` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 48 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
+
+-- ----------------------------
+-- Records of complaint
+-- ----------------------------
+INSERT INTO `complaint` VALUES (1, '2020-05-02 17:40:17', '这是第一条小吐槽哦');
+INSERT INTO `complaint` VALUES (2, '2020-05-02 18:07:51', '哈哈哈,界面不错');
+INSERT INTO `complaint` VALUES (3, '2020-05-02 18:09:33', '可以的兄弟');
+INSERT INTO `complaint` VALUES (4, '2020-05-02 18:16:24', '我测试下');
+INSERT INTO `complaint` VALUES (31, '2020-05-02 21:05:26', 'input');
+INSERT INTO `complaint` VALUES (32, '2020-05-20 19:07:45', '我我我我');
+INSERT INTO `complaint` VALUES (33, '2020-05-26 22:41:34', 'input/');
+INSERT INTO `complaint` VALUES (36, '2020-05-27 17:59:14', '
灌灌灌灌灌过过fffffdsfljhidldf
\r\n\r\n\r\n - \r\n
sFFDSFS
\r\n \r\n - 23234234asd
\r\n
\r\n');
+INSERT INTO `complaint` VALUES (45, '2020-05-27 20:36:37', '做个测试啊
\r\n\r\n
\r\n');
+INSERT INTO `complaint` VALUES (47, '2020-05-27 20:42:28', '

Nice
\r\n');
+
+-- ----------------------------
+-- Table structure for course
+-- ----------------------------
+DROP TABLE IF EXISTS `course`;
+CREATE TABLE `course` (
+ `c_id` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `c_name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `t_id` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `c_info` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ PRIMARY KEY (`c_id`) USING BTREE,
+ INDEX `t_id`(`t_id`) USING BTREE,
+ CONSTRAINT `course_ibfk_1` FOREIGN KEY (`t_id`) REFERENCES `teacher` (`t_id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
+
+-- ----------------------------
+-- Records of course
+-- ----------------------------
+INSERT INTO `course` VALUES ('c1111', 'java进阶', '9912123206', '关于java进阶的故事啊啊啊啊');
+INSERT INTO `course` VALUES ('c1113', '软件测试', '9912123206', '软件测试课程');
+INSERT INTO `course` VALUES ('cccc', 'as撒大大', '9912123206', '第三方爽肤水发顺丰所ddd');
+INSERT INTO `course` VALUES ('ye_course_124', 'JVM虚拟机性能优化', '9912123205', '巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉');
+
+-- ----------------------------
+-- Table structure for notify
+-- ----------------------------
+DROP TABLE IF EXISTS `notify`;
+CREATE TABLE `notify` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `notifyDate` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `notifyInfo` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 32 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
+
+-- ----------------------------
+-- Records of notify
+-- ----------------------------
+INSERT INTO `notify` VALUES (3, '2020-04-24 15:36:22', '222222222222222222');
+INSERT INTO `notify` VALUES (4, '2020-04-24 15:36:22', '奥术大师所所所所所所所所所所所所所所所所所所所所所所所');
+INSERT INTO `notify` VALUES (5, '2020-04-24 15:36:22', '这是一条测试文本啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊');
+INSERT INTO `notify` VALUES (16, '2020-04-24 18:51:15', '这是4.24最新公告,仅供测试');
+INSERT INTO `notify` VALUES (17, '2020-04-24 19:40:45', '测试发布公告');
+INSERT INTO `notify` VALUES (18, '2020-04-24 19:42:40', '敖德萨大萨达大所多');
+INSERT INTO `notify` VALUES (22, '2020-04-24 20:34:00', '2111111111111');
+INSERT INTO `notify` VALUES (23, '2020-04-24 20:42:31', '4.24最新公告');
+INSERT INTO `notify` VALUES (24, '2020-04-24 20:44:30', '2020.4.24最新公告哈哈哈哈还好哈哈哈哈还好哈哈哈哈还好或或或或');
+INSERT INTO `notify` VALUES (25, '2020-04-24 20:49:35', '增加几个查询模块');
+INSERT INTO `notify` VALUES (26, '2020-04-24 21:00:14', '增加管理员公告发布');
+INSERT INTO `notify` VALUES (28, '2020-05-01 22:06:35', '增加学生端选课系统,增加修改用户信息,修改密码功能');
+INSERT INTO `notify` VALUES (29, '2020-05-13 12:20:10', '增加学生分页功能,管理端添加学生选中列表删除,添加全选');
+INSERT INTO `notify` VALUES (30, '2020-05-18 23:39:16', '增加文件传输服务,管理上传,全员可下载,任意大小类型');
+INSERT INTO `notify` VALUES (31, '2020-05-27 18:29:16', '小吐槽增加富文本编辑器,开源CKEditor 4');
+
+-- ----------------------------
+-- Table structure for photo
+-- ----------------------------
+DROP TABLE IF EXISTS `photo`;
+CREATE TABLE `photo` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `photo_id` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `photo_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0.jpg',
+ PRIMARY KEY (`id`) USING BTREE,
+ INDEX `photo_id`(`photo_id`) USING BTREE,
+ CONSTRAINT `photo_ibfk_1` FOREIGN KEY (`photo_id`) REFERENCES `student` (`s_id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
+
+-- ----------------------------
+-- Records of photo
+-- ----------------------------
+INSERT INTO `photo` VALUES (10, '1812123206', '1812123206.jpg');
+INSERT INTO `photo` VALUES (11, '1812123205', '1812123205.jpg');
+
+-- ----------------------------
+-- Table structure for select_course
+-- ----------------------------
+DROP TABLE IF EXISTS `select_course`;
+CREATE TABLE `select_course` (
+ `s_id` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `c_id` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `score` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ PRIMARY KEY (`s_id`, `c_id`) USING BTREE,
+ INDEX `s_id`(`s_id`) USING BTREE,
+ INDEX `c_id`(`c_id`) USING BTREE,
+ CONSTRAINT `select_course_ibfk_1` FOREIGN KEY (`s_id`) REFERENCES `student` (`s_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `select_course_ibfk_2` FOREIGN KEY (`c_id`) REFERENCES `course` (`c_id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
+
+-- ----------------------------
+-- Records of select_course
+-- ----------------------------
+INSERT INTO `select_course` VALUES ('1812123205', 'c1111', '70');
+INSERT INTO `select_course` VALUES ('1812123205', 'c1113', NULL);
+INSERT INTO `select_course` VALUES ('1812123205', 'cccc', NULL);
+INSERT INTO `select_course` VALUES ('1812123206', 'c1111', '10');
+INSERT INTO `select_course` VALUES ('1812123206', 'c1113', NULL);
+INSERT INTO `select_course` VALUES ('1812123206', 'cccc', NULL);
+INSERT INTO `select_course` VALUES ('5555555555', 'ye_course_124', '60');
+
+-- ----------------------------
+-- Table structure for student
+-- ----------------------------
+DROP TABLE IF EXISTS `student`;
+CREATE TABLE `student` (
+ `s_id` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `s_college` varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '待分配',
+ `s_department` varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '待分配',
+ `s_class` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '待分配',
+ `s_name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `s_sex` varchar(5) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `s_age` varchar(11) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `s_address` varchar(35) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `s_phone` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `s_email` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `s_password` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '123',
+ PRIMARY KEY (`s_id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
+
+-- ----------------------------
+-- Records of student
+-- ----------------------------
+INSERT INTO `student` VALUES ('1111111111', '软件工程学院', '软件工程', '18软件(理软)1', '陈毅', '男', '19', '福建', '12131231', '22@qq.com', '123');
+INSERT INTO `student` VALUES ('1111111112', '待分配', '待分配', '待分配', '哈哈哈', '女', '19', '敖德萨', '23136456', '123@qq.com', '123');
+INSERT INTO `student` VALUES ('1111111113', '待分配', '待分配', '待分配', '大大大', '男', '19', '福建', '231335353', '123@qq.com', '123');
+INSERT INTO `student` VALUES ('1111111114', '待分配', '待分配', '待分配', '仍然让', '男', '19', '福建', '2313124325', '123@qq.com', '123');
+INSERT INTO `student` VALUES ('1231231231', '待分配', '待分配', '待分配', '上官怡蓝', '女', '20', '西藏', '233245', '1@icloud.com', '123');
+INSERT INTO `student` VALUES ('1231238768', '应用数学学院', '数学', '数学1', '陈欣', '女', '19', '福建', '23136457', '123@qq.com', '123');
+INSERT INTO `student` VALUES ('1234567890', '软件工程学院', '软件工程', '18软件(理软)2', 'csq', '男', '20', '福建', '2313213', '123@qq.com', '123');
+INSERT INTO `student` VALUES ('1812123205', '软件工程学院', '软件工程', '18软件(理软)1', '陈善涛', '男', '20', '福建', '110', 'cst@qq.com', '123');
+INSERT INTO `student` VALUES ('1812123206', '软件工程学院', '软件工程', '18软件(理软)1', '陈双全', '男', '21', '福建省厦门市', '18259234126', '2221999792@qq.com', '123');
+INSERT INTO `student` VALUES ('1812123238', '软件工程学院', '软件工程', '18软件(理软)1', '张怀洲', '男', '23', '福建', '120', 'zhz@qq.com', '123');
+INSERT INTO `student` VALUES ('1812123299', '软件工程学院', '软件工程', '18新媒体1', '陈双全2', '女', '88', '福建省龙岩市', '18259234999', '888@qq.com', '123');
+INSERT INTO `student` VALUES ('1812123405', '软件工程学院', '软件工程', '18软件(理软)2', '王五', '男', '20', '福建省厦门市', '18323847123', '123972@qq.com', '123');
+INSERT INTO `student` VALUES ('2222222222', '软件工程学院', '软件工程', '18新媒体1', '碧华', '男', '21', '福建', '4231323', '213@qq.com', '123');
+INSERT INTO `student` VALUES ('5555555555', '待分配', '待分配', '待分配', '打发打', '女', '', '', '', '', '555');
+INSERT INTO `student` VALUES ('7777777777', '待分配', '待分配', '待分配', '李子柒', '女', '26', '福建', '124123132', '123@qq.com', '123');
+
+-- ----------------------------
+-- Table structure for teacher
+-- ----------------------------
+DROP TABLE IF EXISTS `teacher`;
+CREATE TABLE `teacher` (
+ `t_id` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `t_name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `t_sex` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `t_education` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `t_title` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `t_password` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '123',
+ PRIMARY KEY (`t_id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
+
+-- ----------------------------
+-- Records of teacher
+-- ----------------------------
+INSERT INTO `teacher` VALUES ('9912123205', '叶老师', '女', '硕士', '助教', '123');
+INSERT INTO `teacher` VALUES ('9912123206', '陈老师', '男', '博士', '讲师', '123');
+
+SET FOREIGN_KEY_CHECKS = 1;
diff --git a/src/dao/AdminDao.java b/src/dao/AdminDao.java
new file mode 100644
index 0000000..6d87b0b
--- /dev/null
+++ b/src/dao/AdminDao.java
@@ -0,0 +1,11 @@
+package dao;
+
+import domain.Admin;
+
+public interface AdminDao {
+ Admin findAdminidAndPassword(String id, String password);
+
+ void updatePassword(String adminid, String newpassword);
+
+ Admin findAdminById(String a_id);
+}
diff --git a/src/dao/CDCDao.java b/src/dao/CDCDao.java
new file mode 100644
index 0000000..9e0791c
--- /dev/null
+++ b/src/dao/CDCDao.java
@@ -0,0 +1,15 @@
+package dao;
+
+import domain.CDC;
+
+import java.util.List;
+
+public interface CDCDao {
+ List findAllCollege();
+
+ List findAllDepartment();
+
+ List findAllClass();
+
+ List findAll();
+}
diff --git a/src/dao/ComplaintDao.java b/src/dao/ComplaintDao.java
new file mode 100644
index 0000000..c36553f
--- /dev/null
+++ b/src/dao/ComplaintDao.java
@@ -0,0 +1,11 @@
+package dao;
+
+import domain.Complaint;
+
+import java.util.List;
+
+public interface ComplaintDao {
+ List findAllComplaint();
+
+ void addComplaint(Complaint complaint);
+}
diff --git a/src/dao/CourseDao.java b/src/dao/CourseDao.java
new file mode 100644
index 0000000..69cf044
--- /dev/null
+++ b/src/dao/CourseDao.java
@@ -0,0 +1,11 @@
+package dao;
+
+import domain.Course;
+
+public interface CourseDao {
+ void addOptionalCourse(Course course);
+
+ Course findSelectCourseByCourseId(String cid);
+
+ void deleteServiceById(String cid);
+}
diff --git a/src/dao/NotifyDao.java b/src/dao/NotifyDao.java
new file mode 100644
index 0000000..40bd8d9
--- /dev/null
+++ b/src/dao/NotifyDao.java
@@ -0,0 +1,16 @@
+package dao;
+
+import domain.Notify;
+
+import java.util.List;
+
+public interface NotifyDao {
+ void add(Notify notify);
+
+ List findNotify();
+
+ List findAllNotify();
+
+ void deleteNotifyById(String notifyid);
+
+}
diff --git a/src/dao/PhotoDao.java b/src/dao/PhotoDao.java
new file mode 100644
index 0000000..68fafd9
--- /dev/null
+++ b/src/dao/PhotoDao.java
@@ -0,0 +1,11 @@
+package dao;
+
+import domain.Photo;
+
+public interface PhotoDao {
+ void addPhoto(Photo photo);
+
+ Photo findPhotoByPhotoId(String id);
+
+ void updatePhoto(Photo photo);
+}
diff --git a/src/dao/SelectCourseDao.java b/src/dao/SelectCourseDao.java
new file mode 100644
index 0000000..ef5167b
--- /dev/null
+++ b/src/dao/SelectCourseDao.java
@@ -0,0 +1,13 @@
+package dao;
+
+import domain.SelectCourse;
+
+import java.util.List;
+
+public interface SelectCourseDao {
+ List findStudentSelectedCourseByCourseId(String cid);
+
+ SelectCourse findScoreByCourseIdAndStudentId(String cid, String sid);
+
+ void upDateScoreByCidAndSid(String cid, String sid, String sScore);
+}
diff --git a/src/dao/StudentDao.java b/src/dao/StudentDao.java
new file mode 100644
index 0000000..1d9bf0f
--- /dev/null
+++ b/src/dao/StudentDao.java
@@ -0,0 +1,41 @@
+package dao;
+
+import domain.Course;
+import domain.SelectCourse;
+import domain.Student;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 学生操作的DAO
+ */
+public interface StudentDao {
+ List findByPage(int start, int rows, Map condition);
+
+ List findAll();
+
+ Student findStudentidAndPassword(String id, String password);
+
+ Student findStudentById(String s_id);
+
+ void addStudent(Student student);
+
+ void updateInfo(Student student);
+
+ void updatePassword(String studentid, String newpassword);
+
+ List findAllSelectCourse(String studentid);
+
+ List findAllOptionalCourse();
+
+ void addSelectCourse(String studentid, String courseid);
+
+ void deleteStudentById(String studentid);
+
+ int findTotalCount(Map condition);
+
+ void addStudentAllInfo(Student updateStudent);
+
+ List findSelectCourseAllStudent();
+}
diff --git a/src/dao/TeacherDao.java b/src/dao/TeacherDao.java
new file mode 100644
index 0000000..db62cbb
--- /dev/null
+++ b/src/dao/TeacherDao.java
@@ -0,0 +1,33 @@
+package dao;
+
+import domain.Course;
+import domain.Teacher;
+
+import java.util.List;
+
+/**
+ * 管理员操作的DAO
+ */
+public interface TeacherDao {
+ Teacher findTeacheridAndPassword(String id, String password);
+
+ List findAll();
+
+ List findMySelfOptionalCourse(String t_id);
+
+ Course findOptionalCourseByCourseId(String cid);
+
+ void updateCourseInfo(Course updateCourse);
+
+ void deleteCourseById(String cid);
+
+ void updatePassword(String teacherid, String newpassword);
+
+ Teacher findTeacherById(String t_id);
+
+ void addTeacherAllInfo(Teacher updateTeacher);
+
+ void deleteTeacherById(String teacherid);
+
+ void updateInfo(Teacher updateTeacher);
+}
diff --git a/src/dao/impl/AdminDaoImpl.java b/src/dao/impl/AdminDaoImpl.java
new file mode 100644
index 0000000..eaed205
--- /dev/null
+++ b/src/dao/impl/AdminDaoImpl.java
@@ -0,0 +1,46 @@
+package dao.impl;
+
+import dao.AdminDao;
+import domain.Admin;
+import org.springframework.dao.DataAccessException;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
+import org.springframework.jdbc.core.JdbcTemplate;
+import utils.JDBCUtils;
+
+public class AdminDaoImpl implements AdminDao {
+ private JdbcTemplate template = new JdbcTemplate(JDBCUtils.getDataSource());
+
+ @Override
+ public Admin findAdminidAndPassword(String id, String password) {
+ try {
+ String sql = "select * from admin where a_id = ? and a_password = ?";
+ Admin admin = template.queryForObject(sql,new BeanPropertyRowMapper(Admin.class),id,password);
+ return admin;
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ @Override
+ public void updatePassword(String adminid, String newpassword) {
+ try {
+ String sql = "update admin set a_password=? where a_id=?";
+ template.update(sql,newpassword,adminid);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public Admin findAdminById(String id) {
+ try {
+ String sql = "select * from admin where a_id = ?";
+ Admin admin = template.queryForObject(sql,new BeanPropertyRowMapper(Admin.class),id);
+ return admin;
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+}
diff --git a/src/dao/impl/CDCDaoImpl.java b/src/dao/impl/CDCDaoImpl.java
new file mode 100644
index 0000000..a16f0a0
--- /dev/null
+++ b/src/dao/impl/CDCDaoImpl.java
@@ -0,0 +1,62 @@
+package dao.impl;
+
+import dao.CDCDao;
+import domain.CDC;
+import org.springframework.dao.DataAccessException;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
+import org.springframework.jdbc.core.JdbcTemplate;
+import utils.JDBCUtils;
+
+import java.util.List;
+
+public class CDCDaoImpl implements CDCDao {
+ private JdbcTemplate template = new JdbcTemplate(JDBCUtils.getDataSource());
+
+ @Override
+ public List findAllCollege() {
+ try {
+ String sql = "select distinct college from college_department_class";
+ List cdcs = template.query(sql, new BeanPropertyRowMapper(CDC.class));
+ return cdcs;
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ @Override
+ public List findAllDepartment() {
+ try {
+ String sql = "select distinct department from college_department_class";
+ List cdcs = template.query(sql, new BeanPropertyRowMapper(CDC.class));
+ return cdcs;
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ @Override
+ public List findAllClass() {
+ try {
+ String sql = "select distinct cclass from college_department_class";
+ List cdcs = template.query(sql, new BeanPropertyRowMapper(CDC.class));
+ return cdcs;
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ @Override
+ public List findAll() {
+ try {
+ String sql = "select * from college_department_class";
+ List cdcs = template.query(sql, new BeanPropertyRowMapper(CDC.class));
+ return cdcs;
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+}
diff --git a/src/dao/impl/ComplaintDaoImpl.java b/src/dao/impl/ComplaintDaoImpl.java
new file mode 100644
index 0000000..da2d947
--- /dev/null
+++ b/src/dao/impl/ComplaintDaoImpl.java
@@ -0,0 +1,36 @@
+package dao.impl;
+
+import dao.ComplaintDao;
+import domain.Complaint;
+import org.springframework.dao.DataAccessException;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
+import org.springframework.jdbc.core.JdbcTemplate;
+import utils.JDBCUtils;
+
+import java.util.List;
+
+public class ComplaintDaoImpl implements ComplaintDao {
+ private JdbcTemplate template = new JdbcTemplate(JDBCUtils.getDataSource());
+
+ @Override
+ public List findAllComplaint() {
+ try {
+ String sql = "select * from complaint order by id DESC";
+ List complaints = template.query(sql, new BeanPropertyRowMapper(Complaint.class));
+ return complaints;
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ @Override
+ public void addComplaint(Complaint complaint) {
+ try {
+ String sql = "insert into complaint(cdate,content) values(?,?)";
+ template.update(sql,complaint.getCdate(),complaint.getContent());
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/dao/impl/CourseDaoImpl.java b/src/dao/impl/CourseDaoImpl.java
new file mode 100644
index 0000000..eb2b243
--- /dev/null
+++ b/src/dao/impl/CourseDaoImpl.java
@@ -0,0 +1,44 @@
+package dao.impl;
+
+import dao.CourseDao;
+import domain.Course;
+import org.springframework.dao.DataAccessException;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
+import org.springframework.jdbc.core.JdbcTemplate;
+import utils.JDBCUtils;
+
+public class CourseDaoImpl implements CourseDao {
+ private JdbcTemplate template = new JdbcTemplate(JDBCUtils.getDataSource());
+
+ @Override
+ public void addOptionalCourse(Course c) {
+ try {
+ String sql = "insert into course values(?,?,?,?)";
+ template.update(sql,c.getC_id(),c.getC_name(),c.getT_id(),c.getC_info());
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public Course findSelectCourseByCourseId(String cid) {
+ try {
+ String sql = "select * from course where c_id = ?";
+ Course course = template.queryForObject(sql,new BeanPropertyRowMapper(Course.class),cid);
+ return course;
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ @Override
+ public void deleteServiceById(String cid) {
+ try {
+ String sql = "delete from course where c_id=?";
+ template.update(sql,cid);
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/dao/impl/NotifyDaoImpl.java b/src/dao/impl/NotifyDaoImpl.java
new file mode 100644
index 0000000..2b96348
--- /dev/null
+++ b/src/dao/impl/NotifyDaoImpl.java
@@ -0,0 +1,58 @@
+package dao.impl;
+
+import dao.NotifyDao;
+import domain.Notify;
+import org.springframework.dao.DataAccessException;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
+import org.springframework.jdbc.core.JdbcTemplate;
+import utils.JDBCUtils;
+
+import java.util.List;
+
+public class NotifyDaoImpl implements NotifyDao {
+ private JdbcTemplate template = new JdbcTemplate(JDBCUtils.getDataSource());
+
+ @Override
+ public void add(Notify notify) {
+ try {
+ String sql = "insert into notify(notifyDate,notifyInfo) values(?,?)";
+ template.update(sql,notify.getNotifyDate(),notify.getNotifyInfo());
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public List findAllNotify() {
+ try {
+ String sql = "select * from notify order by id DESC";
+ List notifys = template.query(sql, new BeanPropertyRowMapper(Notify.class));
+ return notifys;
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ @Override
+ public void deleteNotifyById(String notifyid) {
+ try {
+ String sql = "delete from notify where id=?";
+ template.update(sql,notifyid);
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public List findNotify() {
+ try {
+ String sql = "select * from notify order by id DESC limit 3";
+ List notify = template.query(sql, new BeanPropertyRowMapper(Notify.class));
+ return notify;
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+}
diff --git a/src/dao/impl/PhotoDaoImpl.java b/src/dao/impl/PhotoDaoImpl.java
new file mode 100644
index 0000000..3063863
--- /dev/null
+++ b/src/dao/impl/PhotoDaoImpl.java
@@ -0,0 +1,44 @@
+package dao.impl;
+
+import dao.PhotoDao;
+import domain.Photo;
+import org.springframework.dao.DataAccessException;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
+import org.springframework.jdbc.core.JdbcTemplate;
+import utils.JDBCUtils;
+
+public class PhotoDaoImpl implements PhotoDao {
+ private JdbcTemplate template = new JdbcTemplate(JDBCUtils.getDataSource());
+
+ @Override
+ public void addPhoto(Photo photo) {
+ try {
+ String sql = "insert into photo(photo_id,photo_name) values(?,?)";
+ template.update(sql,photo.getPhotoId(),photo.getPhotoName());
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public Photo findPhotoByPhotoId(String id) {
+ try {
+ String sql = "select * from photo where photo_id = ?";
+ Photo photo = template.queryForObject(sql,new BeanPropertyRowMapper(Photo.class),id);
+ return photo;
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ @Override
+ public void updatePhoto(Photo photo) {
+ try {
+ String sql = "update photo set photo_name=? where photo_id=?";
+ template.update(sql,photo.getPhotoName(),photo.getPhotoId());
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/dao/impl/SelectCourseDaoImpl.java b/src/dao/impl/SelectCourseDaoImpl.java
new file mode 100644
index 0000000..38a9a28
--- /dev/null
+++ b/src/dao/impl/SelectCourseDaoImpl.java
@@ -0,0 +1,53 @@
+package dao.impl;
+
+import dao.SelectCourseDao;
+import domain.SelectCourse;
+import org.springframework.dao.DataAccessException;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
+import org.springframework.jdbc.core.JdbcTemplate;
+import utils.JDBCUtils;
+
+import java.util.List;
+
+public class SelectCourseDaoImpl implements SelectCourseDao {
+ private JdbcTemplate template = new JdbcTemplate(JDBCUtils.getDataSource());
+
+ @Override
+ public List findStudentSelectedCourseByCourseId(String cid) {
+ try {
+ String sql = "select course.c_id,course.c_name,course.c_info,student.s_id,student.s_name,select_course.score\n" +
+ "from select_course,student,course\n" +
+ "where student.s_id=select_course.s_id\n" +
+ "and select_course.c_id=course.c_id\n" +
+ "and select_course.c_id=?";
+ List scs = template.query(sql, new BeanPropertyRowMapper(SelectCourse.class),cid);
+ return scs;
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ @Override
+ public SelectCourse findScoreByCourseIdAndStudentId(String cid, String sid) {
+ try {
+ String sql = "select * from select_course where c_id=? and s_id=?";
+ SelectCourse sc = template.queryForObject(sql, new BeanPropertyRowMapper(SelectCourse.class), cid, sid);
+ return sc;
+ } catch (
+ DataAccessException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ @Override
+ public void upDateScoreByCidAndSid(String cid, String sid, String sScore) {
+ try {
+ String sql = "update select_course set score = ? where c_id = ? and s_id = ?";
+ template.update(sql,sScore,cid,sid);
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/dao/impl/StudentDaoImpl.java b/src/dao/impl/StudentDaoImpl.java
new file mode 100644
index 0000000..3f5623b
--- /dev/null
+++ b/src/dao/impl/StudentDaoImpl.java
@@ -0,0 +1,233 @@
+package dao.impl;
+
+import dao.StudentDao;
+import domain.Course;
+import domain.SelectCourse;
+import domain.Student;
+import org.springframework.dao.DataAccessException;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
+import org.springframework.jdbc.core.JdbcTemplate;
+import utils.JDBCUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+public class StudentDaoImpl implements StudentDao {
+ private JdbcTemplate template = new JdbcTemplate(JDBCUtils.getDataSource());
+
+ @Override
+ public List findAll() {
+ //使用JDBC操作数据库
+ try {
+ String sql = "select * from student";
+ List students = template.query(sql, new BeanPropertyRowMapper(Student.class));
+ return students;
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ return null;
+ }
+
+ }
+
+ @Override
+ public Student findStudentidAndPassword(String id,String password) {
+ try {
+ String sql = "select * from student where s_id = ? and s_password = ?";
+ Student student = template.queryForObject(sql,new BeanPropertyRowMapper(Student.class),id,password);
+ return student;
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ @Override
+ public Student findStudentById(String id) {
+ try {
+ String sql = "select * from student where s_id = ?";
+ Student student = template.queryForObject(sql,new BeanPropertyRowMapper(Student.class),id);
+ return student;
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ @Override
+ public void addStudent(Student student) {
+ try {
+ String sql = "insert into student(s_id,s_password) values(?,?)";
+ template.update(sql,student.getS_id(),student.getS_password());
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void updateInfo(Student student) {
+ try {
+ String sql = "update student set s_name =?,s_sex=?,s_age=?,s_phone=?,s_email=?,s_address=?,s_college=?,s_department=?,s_class=? where s_id=?";
+ template.update(sql,student.getS_name(),student.getS_sex(),student.getS_age(),student.getS_phone(),student.getS_email(),student.getS_address(),student.getS_college(),student.getS_department(),student.getS_class(),student.getS_id());
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void updatePassword(String studentid, String newpassword) {
+ try {
+ String sql = "update student set s_password=? where s_id=?";
+ template.update(sql,newpassword,studentid);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public List findAllSelectCourse(String studentid) {
+ try {
+ String sql = "select student.s_id,student.s_name,course.c_id,course.c_name,course.c_info,teacher.t_id,t_name,select_course.score\n" +
+ "from select_course,student,course,teacher\n" +
+ "where student.s_id=select_course.s_id\n" +
+ "and select_course.c_id=course.c_id\n" +
+ "and course.t_id=teacher.t_id\n" +
+ "and student.s_id=?";
+ List scs = template.query(sql, new BeanPropertyRowMapper(SelectCourse.class),studentid);
+ return scs;
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ @Override
+ public List findAllOptionalCourse() {
+ try {
+ String sql = "select course.c_id,course.c_name,course.c_info,teacher.t_id,t_name\n" +
+ "from course,teacher\n" +
+ "where course.t_id=teacher.t_id";
+ List cs = template.query(sql, new BeanPropertyRowMapper(Course.class));
+ return cs;
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ @Override
+ public void addSelectCourse(String studentid, String courseid) {
+ try {
+ String sql = "insert into select_course(s_id,c_id) values(?,?)";
+ template.update(sql,studentid,courseid);
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void deleteStudentById(String studentid) {
+ try {
+ String sql = "delete from student where s_id=?";
+ template.update(sql,studentid);
+ } catch (DataAccessException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public int findTotalCount(Map condition) {
+ //定义模板初始化sql
+ String sql = "select count(*) from student where 1=1";
+ StringBuilder sb = new StringBuilder(sql);
+ //遍历map
+ Set keySet = condition.keySet();
+ //定义参数集合
+ List