├── README.md ├── college.sql ├── pom.xml └── src ├── main ├── java │ └── com │ │ └── example │ │ └── experiment2 │ │ ├── bean │ │ ├── ClassInfo.java │ │ ├── ClassInfoExample.java │ │ ├── Msg.java │ │ ├── StuCurriculum.java │ │ ├── StuCurriculumExample.java │ │ ├── Student.java │ │ ├── StudentExample.java │ │ ├── TrainingProgram.java │ │ ├── TrainingProgramExample.java │ │ ├── UStudent.java │ │ ├── UStudentExample.java │ │ ├── UTeacher.java │ │ ├── UTeacherExample.java │ │ ├── UtSecretary.java │ │ └── UtSecretaryExample.java │ │ ├── controller │ │ ├── CurriculumController.java │ │ ├── LoginController.java │ │ ├── OtherController.java │ │ └── TrainProgramController.java │ │ ├── dao │ │ ├── ClassInfoMapper.java │ │ ├── StuCurriculumMapper.java │ │ ├── StudentMapper.java │ │ ├── TrainingProgramMapper.java │ │ ├── UStudentMapper.java │ │ ├── UTeacherMapper.java │ │ └── UtSecretaryMapper.java │ │ ├── filter │ │ └── LoginFilter.java │ │ └── service │ │ ├── CurriculumService.java │ │ ├── LoginService.java │ │ ├── OtherService.java │ │ └── TrainingProgramService.java ├── resources │ ├── applicationContext.xml │ ├── dbconfig.properties │ ├── mapper │ │ ├── ClassInfoMapper.xml │ │ ├── StuCurriculumMapper.xml │ │ ├── StudentMapper.xml │ │ ├── TrainingProgramMapper.xml │ │ ├── UStudentMapper.xml │ │ ├── UTeacherMapper.xml │ │ └── UtSecretaryMapper.xml │ └── mybatis-config.xml └── webapp │ ├── WEB-INF │ ├── dispatcherServlet-servlet.xml │ ├── pages │ │ ├── login.jsp │ │ ├── sec_index.jsp │ │ ├── stu_index.jsp │ │ └── tea_index.jsp │ └── web.xml │ ├── index.jsp │ └── static │ ├── bootstrap-3.3.7-dist │ ├── css │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.css.map │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap-theme.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ └── js │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ └── npm.js │ ├── css │ ├── animate-custom.css │ ├── demo.css │ ├── my.css │ └── style.css │ ├── fonts │ ├── BebasNeue-webfont.woff │ ├── fontomas-webfont.woff │ ├── franchise-bold-webfont.woff │ └── icon.png │ ├── imgs │ └── bg.jpg │ └── js │ └── jquery-3.5.1.min.js ├── mbg.xml └── test └── java ├── MBGTest.java └── Test.java /README.md: -------------------------------------------------------------------------------- 1 | # 开发环境 2 | - 数据库:MySql 8.0.22 3 | - 服务器:apache-tomcat-9.0.41 4 | - 编译器:IntelliJ IDEA 2021.1.1 5 | - 浏览器:Chrome 6 | # 技术栈 7 | - 后端技术:java、sql、jsp 8 | - 后端框架:SSM(spring+springmvc+mybatis) 9 | - 前端技术:HTML、CSS、JavaScript、Ajax 10 | - 前端框架:bootstrap-3.3.7-dist、jquery 11 | - 项目管理工具:maven 12 | # 系统功能模块图 13 | ![image](https://user-images.githubusercontent.com/39235304/124376655-a5593400-dcda-11eb-8a60-dde2a7ebd96d.png) 14 | # 数据库表结构 15 | ![image](https://user-images.githubusercontent.com/39235304/124376666-adb16f00-dcda-11eb-9f80-706a4e11877d.png) 16 | # 项目结构 17 | ![image](https://user-images.githubusercontent.com/39235304/124376676-b99d3100-dcda-11eb-82a2-6fd8005c2a1c.png) 18 | # 系统工作流程 19 | ![image](https://user-images.githubusercontent.com/39235304/124376694-cd489780-dcda-11eb-8475-322a2acd4f50.png) 20 | # 页面截图 21 | ### 登录页(学生、老师、教秘) 22 | ![image](https://user-images.githubusercontent.com/39235304/124376741-07b23480-dcdb-11eb-8250-52fbe43a3a99.png) 23 | ### 培养方案(学生) 24 | ![image](https://user-images.githubusercontent.com/39235304/124376813-5790fb80-dcdb-11eb-9beb-4faf25e389a1.png) 25 | ### 选课管理(学生) 26 | ![image](https://user-images.githubusercontent.com/39235304/124376834-68da0800-dcdb-11eb-8eff-82f48f317e1c.png) 27 | ### 成绩查询(学生) 28 | ![image](https://user-images.githubusercontent.com/39235304/124376843-71cad980-dcdb-11eb-9840-467a115eef9f.png) 29 | ### 授课管理(老师) 30 | ![image](https://user-images.githubusercontent.com/39235304/124376852-8018f580-dcdb-11eb-99a0-bbc5ddcfc80e.png) 31 | ### 成绩管理(老师) 32 | ![image](https://user-images.githubusercontent.com/39235304/124376862-8b6c2100-dcdb-11eb-8832-ef912dd7a6cd.png) 33 | ### 已授课程(老师) 34 | ![image](https://user-images.githubusercontent.com/39235304/124376876-9a52d380-dcdb-11eb-85f1-2aca2dc84d65.png) 35 | ### 培养方案(教秘) 36 | ![image](https://user-images.githubusercontent.com/39235304/124376897-ae96d080-dcdb-11eb-8282-9dbd5a207bd3.png) 37 | ### 培养方案添加(教秘) 38 | ![image](https://user-images.githubusercontent.com/39235304/124376910-c1110a00-dcdb-11eb-919a-2d3ddf91782f.png) 39 | ### 成绩管理(教秘) 40 | - 根据学号查询 41 | ![image](https://user-images.githubusercontent.com/39235304/124376938-ebfb5e00-dcdb-11eb-9ac2-81841f2766c9.png) 42 | - 根据专业班级查询 43 | ![image](https://user-images.githubusercontent.com/39235304/124376955-fddd0100-dcdb-11eb-85f3-8b6ba2c23f6d.png) 44 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.example 8 | experiment2 9 | 1.0-SNAPSHOT 10 | experiment2 11 | war 12 | 13 | 14 | 1.8 15 | 1.8 16 | 5.7.1 17 | 18 | 19 | 20 | 21 | javax.servlet 22 | javax.servlet-api 23 | 4.0.1 24 | provided 25 | 26 | 27 | org.junit.jupiter 28 | junit-jupiter-api 29 | ${junit.version} 30 | test 31 | 32 | 33 | org.junit.jupiter 34 | junit-jupiter-engine 35 | ${junit.version} 36 | test 37 | 38 | 39 | 40 | javax.servlet 41 | jsp-api 42 | 2.0 43 | provided 44 | 45 | 46 | 47 | 48 | org.springframework 49 | spring-webmvc 50 | 5.2.14.RELEASE 51 | 52 | 53 | 54 | 55 | org.springframework 56 | spring-jdbc 57 | 5.2.14.RELEASE 58 | 59 | 60 | 61 | 62 | org.springframework 63 | spring-aspects 64 | 5.2.14.RELEASE 65 | 66 | 67 | 68 | 69 | org.springframework 70 | spring-test 71 | 5.2.14.RELEASE 72 | test 73 | 74 | 75 | 76 | 77 | 78 | com.fasterxml.jackson.core 79 | jackson-databind 80 | 2.12.3 81 | 82 | 83 | 84 | 85 | 86 | org.hibernate 87 | hibernate-validator 88 | 7.0.1.Final 89 | 90 | 91 | 92 | 93 | org.mybatis 94 | mybatis 95 | 3.5.6 96 | 97 | 98 | 99 | 100 | org.mybatis 101 | mybatis-spring 102 | 2.0.6 103 | 104 | 105 | 106 | 107 | org.mybatis.generator 108 | mybatis-generator-core 109 | 1.4.0 110 | 111 | 112 | 113 | 114 | com.github.pagehelper 115 | pagehelper 116 | 5.2.0 117 | 118 | 119 | 120 | 121 | com.alibaba 122 | druid 123 | 1.2.6 124 | 125 | 126 | 127 | 128 | mysql 129 | mysql-connector-java 130 | 8.0.24 131 | 132 | 133 | 134 | 135 | jstl 136 | jstl 137 | 1.2 138 | 139 | 140 | junit 141 | junit 142 | 4.12 143 | test 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | org.apache.maven.plugins 152 | maven-war-plugin 153 | 3.3.1 154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/bean/ClassInfo.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.bean; 2 | 3 | public class ClassInfo { 4 | private String className; 5 | 6 | private Integer studentNum; 7 | 8 | private String monitor; 9 | 10 | private String studyCommittee; 11 | 12 | private String lifeCommittee; 13 | 14 | public String getClassName() { 15 | return className; 16 | } 17 | 18 | public void setClassName(String className) { 19 | this.className = className == null ? null : className.trim(); 20 | } 21 | 22 | public Integer getStudentNum() { 23 | return studentNum; 24 | } 25 | 26 | public void setStudentNum(Integer studentNum) { 27 | this.studentNum = studentNum; 28 | } 29 | 30 | public String getMonitor() { 31 | return monitor; 32 | } 33 | 34 | public void setMonitor(String monitor) { 35 | this.monitor = monitor == null ? null : monitor.trim(); 36 | } 37 | 38 | public String getStudyCommittee() { 39 | return studyCommittee; 40 | } 41 | 42 | public void setStudyCommittee(String studyCommittee) { 43 | this.studyCommittee = studyCommittee == null ? null : studyCommittee.trim(); 44 | } 45 | 46 | public String getLifeCommittee() { 47 | return lifeCommittee; 48 | } 49 | 50 | public void setLifeCommittee(String lifeCommittee) { 51 | this.lifeCommittee = lifeCommittee == null ? null : lifeCommittee.trim(); 52 | } 53 | } -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/bean/Msg.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.bean; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | * @author wanghu 8 | * @discrption: 9 | * @create 2021-04-28 20:44 10 | */ 11 | public class Msg { 12 | 13 | private Integer code; 14 | private String msg; 15 | private Map extend = new HashMap<>(); 16 | public static Msg success(){ 17 | Msg msg = new Msg(); 18 | msg.setCode(100); 19 | msg.setMsg("处理成功"); 20 | return msg; 21 | } 22 | public static Msg fail(){ 23 | Msg msg = new Msg(); 24 | msg.setCode(200); 25 | msg.setMsg("处理失败"); 26 | return msg; 27 | } 28 | public Msg add(String key,Object value){ 29 | this.getExtend().put(key,value); 30 | return this; 31 | } 32 | 33 | public Integer getCode() { 34 | return code; 35 | } 36 | 37 | public void setCode(Integer code) { 38 | this.code = code; 39 | } 40 | 41 | public String getMsg() { 42 | return msg; 43 | } 44 | 45 | public void setMsg(String msg) { 46 | this.msg = msg; 47 | } 48 | 49 | public Map getExtend() { 50 | return extend; 51 | } 52 | 53 | public void setExtend(Map extend) { 54 | this.extend = extend; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/bean/StuCurriculum.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.bean; 2 | 3 | public class StuCurriculum { 4 | private Integer id; 5 | 6 | private Integer courseId; 7 | 8 | private String courseName; 9 | 10 | private String courseNature; 11 | 12 | private String courseSelectedId; 13 | 14 | private String courseSelectedStu; 15 | 16 | private String courseStatus; 17 | 18 | private Integer grade; 19 | 20 | public StuCurriculum() { 21 | } 22 | 23 | public StuCurriculum(Integer id, Integer courseId, String courseName, String courseNature, String courseSelectedId, String courseSelectedStu, String courseStatus, Integer grade) { 24 | this.id = id; 25 | this.courseId = courseId; 26 | this.courseName = courseName; 27 | this.courseNature = courseNature; 28 | this.courseSelectedId = courseSelectedId; 29 | this.courseSelectedStu = courseSelectedStu; 30 | this.courseStatus = courseStatus; 31 | this.grade = grade; 32 | } 33 | 34 | public Integer getId() { 35 | return id; 36 | } 37 | 38 | public void setId(Integer id) { 39 | this.id = id; 40 | } 41 | 42 | public Integer getCourseId() { 43 | return courseId; 44 | } 45 | 46 | public void setCourseId(Integer courseId) { 47 | this.courseId = courseId; 48 | } 49 | 50 | public String getCourseName() { 51 | return courseName; 52 | } 53 | 54 | public void setCourseName(String courseName) { 55 | this.courseName = courseName == null ? null : courseName.trim(); 56 | } 57 | 58 | public String getCourseNature() { 59 | return courseNature; 60 | } 61 | 62 | public void setCourseNature(String courseNature) { 63 | this.courseNature = courseNature == null ? null : courseNature.trim(); 64 | } 65 | 66 | public String getCourseSelectedId() { 67 | return courseSelectedId; 68 | } 69 | 70 | public void setCourseSelectedId(String courseSelectedId) { 71 | this.courseSelectedId = courseSelectedId == null ? null : courseSelectedId.trim(); 72 | } 73 | 74 | public String getCourseSelectedStu() { 75 | return courseSelectedStu; 76 | } 77 | 78 | public void setCourseSelectedStu(String courseSelectedStu) { 79 | this.courseSelectedStu = courseSelectedStu == null ? null : courseSelectedStu.trim(); 80 | } 81 | 82 | public String getCourseStatus() { 83 | return courseStatus; 84 | } 85 | 86 | public void setCourseStatus(String courseStatus) { 87 | this.courseStatus = courseStatus == null ? null : courseStatus.trim(); 88 | } 89 | 90 | public Integer getGrade() { 91 | return grade; 92 | } 93 | 94 | public void setGrade(Integer grade) { 95 | this.grade = grade; 96 | } 97 | 98 | @Override 99 | public String toString() { 100 | return "StuCurriculum{" + 101 | "id=" + id + 102 | ", courseId=" + courseId + 103 | ", courseName='" + courseName + '\'' + 104 | ", courseNature='" + courseNature + '\'' + 105 | ", courseSelectedId='" + courseSelectedId + '\'' + 106 | ", courseSelectedStu='" + courseSelectedStu + '\'' + 107 | ", courseStatus='" + courseStatus + '\'' + 108 | ", grade=" + grade + 109 | '}'; 110 | } 111 | } -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/bean/Student.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.bean; 2 | 3 | import java.util.Date; 4 | 5 | public class Student { 6 | private String id; 7 | 8 | private String studentName; 9 | 10 | private String idCard; 11 | 12 | private String phoneNumber; 13 | 14 | private Date startYear; 15 | 16 | private String studentSource; 17 | 18 | private String major; 19 | 20 | private String className; 21 | 22 | public String getId() { 23 | return id; 24 | } 25 | 26 | public void setId(String id) { 27 | this.id = id == null ? null : id.trim(); 28 | } 29 | 30 | public String getStudentName() { 31 | return studentName; 32 | } 33 | 34 | public void setStudentName(String studentName) { 35 | this.studentName = studentName == null ? null : studentName.trim(); 36 | } 37 | 38 | public String getIdCard() { 39 | return idCard; 40 | } 41 | 42 | public void setIdCard(String idCard) { 43 | this.idCard = idCard == null ? null : idCard.trim(); 44 | } 45 | 46 | public String getPhoneNumber() { 47 | return phoneNumber; 48 | } 49 | 50 | public void setPhoneNumber(String phoneNumber) { 51 | this.phoneNumber = phoneNumber == null ? null : phoneNumber.trim(); 52 | } 53 | 54 | public Date getStartYear() { 55 | return startYear; 56 | } 57 | 58 | public void setStartYear(Date startYear) { 59 | this.startYear = startYear; 60 | } 61 | 62 | public String getStudentSource() { 63 | return studentSource; 64 | } 65 | 66 | public void setStudentSource(String studentSource) { 67 | this.studentSource = studentSource == null ? null : studentSource.trim(); 68 | } 69 | 70 | public String getMajor() { 71 | return major; 72 | } 73 | 74 | public void setMajor(String major) { 75 | this.major = major == null ? null : major.trim(); 76 | } 77 | 78 | public String getClassName() { 79 | return className; 80 | } 81 | 82 | public void setClassName(String className) { 83 | this.className = className == null ? null : className.trim(); 84 | } 85 | } -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/bean/TrainingProgram.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.bean; 2 | 3 | public class TrainingProgram { 4 | private Integer courseId; 5 | 6 | private String courseName; 7 | 8 | private String courseNature; 9 | 10 | private String courseMajor; 11 | 12 | private String courseTeacher; 13 | 14 | private String courseAttributes; 15 | 16 | private String preliminaryCourse; 17 | 18 | private String followupCourse; 19 | 20 | public TrainingProgram() { 21 | } 22 | 23 | public TrainingProgram(Integer courseId, String courseName, String courseNature, String courseMajor, String courseTeacher, String courseAttributes, String preliminaryCourse, String followupCourse) { 24 | this.courseId = courseId; 25 | this.courseName = courseName; 26 | this.courseNature = courseNature; 27 | this.courseMajor = courseMajor; 28 | this.courseTeacher = courseTeacher; 29 | this.courseAttributes = courseAttributes; 30 | this.preliminaryCourse = preliminaryCourse; 31 | this.followupCourse = followupCourse; 32 | } 33 | 34 | public Integer getCourseId() { 35 | return courseId; 36 | } 37 | 38 | public void setCourseId(Integer courseId) { 39 | this.courseId = courseId; 40 | } 41 | 42 | public String getCourseName() { 43 | return courseName; 44 | } 45 | 46 | public void setCourseName(String courseName) { 47 | this.courseName = courseName == null ? null : courseName.trim(); 48 | } 49 | 50 | public String getCourseNature() { 51 | return courseNature; 52 | } 53 | 54 | public void setCourseNature(String courseNature) { 55 | this.courseNature = courseNature == null ? null : courseNature.trim(); 56 | } 57 | 58 | public String getCourseMajor() { 59 | return courseMajor; 60 | } 61 | 62 | public void setCourseMajor(String courseMajor) { 63 | this.courseMajor = courseMajor == null ? null : courseMajor.trim(); 64 | } 65 | 66 | public String getCourseTeacher() { 67 | return courseTeacher; 68 | } 69 | 70 | public void setCourseTeacher(String courseTeacher) { 71 | this.courseTeacher = courseTeacher == null ? null : courseTeacher.trim(); 72 | } 73 | 74 | public String getCourseAttributes() { 75 | return courseAttributes; 76 | } 77 | 78 | public void setCourseAttributes(String courseAttributes) { 79 | this.courseAttributes = courseAttributes == null ? null : courseAttributes.trim(); 80 | } 81 | 82 | public String getPreliminaryCourse() { 83 | return preliminaryCourse; 84 | } 85 | 86 | public void setPreliminaryCourse(String preliminaryCourse) { 87 | this.preliminaryCourse = preliminaryCourse == null ? null : preliminaryCourse.trim(); 88 | } 89 | 90 | public String getFollowupCourse() { 91 | return followupCourse; 92 | } 93 | 94 | public void setFollowupCourse(String followupCourse) { 95 | this.followupCourse = followupCourse == null ? null : followupCourse.trim(); 96 | } 97 | 98 | @Override 99 | public String toString() { 100 | return "TrainingProgram{" + 101 | "courseId=" + courseId + 102 | ", courseName='" + courseName + '\'' + 103 | ", courseNature='" + courseNature + '\'' + 104 | ", courseMajor='" + courseMajor + '\'' + 105 | ", courseTeacher='" + courseTeacher + '\'' + 106 | ", courseAttributes='" + courseAttributes + '\'' + 107 | ", preliminaryCourse='" + preliminaryCourse + '\'' + 108 | ", followupCourse='" + followupCourse + '\'' + 109 | '}'; 110 | } 111 | } -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/bean/UStudent.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.bean; 2 | 3 | public class UStudent { 4 | private String id; 5 | 6 | private String password; 7 | 8 | public UStudent() { 9 | } 10 | 11 | public UStudent(String id, String password) { 12 | this.id = id; 13 | this.password = password; 14 | } 15 | 16 | public String getId() { 17 | return id; 18 | } 19 | 20 | public void setId(String id) { 21 | this.id = id == null ? null : id.trim(); 22 | } 23 | 24 | public String getPassword() { 25 | return password; 26 | } 27 | 28 | public void setPassword(String password) { 29 | this.password = password == null ? null : password.trim(); 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return "UStudent{" + 35 | "id='" + id + '\'' + 36 | ", password='" + password + '\'' + 37 | '}'; 38 | } 39 | } -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/bean/UStudentExample.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.bean; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class UStudentExample { 7 | protected String orderByClause; 8 | 9 | protected boolean distinct; 10 | 11 | protected List oredCriteria; 12 | 13 | public UStudentExample() { 14 | oredCriteria = new ArrayList<>(); 15 | } 16 | 17 | public void setOrderByClause(String orderByClause) { 18 | this.orderByClause = orderByClause; 19 | } 20 | 21 | public String getOrderByClause() { 22 | return orderByClause; 23 | } 24 | 25 | public void setDistinct(boolean distinct) { 26 | this.distinct = distinct; 27 | } 28 | 29 | public boolean isDistinct() { 30 | return distinct; 31 | } 32 | 33 | public List getOredCriteria() { 34 | return oredCriteria; 35 | } 36 | 37 | public void or(Criteria criteria) { 38 | oredCriteria.add(criteria); 39 | } 40 | 41 | public Criteria or() { 42 | Criteria criteria = createCriteriaInternal(); 43 | oredCriteria.add(criteria); 44 | return criteria; 45 | } 46 | 47 | public Criteria createCriteria() { 48 | Criteria criteria = createCriteriaInternal(); 49 | if (oredCriteria.size() == 0) { 50 | oredCriteria.add(criteria); 51 | } 52 | return criteria; 53 | } 54 | 55 | protected Criteria createCriteriaInternal() { 56 | Criteria criteria = new Criteria(); 57 | return criteria; 58 | } 59 | 60 | public void clear() { 61 | oredCriteria.clear(); 62 | orderByClause = null; 63 | distinct = false; 64 | } 65 | 66 | protected abstract static class GeneratedCriteria { 67 | protected List criteria; 68 | 69 | protected GeneratedCriteria() { 70 | super(); 71 | criteria = new ArrayList<>(); 72 | } 73 | 74 | public boolean isValid() { 75 | return criteria.size() > 0; 76 | } 77 | 78 | public List getAllCriteria() { 79 | return criteria; 80 | } 81 | 82 | public List getCriteria() { 83 | return criteria; 84 | } 85 | 86 | protected void addCriterion(String condition) { 87 | if (condition == null) { 88 | throw new RuntimeException("Value for condition cannot be null"); 89 | } 90 | criteria.add(new Criterion(condition)); 91 | } 92 | 93 | protected void addCriterion(String condition, Object value, String property) { 94 | if (value == null) { 95 | throw new RuntimeException("Value for " + property + " cannot be null"); 96 | } 97 | criteria.add(new Criterion(condition, value)); 98 | } 99 | 100 | protected void addCriterion(String condition, Object value1, Object value2, String property) { 101 | if (value1 == null || value2 == null) { 102 | throw new RuntimeException("Between values for " + property + " cannot be null"); 103 | } 104 | criteria.add(new Criterion(condition, value1, value2)); 105 | } 106 | 107 | public Criteria andIdIsNull() { 108 | addCriterion("ID is null"); 109 | return (Criteria) this; 110 | } 111 | 112 | public Criteria andIdIsNotNull() { 113 | addCriterion("ID is not null"); 114 | return (Criteria) this; 115 | } 116 | 117 | public Criteria andIdEqualTo(String value) { 118 | addCriterion("ID =", value, "id"); 119 | return (Criteria) this; 120 | } 121 | 122 | public Criteria andIdNotEqualTo(String value) { 123 | addCriterion("ID <>", value, "id"); 124 | return (Criteria) this; 125 | } 126 | 127 | public Criteria andIdGreaterThan(String value) { 128 | addCriterion("ID >", value, "id"); 129 | return (Criteria) this; 130 | } 131 | 132 | public Criteria andIdGreaterThanOrEqualTo(String value) { 133 | addCriterion("ID >=", value, "id"); 134 | return (Criteria) this; 135 | } 136 | 137 | public Criteria andIdLessThan(String value) { 138 | addCriterion("ID <", value, "id"); 139 | return (Criteria) this; 140 | } 141 | 142 | public Criteria andIdLessThanOrEqualTo(String value) { 143 | addCriterion("ID <=", value, "id"); 144 | return (Criteria) this; 145 | } 146 | 147 | public Criteria andIdLike(String value) { 148 | addCriterion("ID like", value, "id"); 149 | return (Criteria) this; 150 | } 151 | 152 | public Criteria andIdNotLike(String value) { 153 | addCriterion("ID not like", value, "id"); 154 | return (Criteria) this; 155 | } 156 | 157 | public Criteria andIdIn(List values) { 158 | addCriterion("ID in", values, "id"); 159 | return (Criteria) this; 160 | } 161 | 162 | public Criteria andIdNotIn(List values) { 163 | addCriterion("ID not in", values, "id"); 164 | return (Criteria) this; 165 | } 166 | 167 | public Criteria andIdBetween(String value1, String value2) { 168 | addCriterion("ID between", value1, value2, "id"); 169 | return (Criteria) this; 170 | } 171 | 172 | public Criteria andIdNotBetween(String value1, String value2) { 173 | addCriterion("ID not between", value1, value2, "id"); 174 | return (Criteria) this; 175 | } 176 | 177 | public Criteria andPasswordIsNull() { 178 | addCriterion("password is null"); 179 | return (Criteria) this; 180 | } 181 | 182 | public Criteria andPasswordIsNotNull() { 183 | addCriterion("password is not null"); 184 | return (Criteria) this; 185 | } 186 | 187 | public Criteria andPasswordEqualTo(String value) { 188 | addCriterion("password =", value, "password"); 189 | return (Criteria) this; 190 | } 191 | 192 | public Criteria andPasswordNotEqualTo(String value) { 193 | addCriterion("password <>", value, "password"); 194 | return (Criteria) this; 195 | } 196 | 197 | public Criteria andPasswordGreaterThan(String value) { 198 | addCriterion("password >", value, "password"); 199 | return (Criteria) this; 200 | } 201 | 202 | public Criteria andPasswordGreaterThanOrEqualTo(String value) { 203 | addCriterion("password >=", value, "password"); 204 | return (Criteria) this; 205 | } 206 | 207 | public Criteria andPasswordLessThan(String value) { 208 | addCriterion("password <", value, "password"); 209 | return (Criteria) this; 210 | } 211 | 212 | public Criteria andPasswordLessThanOrEqualTo(String value) { 213 | addCriterion("password <=", value, "password"); 214 | return (Criteria) this; 215 | } 216 | 217 | public Criteria andPasswordLike(String value) { 218 | addCriterion("password like", value, "password"); 219 | return (Criteria) this; 220 | } 221 | 222 | public Criteria andPasswordNotLike(String value) { 223 | addCriterion("password not like", value, "password"); 224 | return (Criteria) this; 225 | } 226 | 227 | public Criteria andPasswordIn(List values) { 228 | addCriterion("password in", values, "password"); 229 | return (Criteria) this; 230 | } 231 | 232 | public Criteria andPasswordNotIn(List values) { 233 | addCriterion("password not in", values, "password"); 234 | return (Criteria) this; 235 | } 236 | 237 | public Criteria andPasswordBetween(String value1, String value2) { 238 | addCriterion("password between", value1, value2, "password"); 239 | return (Criteria) this; 240 | } 241 | 242 | public Criteria andPasswordNotBetween(String value1, String value2) { 243 | addCriterion("password not between", value1, value2, "password"); 244 | return (Criteria) this; 245 | } 246 | } 247 | 248 | public static class Criteria extends GeneratedCriteria { 249 | protected Criteria() { 250 | super(); 251 | } 252 | } 253 | 254 | public static class Criterion { 255 | private String condition; 256 | 257 | private Object value; 258 | 259 | private Object secondValue; 260 | 261 | private boolean noValue; 262 | 263 | private boolean singleValue; 264 | 265 | private boolean betweenValue; 266 | 267 | private boolean listValue; 268 | 269 | private String typeHandler; 270 | 271 | public String getCondition() { 272 | return condition; 273 | } 274 | 275 | public Object getValue() { 276 | return value; 277 | } 278 | 279 | public Object getSecondValue() { 280 | return secondValue; 281 | } 282 | 283 | public boolean isNoValue() { 284 | return noValue; 285 | } 286 | 287 | public boolean isSingleValue() { 288 | return singleValue; 289 | } 290 | 291 | public boolean isBetweenValue() { 292 | return betweenValue; 293 | } 294 | 295 | public boolean isListValue() { 296 | return listValue; 297 | } 298 | 299 | public String getTypeHandler() { 300 | return typeHandler; 301 | } 302 | 303 | protected Criterion(String condition) { 304 | super(); 305 | this.condition = condition; 306 | this.typeHandler = null; 307 | this.noValue = true; 308 | } 309 | 310 | protected Criterion(String condition, Object value, String typeHandler) { 311 | super(); 312 | this.condition = condition; 313 | this.value = value; 314 | this.typeHandler = typeHandler; 315 | if (value instanceof List) { 316 | this.listValue = true; 317 | } else { 318 | this.singleValue = true; 319 | } 320 | } 321 | 322 | protected Criterion(String condition, Object value) { 323 | this(condition, value, null); 324 | } 325 | 326 | protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { 327 | super(); 328 | this.condition = condition; 329 | this.value = value; 330 | this.secondValue = secondValue; 331 | this.typeHandler = typeHandler; 332 | this.betweenValue = true; 333 | } 334 | 335 | protected Criterion(String condition, Object value, Object secondValue) { 336 | this(condition, value, secondValue, null); 337 | } 338 | } 339 | } -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/bean/UTeacher.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.bean; 2 | 3 | public class UTeacher { 4 | private String id; 5 | 6 | private String username; 7 | 8 | private String password; 9 | 10 | public String getId() { 11 | return id; 12 | } 13 | 14 | public void setId(String id) { 15 | this.id = id == null ? null : id.trim(); 16 | } 17 | 18 | public String getUsername() { 19 | return username; 20 | } 21 | 22 | public void setUsername(String username) { 23 | this.username = username == null ? null : username.trim(); 24 | } 25 | 26 | public String getPassword() { 27 | return password; 28 | } 29 | 30 | public void setPassword(String password) { 31 | this.password = password == null ? null : password.trim(); 32 | } 33 | 34 | @Override 35 | public String toString() { 36 | return "UTeacher{" + 37 | "id='" + id + '\'' + 38 | ", username='" + username + '\'' + 39 | ", password='" + password + '\'' + 40 | '}'; 41 | } 42 | } -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/bean/UTeacherExample.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.bean; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class UTeacherExample { 7 | protected String orderByClause; 8 | 9 | protected boolean distinct; 10 | 11 | protected List oredCriteria; 12 | 13 | public UTeacherExample() { 14 | oredCriteria = new ArrayList<>(); 15 | } 16 | 17 | public void setOrderByClause(String orderByClause) { 18 | this.orderByClause = orderByClause; 19 | } 20 | 21 | public String getOrderByClause() { 22 | return orderByClause; 23 | } 24 | 25 | public void setDistinct(boolean distinct) { 26 | this.distinct = distinct; 27 | } 28 | 29 | public boolean isDistinct() { 30 | return distinct; 31 | } 32 | 33 | public List getOredCriteria() { 34 | return oredCriteria; 35 | } 36 | 37 | public void or(Criteria criteria) { 38 | oredCriteria.add(criteria); 39 | } 40 | 41 | public Criteria or() { 42 | Criteria criteria = createCriteriaInternal(); 43 | oredCriteria.add(criteria); 44 | return criteria; 45 | } 46 | 47 | public Criteria createCriteria() { 48 | Criteria criteria = createCriteriaInternal(); 49 | if (oredCriteria.size() == 0) { 50 | oredCriteria.add(criteria); 51 | } 52 | return criteria; 53 | } 54 | 55 | protected Criteria createCriteriaInternal() { 56 | Criteria criteria = new Criteria(); 57 | return criteria; 58 | } 59 | 60 | public void clear() { 61 | oredCriteria.clear(); 62 | orderByClause = null; 63 | distinct = false; 64 | } 65 | 66 | protected abstract static class GeneratedCriteria { 67 | protected List criteria; 68 | 69 | protected GeneratedCriteria() { 70 | super(); 71 | criteria = new ArrayList<>(); 72 | } 73 | 74 | public boolean isValid() { 75 | return criteria.size() > 0; 76 | } 77 | 78 | public List getAllCriteria() { 79 | return criteria; 80 | } 81 | 82 | public List getCriteria() { 83 | return criteria; 84 | } 85 | 86 | protected void addCriterion(String condition) { 87 | if (condition == null) { 88 | throw new RuntimeException("Value for condition cannot be null"); 89 | } 90 | criteria.add(new Criterion(condition)); 91 | } 92 | 93 | protected void addCriterion(String condition, Object value, String property) { 94 | if (value == null) { 95 | throw new RuntimeException("Value for " + property + " cannot be null"); 96 | } 97 | criteria.add(new Criterion(condition, value)); 98 | } 99 | 100 | protected void addCriterion(String condition, Object value1, Object value2, String property) { 101 | if (value1 == null || value2 == null) { 102 | throw new RuntimeException("Between values for " + property + " cannot be null"); 103 | } 104 | criteria.add(new Criterion(condition, value1, value2)); 105 | } 106 | 107 | public Criteria andIdIsNull() { 108 | addCriterion("ID is null"); 109 | return (Criteria) this; 110 | } 111 | 112 | public Criteria andIdIsNotNull() { 113 | addCriterion("ID is not null"); 114 | return (Criteria) this; 115 | } 116 | 117 | public Criteria andIdEqualTo(String value) { 118 | addCriterion("ID =", value, "id"); 119 | return (Criteria) this; 120 | } 121 | 122 | public Criteria andIdNotEqualTo(String value) { 123 | addCriterion("ID <>", value, "id"); 124 | return (Criteria) this; 125 | } 126 | 127 | public Criteria andIdGreaterThan(String value) { 128 | addCriterion("ID >", value, "id"); 129 | return (Criteria) this; 130 | } 131 | 132 | public Criteria andIdGreaterThanOrEqualTo(String value) { 133 | addCriterion("ID >=", value, "id"); 134 | return (Criteria) this; 135 | } 136 | 137 | public Criteria andIdLessThan(String value) { 138 | addCriterion("ID <", value, "id"); 139 | return (Criteria) this; 140 | } 141 | 142 | public Criteria andIdLessThanOrEqualTo(String value) { 143 | addCriterion("ID <=", value, "id"); 144 | return (Criteria) this; 145 | } 146 | 147 | public Criteria andIdLike(String value) { 148 | addCriterion("ID like", value, "id"); 149 | return (Criteria) this; 150 | } 151 | 152 | public Criteria andIdNotLike(String value) { 153 | addCriterion("ID not like", value, "id"); 154 | return (Criteria) this; 155 | } 156 | 157 | public Criteria andIdIn(List values) { 158 | addCriterion("ID in", values, "id"); 159 | return (Criteria) this; 160 | } 161 | 162 | public Criteria andIdNotIn(List values) { 163 | addCriterion("ID not in", values, "id"); 164 | return (Criteria) this; 165 | } 166 | 167 | public Criteria andIdBetween(String value1, String value2) { 168 | addCriterion("ID between", value1, value2, "id"); 169 | return (Criteria) this; 170 | } 171 | 172 | public Criteria andIdNotBetween(String value1, String value2) { 173 | addCriterion("ID not between", value1, value2, "id"); 174 | return (Criteria) this; 175 | } 176 | 177 | public Criteria andUsernameIsNull() { 178 | addCriterion("username is null"); 179 | return (Criteria) this; 180 | } 181 | 182 | public Criteria andUsernameIsNotNull() { 183 | addCriterion("username is not null"); 184 | return (Criteria) this; 185 | } 186 | 187 | public Criteria andUsernameEqualTo(String value) { 188 | addCriterion("username =", value, "username"); 189 | return (Criteria) this; 190 | } 191 | 192 | public Criteria andUsernameNotEqualTo(String value) { 193 | addCriterion("username <>", value, "username"); 194 | return (Criteria) this; 195 | } 196 | 197 | public Criteria andUsernameGreaterThan(String value) { 198 | addCriterion("username >", value, "username"); 199 | return (Criteria) this; 200 | } 201 | 202 | public Criteria andUsernameGreaterThanOrEqualTo(String value) { 203 | addCriterion("username >=", value, "username"); 204 | return (Criteria) this; 205 | } 206 | 207 | public Criteria andUsernameLessThan(String value) { 208 | addCriterion("username <", value, "username"); 209 | return (Criteria) this; 210 | } 211 | 212 | public Criteria andUsernameLessThanOrEqualTo(String value) { 213 | addCriterion("username <=", value, "username"); 214 | return (Criteria) this; 215 | } 216 | 217 | public Criteria andUsernameLike(String value) { 218 | addCriterion("username like", value, "username"); 219 | return (Criteria) this; 220 | } 221 | 222 | public Criteria andUsernameNotLike(String value) { 223 | addCriterion("username not like", value, "username"); 224 | return (Criteria) this; 225 | } 226 | 227 | public Criteria andUsernameIn(List values) { 228 | addCriterion("username in", values, "username"); 229 | return (Criteria) this; 230 | } 231 | 232 | public Criteria andUsernameNotIn(List values) { 233 | addCriterion("username not in", values, "username"); 234 | return (Criteria) this; 235 | } 236 | 237 | public Criteria andUsernameBetween(String value1, String value2) { 238 | addCriterion("username between", value1, value2, "username"); 239 | return (Criteria) this; 240 | } 241 | 242 | public Criteria andUsernameNotBetween(String value1, String value2) { 243 | addCriterion("username not between", value1, value2, "username"); 244 | return (Criteria) this; 245 | } 246 | 247 | public Criteria andPasswordIsNull() { 248 | addCriterion("password is null"); 249 | return (Criteria) this; 250 | } 251 | 252 | public Criteria andPasswordIsNotNull() { 253 | addCriterion("password is not null"); 254 | return (Criteria) this; 255 | } 256 | 257 | public Criteria andPasswordEqualTo(String value) { 258 | addCriterion("password =", value, "password"); 259 | return (Criteria) this; 260 | } 261 | 262 | public Criteria andPasswordNotEqualTo(String value) { 263 | addCriterion("password <>", value, "password"); 264 | return (Criteria) this; 265 | } 266 | 267 | public Criteria andPasswordGreaterThan(String value) { 268 | addCriterion("password >", value, "password"); 269 | return (Criteria) this; 270 | } 271 | 272 | public Criteria andPasswordGreaterThanOrEqualTo(String value) { 273 | addCriterion("password >=", value, "password"); 274 | return (Criteria) this; 275 | } 276 | 277 | public Criteria andPasswordLessThan(String value) { 278 | addCriterion("password <", value, "password"); 279 | return (Criteria) this; 280 | } 281 | 282 | public Criteria andPasswordLessThanOrEqualTo(String value) { 283 | addCriterion("password <=", value, "password"); 284 | return (Criteria) this; 285 | } 286 | 287 | public Criteria andPasswordLike(String value) { 288 | addCriterion("password like", value, "password"); 289 | return (Criteria) this; 290 | } 291 | 292 | public Criteria andPasswordNotLike(String value) { 293 | addCriterion("password not like", value, "password"); 294 | return (Criteria) this; 295 | } 296 | 297 | public Criteria andPasswordIn(List values) { 298 | addCriterion("password in", values, "password"); 299 | return (Criteria) this; 300 | } 301 | 302 | public Criteria andPasswordNotIn(List values) { 303 | addCriterion("password not in", values, "password"); 304 | return (Criteria) this; 305 | } 306 | 307 | public Criteria andPasswordBetween(String value1, String value2) { 308 | addCriterion("password between", value1, value2, "password"); 309 | return (Criteria) this; 310 | } 311 | 312 | public Criteria andPasswordNotBetween(String value1, String value2) { 313 | addCriterion("password not between", value1, value2, "password"); 314 | return (Criteria) this; 315 | } 316 | } 317 | 318 | public static class Criteria extends GeneratedCriteria { 319 | protected Criteria() { 320 | super(); 321 | } 322 | } 323 | 324 | public static class Criterion { 325 | private String condition; 326 | 327 | private Object value; 328 | 329 | private Object secondValue; 330 | 331 | private boolean noValue; 332 | 333 | private boolean singleValue; 334 | 335 | private boolean betweenValue; 336 | 337 | private boolean listValue; 338 | 339 | private String typeHandler; 340 | 341 | public String getCondition() { 342 | return condition; 343 | } 344 | 345 | public Object getValue() { 346 | return value; 347 | } 348 | 349 | public Object getSecondValue() { 350 | return secondValue; 351 | } 352 | 353 | public boolean isNoValue() { 354 | return noValue; 355 | } 356 | 357 | public boolean isSingleValue() { 358 | return singleValue; 359 | } 360 | 361 | public boolean isBetweenValue() { 362 | return betweenValue; 363 | } 364 | 365 | public boolean isListValue() { 366 | return listValue; 367 | } 368 | 369 | public String getTypeHandler() { 370 | return typeHandler; 371 | } 372 | 373 | protected Criterion(String condition) { 374 | super(); 375 | this.condition = condition; 376 | this.typeHandler = null; 377 | this.noValue = true; 378 | } 379 | 380 | protected Criterion(String condition, Object value, String typeHandler) { 381 | super(); 382 | this.condition = condition; 383 | this.value = value; 384 | this.typeHandler = typeHandler; 385 | if (value instanceof List) { 386 | this.listValue = true; 387 | } else { 388 | this.singleValue = true; 389 | } 390 | } 391 | 392 | protected Criterion(String condition, Object value) { 393 | this(condition, value, null); 394 | } 395 | 396 | protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { 397 | super(); 398 | this.condition = condition; 399 | this.value = value; 400 | this.secondValue = secondValue; 401 | this.typeHandler = typeHandler; 402 | this.betweenValue = true; 403 | } 404 | 405 | protected Criterion(String condition, Object value, Object secondValue) { 406 | this(condition, value, secondValue, null); 407 | } 408 | } 409 | } -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/bean/UtSecretary.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.bean; 2 | 3 | public class UtSecretary { 4 | private String id; 5 | 6 | private String username; 7 | 8 | private String password; 9 | 10 | public String getId() { 11 | return id; 12 | } 13 | 14 | public void setId(String id) { 15 | this.id = id == null ? null : id.trim(); 16 | } 17 | 18 | public String getUsername() { 19 | return username; 20 | } 21 | 22 | public void setUsername(String username) { 23 | this.username = username == null ? null : username.trim(); 24 | } 25 | 26 | public String getPassword() { 27 | return password; 28 | } 29 | 30 | public void setPassword(String password) { 31 | this.password = password == null ? null : password.trim(); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/bean/UtSecretaryExample.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.bean; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class UtSecretaryExample { 7 | protected String orderByClause; 8 | 9 | protected boolean distinct; 10 | 11 | protected List oredCriteria; 12 | 13 | public UtSecretaryExample() { 14 | oredCriteria = new ArrayList<>(); 15 | } 16 | 17 | public void setOrderByClause(String orderByClause) { 18 | this.orderByClause = orderByClause; 19 | } 20 | 21 | public String getOrderByClause() { 22 | return orderByClause; 23 | } 24 | 25 | public void setDistinct(boolean distinct) { 26 | this.distinct = distinct; 27 | } 28 | 29 | public boolean isDistinct() { 30 | return distinct; 31 | } 32 | 33 | public List getOredCriteria() { 34 | return oredCriteria; 35 | } 36 | 37 | public void or(Criteria criteria) { 38 | oredCriteria.add(criteria); 39 | } 40 | 41 | public Criteria or() { 42 | Criteria criteria = createCriteriaInternal(); 43 | oredCriteria.add(criteria); 44 | return criteria; 45 | } 46 | 47 | public Criteria createCriteria() { 48 | Criteria criteria = createCriteriaInternal(); 49 | if (oredCriteria.size() == 0) { 50 | oredCriteria.add(criteria); 51 | } 52 | return criteria; 53 | } 54 | 55 | protected Criteria createCriteriaInternal() { 56 | Criteria criteria = new Criteria(); 57 | return criteria; 58 | } 59 | 60 | public void clear() { 61 | oredCriteria.clear(); 62 | orderByClause = null; 63 | distinct = false; 64 | } 65 | 66 | protected abstract static class GeneratedCriteria { 67 | protected List criteria; 68 | 69 | protected GeneratedCriteria() { 70 | super(); 71 | criteria = new ArrayList<>(); 72 | } 73 | 74 | public boolean isValid() { 75 | return criteria.size() > 0; 76 | } 77 | 78 | public List getAllCriteria() { 79 | return criteria; 80 | } 81 | 82 | public List getCriteria() { 83 | return criteria; 84 | } 85 | 86 | protected void addCriterion(String condition) { 87 | if (condition == null) { 88 | throw new RuntimeException("Value for condition cannot be null"); 89 | } 90 | criteria.add(new Criterion(condition)); 91 | } 92 | 93 | protected void addCriterion(String condition, Object value, String property) { 94 | if (value == null) { 95 | throw new RuntimeException("Value for " + property + " cannot be null"); 96 | } 97 | criteria.add(new Criterion(condition, value)); 98 | } 99 | 100 | protected void addCriterion(String condition, Object value1, Object value2, String property) { 101 | if (value1 == null || value2 == null) { 102 | throw new RuntimeException("Between values for " + property + " cannot be null"); 103 | } 104 | criteria.add(new Criterion(condition, value1, value2)); 105 | } 106 | 107 | public Criteria andIdIsNull() { 108 | addCriterion("ID is null"); 109 | return (Criteria) this; 110 | } 111 | 112 | public Criteria andIdIsNotNull() { 113 | addCriterion("ID is not null"); 114 | return (Criteria) this; 115 | } 116 | 117 | public Criteria andIdEqualTo(String value) { 118 | addCriterion("ID =", value, "id"); 119 | return (Criteria) this; 120 | } 121 | 122 | public Criteria andIdNotEqualTo(String value) { 123 | addCriterion("ID <>", value, "id"); 124 | return (Criteria) this; 125 | } 126 | 127 | public Criteria andIdGreaterThan(String value) { 128 | addCriterion("ID >", value, "id"); 129 | return (Criteria) this; 130 | } 131 | 132 | public Criteria andIdGreaterThanOrEqualTo(String value) { 133 | addCriterion("ID >=", value, "id"); 134 | return (Criteria) this; 135 | } 136 | 137 | public Criteria andIdLessThan(String value) { 138 | addCriterion("ID <", value, "id"); 139 | return (Criteria) this; 140 | } 141 | 142 | public Criteria andIdLessThanOrEqualTo(String value) { 143 | addCriterion("ID <=", value, "id"); 144 | return (Criteria) this; 145 | } 146 | 147 | public Criteria andIdLike(String value) { 148 | addCriterion("ID like", value, "id"); 149 | return (Criteria) this; 150 | } 151 | 152 | public Criteria andIdNotLike(String value) { 153 | addCriterion("ID not like", value, "id"); 154 | return (Criteria) this; 155 | } 156 | 157 | public Criteria andIdIn(List values) { 158 | addCriterion("ID in", values, "id"); 159 | return (Criteria) this; 160 | } 161 | 162 | public Criteria andIdNotIn(List values) { 163 | addCriterion("ID not in", values, "id"); 164 | return (Criteria) this; 165 | } 166 | 167 | public Criteria andIdBetween(String value1, String value2) { 168 | addCriterion("ID between", value1, value2, "id"); 169 | return (Criteria) this; 170 | } 171 | 172 | public Criteria andIdNotBetween(String value1, String value2) { 173 | addCriterion("ID not between", value1, value2, "id"); 174 | return (Criteria) this; 175 | } 176 | 177 | public Criteria andUsernameIsNull() { 178 | addCriterion("username is null"); 179 | return (Criteria) this; 180 | } 181 | 182 | public Criteria andUsernameIsNotNull() { 183 | addCriterion("username is not null"); 184 | return (Criteria) this; 185 | } 186 | 187 | public Criteria andUsernameEqualTo(String value) { 188 | addCriterion("username =", value, "username"); 189 | return (Criteria) this; 190 | } 191 | 192 | public Criteria andUsernameNotEqualTo(String value) { 193 | addCriterion("username <>", value, "username"); 194 | return (Criteria) this; 195 | } 196 | 197 | public Criteria andUsernameGreaterThan(String value) { 198 | addCriterion("username >", value, "username"); 199 | return (Criteria) this; 200 | } 201 | 202 | public Criteria andUsernameGreaterThanOrEqualTo(String value) { 203 | addCriterion("username >=", value, "username"); 204 | return (Criteria) this; 205 | } 206 | 207 | public Criteria andUsernameLessThan(String value) { 208 | addCriterion("username <", value, "username"); 209 | return (Criteria) this; 210 | } 211 | 212 | public Criteria andUsernameLessThanOrEqualTo(String value) { 213 | addCriterion("username <=", value, "username"); 214 | return (Criteria) this; 215 | } 216 | 217 | public Criteria andUsernameLike(String value) { 218 | addCriterion("username like", value, "username"); 219 | return (Criteria) this; 220 | } 221 | 222 | public Criteria andUsernameNotLike(String value) { 223 | addCriterion("username not like", value, "username"); 224 | return (Criteria) this; 225 | } 226 | 227 | public Criteria andUsernameIn(List values) { 228 | addCriterion("username in", values, "username"); 229 | return (Criteria) this; 230 | } 231 | 232 | public Criteria andUsernameNotIn(List values) { 233 | addCriterion("username not in", values, "username"); 234 | return (Criteria) this; 235 | } 236 | 237 | public Criteria andUsernameBetween(String value1, String value2) { 238 | addCriterion("username between", value1, value2, "username"); 239 | return (Criteria) this; 240 | } 241 | 242 | public Criteria andUsernameNotBetween(String value1, String value2) { 243 | addCriterion("username not between", value1, value2, "username"); 244 | return (Criteria) this; 245 | } 246 | 247 | public Criteria andPasswordIsNull() { 248 | addCriterion("password is null"); 249 | return (Criteria) this; 250 | } 251 | 252 | public Criteria andPasswordIsNotNull() { 253 | addCriterion("password is not null"); 254 | return (Criteria) this; 255 | } 256 | 257 | public Criteria andPasswordEqualTo(String value) { 258 | addCriterion("password =", value, "password"); 259 | return (Criteria) this; 260 | } 261 | 262 | public Criteria andPasswordNotEqualTo(String value) { 263 | addCriterion("password <>", value, "password"); 264 | return (Criteria) this; 265 | } 266 | 267 | public Criteria andPasswordGreaterThan(String value) { 268 | addCriterion("password >", value, "password"); 269 | return (Criteria) this; 270 | } 271 | 272 | public Criteria andPasswordGreaterThanOrEqualTo(String value) { 273 | addCriterion("password >=", value, "password"); 274 | return (Criteria) this; 275 | } 276 | 277 | public Criteria andPasswordLessThan(String value) { 278 | addCriterion("password <", value, "password"); 279 | return (Criteria) this; 280 | } 281 | 282 | public Criteria andPasswordLessThanOrEqualTo(String value) { 283 | addCriterion("password <=", value, "password"); 284 | return (Criteria) this; 285 | } 286 | 287 | public Criteria andPasswordLike(String value) { 288 | addCriterion("password like", value, "password"); 289 | return (Criteria) this; 290 | } 291 | 292 | public Criteria andPasswordNotLike(String value) { 293 | addCriterion("password not like", value, "password"); 294 | return (Criteria) this; 295 | } 296 | 297 | public Criteria andPasswordIn(List values) { 298 | addCriterion("password in", values, "password"); 299 | return (Criteria) this; 300 | } 301 | 302 | public Criteria andPasswordNotIn(List values) { 303 | addCriterion("password not in", values, "password"); 304 | return (Criteria) this; 305 | } 306 | 307 | public Criteria andPasswordBetween(String value1, String value2) { 308 | addCriterion("password between", value1, value2, "password"); 309 | return (Criteria) this; 310 | } 311 | 312 | public Criteria andPasswordNotBetween(String value1, String value2) { 313 | addCriterion("password not between", value1, value2, "password"); 314 | return (Criteria) this; 315 | } 316 | } 317 | 318 | public static class Criteria extends GeneratedCriteria { 319 | protected Criteria() { 320 | super(); 321 | } 322 | } 323 | 324 | public static class Criterion { 325 | private String condition; 326 | 327 | private Object value; 328 | 329 | private Object secondValue; 330 | 331 | private boolean noValue; 332 | 333 | private boolean singleValue; 334 | 335 | private boolean betweenValue; 336 | 337 | private boolean listValue; 338 | 339 | private String typeHandler; 340 | 341 | public String getCondition() { 342 | return condition; 343 | } 344 | 345 | public Object getValue() { 346 | return value; 347 | } 348 | 349 | public Object getSecondValue() { 350 | return secondValue; 351 | } 352 | 353 | public boolean isNoValue() { 354 | return noValue; 355 | } 356 | 357 | public boolean isSingleValue() { 358 | return singleValue; 359 | } 360 | 361 | public boolean isBetweenValue() { 362 | return betweenValue; 363 | } 364 | 365 | public boolean isListValue() { 366 | return listValue; 367 | } 368 | 369 | public String getTypeHandler() { 370 | return typeHandler; 371 | } 372 | 373 | protected Criterion(String condition) { 374 | super(); 375 | this.condition = condition; 376 | this.typeHandler = null; 377 | this.noValue = true; 378 | } 379 | 380 | protected Criterion(String condition, Object value, String typeHandler) { 381 | super(); 382 | this.condition = condition; 383 | this.value = value; 384 | this.typeHandler = typeHandler; 385 | if (value instanceof List) { 386 | this.listValue = true; 387 | } else { 388 | this.singleValue = true; 389 | } 390 | } 391 | 392 | protected Criterion(String condition, Object value) { 393 | this(condition, value, null); 394 | } 395 | 396 | protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { 397 | super(); 398 | this.condition = condition; 399 | this.value = value; 400 | this.secondValue = secondValue; 401 | this.typeHandler = typeHandler; 402 | this.betweenValue = true; 403 | } 404 | 405 | protected Criterion(String condition, Object value, Object secondValue) { 406 | this(condition, value, secondValue, null); 407 | } 408 | } 409 | } -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/controller/CurriculumController.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.controller; 2 | 3 | import com.example.experiment2.bean.Msg; 4 | import com.example.experiment2.bean.StuCurriculum; 5 | import com.example.experiment2.service.CurriculumService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.web.bind.annotation.*; 9 | 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | 13 | /** 14 | * @author wanghu 15 | * @discrption: 16 | * @create 2021-05-09 14:37 17 | */ 18 | @Controller 19 | public class CurriculumController { 20 | 21 | @Autowired 22 | private CurriculumService curriculumService; 23 | 24 | //获取所有已选课程(学生) 25 | @ResponseBody 26 | @RequestMapping(value = "/courses/{ID}", method = RequestMethod.GET) 27 | public Msg getAllSelectedCourseById(@PathVariable("ID") String ID) { 28 | List allSelectedCourse = curriculumService.getAllSelectedCourseById(ID); 29 | return Msg.success().add("courses", allSelectedCourse); 30 | } 31 | 32 | //获取必修课程(学生) 33 | @ResponseBody 34 | @RequestMapping(value = "/compulsory/{ID}", method = RequestMethod.GET) 35 | public Msg getCompulsoryCourseById(@PathVariable("ID") String ID) { 36 | List compulsoryCourse = curriculumService.getCompulsoryCourseById(ID); 37 | return Msg.success().add("courses", compulsoryCourse); 38 | } 39 | 40 | //获取选修课程(学生) 41 | @ResponseBody 42 | @RequestMapping(value = "/elective/{ID}", method = RequestMethod.GET) 43 | public Msg getElectiveCourseById(@PathVariable("ID") String ID) { 44 | List electiveCourse = curriculumService.getElectiveCourseById(ID); 45 | return Msg.success().add("courses", electiveCourse); 46 | } 47 | 48 | //获取已修课程(学生) 49 | @ResponseBody 50 | @RequestMapping(value = "/learned/{ID}", method = RequestMethod.GET) 51 | public Msg getLearnedCourseById(@PathVariable("ID") String ID) { 52 | List learnedCourse = curriculumService.getLearnedCourseById(ID); 53 | return Msg.success().add("courses", learnedCourse); 54 | } 55 | 56 | //获取未修课程(学生) 57 | @ResponseBody 58 | @RequestMapping(value = "/notlearned/{ID}", method = RequestMethod.GET) 59 | public Msg getNotLearnedCourseById(@PathVariable("ID") String ID) { 60 | List notLearnedCourse = curriculumService.getNotLearnedCourseById(ID); 61 | return Msg.success().add("courses", notLearnedCourse); 62 | } 63 | 64 | //获取有成绩的课程(学生) 65 | @ResponseBody 66 | @RequestMapping(value = "/grade/{ID}", method = RequestMethod.GET) 67 | public Msg getGradeById(@PathVariable("ID") String ID) { 68 | List grade = curriculumService.getGradeById(ID); 69 | return Msg.success().add("grade", grade); 70 | } 71 | 72 | //删除课程(学生) 73 | @ResponseBody 74 | @RequestMapping(value = "/deleteCourse/{id}", method = RequestMethod.DELETE) 75 | public Msg deleteSelectedCourseById(@PathVariable("id") Integer id) { 76 | curriculumService.deleteSelectedCourseById(id); 77 | return Msg.success(); 78 | } 79 | 80 | //获取未授课程名和已售课程名(未打成绩)(教师) 81 | @ResponseBody 82 | @RequestMapping(value = "/unTeachedCourses/{courseNames}", method = RequestMethod.GET) 83 | public Msg getCourseNames(@PathVariable("courseNames") String allCourses) { 84 | List unTeachedCourseNames = new ArrayList<>(); 85 | List teachedCourseNames = new ArrayList<>(); 86 | String[] allCourseNames = allCourses.split("-"); 87 | for (Integer i = 0; i < allCourseNames.length; i++) { 88 | boolean b = curriculumService.isUnTeachedCourse(allCourseNames[i]); 89 | boolean b1 = curriculumService.isTeachedCourse(allCourseNames[i]); 90 | if (b) { 91 | unTeachedCourseNames.add(allCourseNames[i]); 92 | } else if (b1) { 93 | teachedCourseNames.add(allCourseNames[i]); 94 | } 95 | } 96 | return Msg.success().add("unTeachedCourseNames", unTeachedCourseNames).add("teachedCourseNames", teachedCourseNames); 97 | } 98 | 99 | //获取指定课程列表(教师/教秘) 100 | @ResponseBody 101 | @RequestMapping(value = "/course/{courseName}", method = RequestMethod.GET) 102 | public Msg getCourseByCourseName(@PathVariable("courseName") String courseName) { 103 | List courseList = curriculumService.getCourseByCourseName(courseName); 104 | return Msg.success().add("courseList", courseList); 105 | } 106 | 107 | //更新课程成绩或课程状态(教师/教秘) 108 | @ResponseBody 109 | @RequestMapping(value = "/updateGrade/{updateGradeData}", method = RequestMethod.PUT) 110 | public Msg updateGrade(@PathVariable("updateGradeData") String updateGradeData) { 111 | String[] strings = updateGradeData.split("-"); 112 | StuCurriculum curriculum; 113 | if (strings.length == 3) { 114 | if (strings[2].equals("未修") || strings[2].equals("已修")) { 115 | curriculum = new StuCurriculum(null, null, strings[0], null, strings[1], null, strings[2], null); 116 | } else { 117 | Integer grade = Integer.parseInt(strings[2]); 118 | curriculum = new StuCurriculum(null, null, strings[0], null, strings[1], null, null, grade); 119 | } 120 | curriculumService.updateGradeByCourseNameAndStuId(curriculum); 121 | } else if (strings.length == 4) { 122 | if (strings[3].equals("00")) { 123 | curriculumService.updateCourseGradeIsNull(strings[0], strings[1]); 124 | } else { 125 | Integer grade = Integer.parseInt(strings[3]); 126 | curriculum = new StuCurriculum(null, null, strings[0], null, strings[1], null, strings[2], grade); 127 | curriculumService.updateGradeByCourseNameAndStuId(curriculum); 128 | } 129 | } 130 | return Msg.success(); 131 | } 132 | 133 | //更新课程为已修(教师) 134 | @ResponseBody 135 | @RequestMapping(value = "/updateCourseStatus/{courseName}", method = RequestMethod.PUT) 136 | public Msg updateCourseStatusByCourseName(@PathVariable("courseName") String courseName) { 137 | curriculumService.updateCourseStatusByCourseName(courseName); 138 | return Msg.success(); 139 | } 140 | 141 | //获取按成绩排序后指定课程(教师/教秘) 142 | @ResponseBody 143 | @RequestMapping(value = "/sortCourse/{courseName}", method = RequestMethod.GET) 144 | public Msg getSortCourseByCourseName(@PathVariable("courseName") String courseName) { 145 | List courseList = curriculumService.getSortCourseByCourseName(courseName); 146 | return Msg.success().add("courseList", courseList); 147 | } 148 | 149 | } 150 | -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/controller/LoginController.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.controller; 2 | 3 | import com.example.experiment2.bean.*; 4 | import com.example.experiment2.service.LoginService; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.*; 8 | 9 | import javax.servlet.http.HttpServletRequest; 10 | import javax.servlet.http.HttpSession; 11 | 12 | /** 13 | * @author wanghu 14 | * @discrption: 15 | * @create 2021-05-08 20:11 16 | */ 17 | @Controller 18 | public class LoginController { 19 | 20 | @Autowired 21 | private LoginService loginService; 22 | 23 | //学生登录 24 | @ResponseBody 25 | @PostMapping("/stu") 26 | public Msg studentLogin(UStudent uStu, HttpSession httpSession) { 27 | UStudent uStudent = loginService.getUserInfo(uStu.getId()); 28 | if (uStudent != null) { 29 | if (uStudent.getPassword().equals(uStu.getPassword())) { 30 | Student student = loginService.getUsernameById(uStu.getId()); 31 | httpSession.setAttribute("user", student); 32 | return Msg.success(); 33 | } else { 34 | return Msg.fail().add("msg", "密码错误"); 35 | } 36 | } 37 | return Msg.fail().add("msg", "用户不存在"); 38 | } 39 | 40 | //教师登录 41 | @ResponseBody 42 | @PostMapping( "/tea") 43 | public Msg teacherLogin(UTeacher uTea, HttpSession httpSession) { 44 | UTeacher uTeacher = loginService.getTeacherInfo(uTea.getId()); 45 | if (uTeacher != null) { 46 | if (uTeacher.getPassword().equals(uTea.getPassword())) { 47 | httpSession.setAttribute("user", uTeacher); 48 | return Msg.success(); 49 | } else { 50 | return Msg.fail().add("msg", "密码错误"); 51 | } 52 | } 53 | return Msg.fail().add("msg", "用户不存在"); 54 | } 55 | 56 | //教秘登录 57 | @ResponseBody 58 | @PostMapping( "/sec") 59 | public Msg secretaryLogin(UtSecretary uSec, HttpSession httpSession) { 60 | UtSecretary uSecretary = loginService.getSecretaryInfo(uSec.getId()); 61 | if (uSecretary != null) { 62 | if (uSecretary.getPassword().equals(uSec.getPassword())) { 63 | httpSession.setAttribute("user", uSecretary); 64 | return Msg.success(); 65 | } else { 66 | return Msg.fail().add("msg", "密码错误"); 67 | } 68 | } 69 | return Msg.fail().add("msg", "用户不存在"); 70 | } 71 | 72 | //跳转到学生教务系统主页 73 | @RequestMapping("/stuIndex") 74 | public String toStuIndex() { 75 | return "stu_index"; 76 | } 77 | 78 | //跳转到教师教务系统主页 79 | @RequestMapping("/teaIndex") 80 | public String toTeaIndex() { 81 | return "tea_index"; 82 | } 83 | 84 | //跳转到教秘教务系统主页 85 | @RequestMapping("/secIndex") 86 | public String toSecIndex() { 87 | return "sec_index"; 88 | } 89 | 90 | //注销 91 | @RequestMapping("/logout") 92 | public String logout(HttpServletRequest request) { 93 | request.getSession().invalidate(); 94 | return "login"; 95 | } 96 | 97 | } 98 | -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/controller/OtherController.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.controller; 2 | 3 | import com.example.experiment2.bean.Msg; 4 | import com.example.experiment2.service.OtherService; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.PathVariable; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RequestMethod; 10 | import org.springframework.web.bind.annotation.ResponseBody; 11 | 12 | import java.util.ArrayList; 13 | import java.util.List; 14 | 15 | /** 16 | * @author wanghu 17 | * @discrption: 18 | * @create 2021-05-13 15:16 19 | */ 20 | @Controller 21 | public class OtherController { 22 | 23 | @Autowired 24 | private OtherService otherService; 25 | 26 | //获取所有专业名 27 | @ResponseBody 28 | @RequestMapping(value = "/majors", method = RequestMethod.GET) 29 | public Msg getAllMajors() { 30 | List majors = otherService.getAllMajors(); 31 | return Msg.success().add("majors", majors); 32 | } 33 | 34 | //通过专业获取所有班级 35 | @ResponseBody 36 | @RequestMapping(value = "/classes/{major}", method = RequestMethod.GET) 37 | public Msg getClassesByMajor(@PathVariable("major") String major) { 38 | List classes = otherService.getClassesByMajor(major); 39 | return Msg.success().add("classes", classes); 40 | } 41 | 42 | //获取指定班级的学号 43 | @ResponseBody 44 | @RequestMapping(value = "/stus/{student_ids}", method = RequestMethod.GET) 45 | public Msg getStudentIdsByClass(@PathVariable("student_ids") String student_ids) { 46 | String[] strings = student_ids.split("-"); 47 | ArrayList list = new ArrayList<>(); 48 | for (Integer i = 1; i < strings.length; i++) { 49 | list.add(strings[i]); 50 | } 51 | List ids = otherService.getStudentIdsByClass(strings[0],list); 52 | return Msg.success().add("ids", ids); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/controller/TrainProgramController.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.controller; 2 | 3 | import com.example.experiment2.bean.Msg; 4 | import com.example.experiment2.bean.StuCurriculum; 5 | import com.example.experiment2.bean.Student; 6 | import com.example.experiment2.bean.TrainingProgram; 7 | import com.example.experiment2.service.CurriculumService; 8 | import com.example.experiment2.service.TrainingProgramService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.web.bind.annotation.PathVariable; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestMethod; 14 | import org.springframework.web.bind.annotation.ResponseBody; 15 | 16 | import javax.servlet.http.HttpSession; 17 | import java.util.ArrayList; 18 | import java.util.List; 19 | 20 | /** 21 | * @author wanghu 22 | * @discrption: 23 | * @create 2021-05-08 22:49 24 | */ 25 | @Controller 26 | public class TrainProgramController { 27 | @Autowired 28 | private TrainingProgramService trainingProgramService; 29 | @Autowired 30 | private CurriculumService curriculumService; 31 | //根据专业获取培养方案 32 | @ResponseBody 33 | @RequestMapping(value = "/train/{major}",method = RequestMethod.GET) 34 | public Msg getTrainProgramByMajor(@PathVariable("major") String major,HttpSession session){ 35 | List trainingPrograms = trainingProgramService.getTrainProgramByMajor(major); 36 | Student student = (Student) session.getAttribute("user"); 37 | List allSelectedCourse = curriculumService.getAllSelectedCourseById(student.getId()); 38 | ArrayList list = new ArrayList<>(); 39 | for(StuCurriculum selectedCourse:allSelectedCourse){ 40 | list.add(selectedCourse.getCourseId()); 41 | } 42 | return Msg.success().add("trainingPrograms",trainingPrograms).add("selectedCourseId",list); 43 | } 44 | 45 | //从培养方案中添加课程 46 | @ResponseBody 47 | @RequestMapping(value = "/addCourse/{ids}",method = RequestMethod.POST) 48 | public Msg addCourseByCourseIds(@PathVariable("ids") String ids, HttpSession session){ 49 | String[] idS = ids.split("-"); 50 | List list = new ArrayList<>(); 51 | for(String id:idS){ 52 | list.add(Integer.parseInt(id)); 53 | } 54 | Student student = (Student) session.getAttribute("user"); 55 | List courses = trainingProgramService.getTrainProgramByCourseIds(list); 56 | for(TrainingProgram course:courses){ 57 | StuCurriculum curriculum = new StuCurriculum(null, course.getCourseId(), course.getCourseName(), 58 | course.getCourseNature(), student.getId(), student.getStudentName(), "未修", null); 59 | curriculumService.saveCourse(curriculum); 60 | } 61 | return Msg.success(); 62 | } 63 | 64 | //获取教授的课程(教师) 65 | @ResponseBody 66 | @RequestMapping(value = "/teachingCourses/{name}",method = RequestMethod.GET) 67 | public Msg getTeachingCoursesByName(@PathVariable("name")String teacherName){ 68 | List teachingCourses = trainingProgramService.getTeachingCoursesByName(teacherName); 69 | return Msg.success().add("teachingCourses",teachingCourses); 70 | } 71 | 72 | //修改课程属性(教师) 73 | @ResponseBody 74 | @RequestMapping(value = "/updateCourse/{update_data}",method = RequestMethod.PUT) 75 | public Msg updateTeachingCoursesById(@PathVariable("update_data")String data){ 76 | String[] infos = data.split("-"); 77 | Integer course_id = Integer.parseInt(infos[0]); 78 | TrainingProgram course = new TrainingProgram(course_id, null, null, infos[1], null, infos[4], infos[2], infos[3]); 79 | trainingProgramService.updateTeachingCourse(course); 80 | return Msg.success(); 81 | } 82 | 83 | //获取所有培养方案(教秘) 84 | @ResponseBody 85 | @RequestMapping(value = "/trains",method = RequestMethod.GET) 86 | public Msg getAllTrainProgram(){ 87 | List allTrainProgram = trainingProgramService.getAllTrainProgram(); 88 | return Msg.success().add("allTrainProgram",allTrainProgram); 89 | } 90 | 91 | //添加培养方案(教秘) 92 | @ResponseBody 93 | @RequestMapping(value = "/train",method = RequestMethod.POST) 94 | public Msg addTrainProgram(TrainingProgram trainingProgram){ 95 | trainingProgramService.addTrainProgram(trainingProgram); 96 | return Msg.success(); 97 | } 98 | 99 | //修改培养方案(教秘) 100 | @ResponseBody 101 | @RequestMapping(value = "/train/{courseId}",method = RequestMethod.PUT) 102 | public Msg UpdateTrainProgram(TrainingProgram trainingProgram,@PathVariable("courseId")Integer courseId){ 103 | trainingProgram.setCourseId(courseId); 104 | trainingProgramService.UpdateTrainProgram(trainingProgram); 105 | return Msg.success(); 106 | } 107 | 108 | //删除培养方案(教秘) 109 | @ResponseBody 110 | @RequestMapping(value = "/train/{courseId}",method = RequestMethod.DELETE) 111 | public Msg deleteTrainProgramByCourseId(@PathVariable("courseId")Integer courseId){ 112 | trainingProgramService.deleteTrainProgramByCourseId(courseId); 113 | return Msg.success(); 114 | } 115 | 116 | //根据专业获取所有课程名 117 | @ResponseBody 118 | @RequestMapping(value = "/courseNames/{major}",method = RequestMethod.GET) 119 | public Msg getCourseNamesByMajor(@PathVariable("major") String major){ 120 | List courseNames = trainingProgramService.getCourseNamesByMajor(major); 121 | return Msg.success().add("courseNames",courseNames); 122 | } 123 | 124 | } 125 | -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/dao/ClassInfoMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.dao; 2 | 3 | import com.example.experiment2.bean.ClassInfo; 4 | import com.example.experiment2.bean.ClassInfoExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface ClassInfoMapper { 9 | long countByExample(ClassInfoExample example); 10 | 11 | int deleteByExample(ClassInfoExample example); 12 | 13 | int deleteByPrimaryKey(String className); 14 | 15 | int insert(ClassInfo record); 16 | 17 | int insertSelective(ClassInfo record); 18 | 19 | List selectByExample(ClassInfoExample example); 20 | 21 | ClassInfo selectByPrimaryKey(String className); 22 | 23 | int updateByExampleSelective(@Param("record") ClassInfo record, @Param("example") ClassInfoExample example); 24 | 25 | int updateByExample(@Param("record") ClassInfo record, @Param("example") ClassInfoExample example); 26 | 27 | int updateByPrimaryKeySelective(ClassInfo record); 28 | 29 | int updateByPrimaryKey(ClassInfo record); 30 | } -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/dao/StuCurriculumMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.dao; 2 | 3 | import com.example.experiment2.bean.StuCurriculum; 4 | import com.example.experiment2.bean.StuCurriculumExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface StuCurriculumMapper { 9 | long countByExample(StuCurriculumExample example); 10 | 11 | int deleteByExample(StuCurriculumExample example); 12 | 13 | int deleteByPrimaryKey(Integer id); 14 | 15 | int insert(StuCurriculum record); 16 | 17 | int insertSelective(StuCurriculum record); 18 | 19 | List selectByExample(StuCurriculumExample example); 20 | 21 | StuCurriculum selectByPrimaryKey(Integer id); 22 | 23 | int updateByExampleSelective(@Param("record") StuCurriculum record, @Param("example") StuCurriculumExample example); 24 | 25 | int updateByExample(@Param("record") StuCurriculum record, @Param("example") StuCurriculumExample example); 26 | 27 | int updateByPrimaryKeySelective(StuCurriculum record); 28 | 29 | int updateByPrimaryKey(StuCurriculum record); 30 | 31 | void updateCourseGradeIsNull(String courseName, String stuId); 32 | } -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/dao/StudentMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.dao; 2 | 3 | import com.example.experiment2.bean.Student; 4 | import com.example.experiment2.bean.StudentExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface StudentMapper { 9 | long countByExample(StudentExample example); 10 | 11 | int deleteByExample(StudentExample example); 12 | 13 | int deleteByPrimaryKey(String id); 14 | 15 | int insert(Student record); 16 | 17 | int insertSelective(Student record); 18 | 19 | List selectByExample(StudentExample example); 20 | 21 | Student selectByPrimaryKey(String id); 22 | 23 | int updateByExampleSelective(@Param("record") Student record, @Param("example") StudentExample example); 24 | 25 | int updateByExample(@Param("record") Student record, @Param("example") StudentExample example); 26 | 27 | int updateByPrimaryKeySelective(Student record); 28 | 29 | int updateByPrimaryKey(Student record); 30 | 31 | //查询所有专业名 32 | List selectAllMajors(); 33 | 34 | List getClassesByMajor(String major); 35 | } -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/dao/TrainingProgramMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.dao; 2 | 3 | import com.example.experiment2.bean.TrainingProgram; 4 | import com.example.experiment2.bean.TrainingProgramExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface TrainingProgramMapper { 9 | long countByExample(TrainingProgramExample example); 10 | 11 | int deleteByExample(TrainingProgramExample example); 12 | 13 | int deleteByPrimaryKey(Integer courseId); 14 | 15 | int insert(TrainingProgram record); 16 | 17 | int insertSelective(TrainingProgram record); 18 | 19 | List selectByExample(TrainingProgramExample example); 20 | 21 | TrainingProgram selectByPrimaryKey(Integer courseId); 22 | 23 | int updateByExampleSelective(@Param("record") TrainingProgram record, @Param("example") TrainingProgramExample example); 24 | 25 | int updateByExample(@Param("record") TrainingProgram record, @Param("example") TrainingProgramExample example); 26 | 27 | int updateByPrimaryKeySelective(TrainingProgram record); 28 | 29 | int updateByPrimaryKey(TrainingProgram record); 30 | 31 | List getCourseNamesByMajor(String major); 32 | } -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/dao/UStudentMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.dao; 2 | 3 | import com.example.experiment2.bean.UStudent; 4 | import com.example.experiment2.bean.UStudentExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface UStudentMapper { 9 | long countByExample(UStudentExample example); 10 | 11 | int deleteByExample(UStudentExample example); 12 | 13 | int deleteByPrimaryKey(String id); 14 | 15 | int insert(UStudent record); 16 | 17 | int insertSelective(UStudent record); 18 | 19 | List selectByExample(UStudentExample example); 20 | 21 | UStudent selectByPrimaryKey(String id); 22 | 23 | int updateByExampleSelective(@Param("record") UStudent record, @Param("example") UStudentExample example); 24 | 25 | int updateByExample(@Param("record") UStudent record, @Param("example") UStudentExample example); 26 | 27 | int updateByPrimaryKeySelective(UStudent record); 28 | 29 | int updateByPrimaryKey(UStudent record); 30 | } -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/dao/UTeacherMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.dao; 2 | 3 | import com.example.experiment2.bean.UTeacher; 4 | import com.example.experiment2.bean.UTeacherExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface UTeacherMapper { 9 | long countByExample(UTeacherExample example); 10 | 11 | int deleteByExample(UTeacherExample example); 12 | 13 | int deleteByPrimaryKey(String id); 14 | 15 | int insert(UTeacher record); 16 | 17 | int insertSelective(UTeacher record); 18 | 19 | List selectByExample(UTeacherExample example); 20 | 21 | UTeacher selectByPrimaryKey(String id); 22 | 23 | int updateByExampleSelective(@Param("record") UTeacher record, @Param("example") UTeacherExample example); 24 | 25 | int updateByExample(@Param("record") UTeacher record, @Param("example") UTeacherExample example); 26 | 27 | int updateByPrimaryKeySelective(UTeacher record); 28 | 29 | int updateByPrimaryKey(UTeacher record); 30 | } -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/dao/UtSecretaryMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.dao; 2 | 3 | import com.example.experiment2.bean.UtSecretary; 4 | import com.example.experiment2.bean.UtSecretaryExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface UtSecretaryMapper { 9 | long countByExample(UtSecretaryExample example); 10 | 11 | int deleteByExample(UtSecretaryExample example); 12 | 13 | int deleteByPrimaryKey(String id); 14 | 15 | int insert(UtSecretary record); 16 | 17 | int insertSelective(UtSecretary record); 18 | 19 | List selectByExample(UtSecretaryExample example); 20 | 21 | UtSecretary selectByPrimaryKey(String id); 22 | 23 | int updateByExampleSelective(@Param("record") UtSecretary record, @Param("example") UtSecretaryExample example); 24 | 25 | int updateByExample(@Param("record") UtSecretary record, @Param("example") UtSecretaryExample example); 26 | 27 | int updateByPrimaryKeySelective(UtSecretary record); 28 | 29 | int updateByPrimaryKey(UtSecretary record); 30 | } -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/filter/LoginFilter.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.filter; 2 | 3 | import javax.servlet.*; 4 | import javax.servlet.http.HttpServletRequest; 5 | import java.io.IOException; 6 | 7 | public class LoginFilter implements Filter { 8 | @Override 9 | public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { 10 | HttpServletRequest req = (HttpServletRequest) servletRequest; 11 | Object user = req.getSession().getAttribute("user"); 12 | String spath = req.getServletPath(); 13 | //不需要过滤的url 14 | String[] urls = {"/stu", "/tea", "/sec", "/logout", "/login", "/json", ".js", ".css", ".ico", ".jpg", ".png", ".woff", ".ttf"}; 15 | boolean flag = true; 16 | for (String str : urls) { 17 | if (spath.indexOf(str) != -1) { 18 | flag = false; 19 | break; 20 | } 21 | } 22 | if (flag) { 23 | if (user == null) { 24 | req.getRequestDispatcher("/WEB-INF/pages/login.jsp").forward(servletRequest, servletResponse); 25 | } else { 26 | filterChain.doFilter(servletRequest, servletResponse); 27 | } 28 | } else { 29 | filterChain.doFilter(servletRequest, servletResponse); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/service/CurriculumService.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.service; 2 | 3 | import com.example.experiment2.bean.StuCurriculum; 4 | import com.example.experiment2.bean.StuCurriculumExample; 5 | import com.example.experiment2.dao.StuCurriculumMapper; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author wanghu 13 | * @discrption: 14 | * @create 2021-05-09 16:49 15 | */ 16 | @Service 17 | public class CurriculumService { 18 | 19 | @Autowired 20 | private StuCurriculumMapper stuCurriculumMapper; 21 | 22 | public List getAllSelectedCourseById(String id) { 23 | StuCurriculumExample example = new StuCurriculumExample(); 24 | example.createCriteria().andCourseSelectedIdEqualTo(id); 25 | return stuCurriculumMapper.selectByExample(example); 26 | } 27 | 28 | public List getCompulsoryCourseById(String id) { 29 | StuCurriculumExample example = new StuCurriculumExample(); 30 | example.createCriteria().andCourseSelectedIdEqualTo(id).andCourseNatureEqualTo("学位课"); 31 | return stuCurriculumMapper.selectByExample(example); 32 | } 33 | 34 | public List getElectiveCourseById(String id) { 35 | StuCurriculumExample example = new StuCurriculumExample(); 36 | example.createCriteria().andCourseSelectedIdEqualTo(id).andCourseNatureEqualTo("选修课"); 37 | return stuCurriculumMapper.selectByExample(example); 38 | } 39 | 40 | public List getLearnedCourseById(String id) { 41 | StuCurriculumExample example = new StuCurriculumExample(); 42 | example.createCriteria().andCourseSelectedIdEqualTo(id).andCourseStatusEqualTo("已修"); 43 | return stuCurriculumMapper.selectByExample(example); 44 | } 45 | 46 | public List getNotLearnedCourseById(String id) { 47 | StuCurriculumExample example = new StuCurriculumExample(); 48 | example.createCriteria().andCourseSelectedIdEqualTo(id).andCourseStatusEqualTo("未修"); 49 | return stuCurriculumMapper.selectByExample(example); 50 | } 51 | 52 | public List getGradeById(String id) { 53 | StuCurriculumExample example = new StuCurriculumExample(); 54 | example.createCriteria().andCourseSelectedIdEqualTo(id).andGradeIsNotNull(); 55 | return stuCurriculumMapper.selectByExample(example); 56 | } 57 | 58 | public void saveCourse(StuCurriculum curriculum) { 59 | stuCurriculumMapper.insert(curriculum); 60 | } 61 | 62 | public void deleteSelectedCourseById(Integer id) { 63 | stuCurriculumMapper.deleteByPrimaryKey(id); 64 | } 65 | 66 | public boolean isUnTeachedCourse(String courseName) { 67 | StuCurriculumExample example = new StuCurriculumExample(); 68 | example.createCriteria().andCourseNameEqualTo(courseName).andCourseStatusEqualTo("未修"); 69 | List courses = stuCurriculumMapper.selectByExample(example); 70 | return courses.size()!=0; 71 | } 72 | 73 | public boolean isTeachedCourse(String courseName) { 74 | StuCurriculumExample example = new StuCurriculumExample(); 75 | example.createCriteria().andCourseNameEqualTo(courseName).andCourseStatusEqualTo("已修"); 76 | List courses = stuCurriculumMapper.selectByExample(example); 77 | return courses.size()!=0; 78 | } 79 | 80 | public List getCourseByCourseName(String courseName) { 81 | StuCurriculumExample example = new StuCurriculumExample(); 82 | example.createCriteria().andCourseNameEqualTo(courseName); 83 | return stuCurriculumMapper.selectByExample(example); 84 | } 85 | 86 | public void updateGradeByCourseNameAndStuId(StuCurriculum curriculum) { 87 | StuCurriculumExample example = new StuCurriculumExample(); 88 | example.createCriteria().andCourseNameEqualTo(curriculum.getCourseName()).andCourseSelectedIdEqualTo(curriculum.getCourseSelectedId()); 89 | stuCurriculumMapper.updateByExampleSelective(curriculum,example); 90 | } 91 | 92 | public void updateCourseStatusByCourseName(String courseName) { 93 | StuCurriculumExample example = new StuCurriculumExample(); 94 | example.createCriteria().andCourseNameEqualTo(courseName); 95 | StuCurriculum curriculum = new StuCurriculum(null, null, null, null, null, null, "已修", null); 96 | stuCurriculumMapper.updateByExampleSelective(curriculum,example); 97 | } 98 | 99 | public void updateCourseGradeIsNull(String courseName, String stuId) { 100 | stuCurriculumMapper.updateCourseGradeIsNull(courseName,stuId); 101 | } 102 | 103 | public List getSortCourseByCourseName(String courseName) { 104 | StuCurriculumExample example = new StuCurriculumExample(); 105 | example.createCriteria().andCourseNameEqualTo(courseName); 106 | example.setOrderByClause("grade desc"); 107 | return stuCurriculumMapper.selectByExample(example); 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/service/LoginService.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.service; 2 | 3 | import com.example.experiment2.bean.Student; 4 | import com.example.experiment2.bean.UStudent; 5 | import com.example.experiment2.bean.UTeacher; 6 | import com.example.experiment2.bean.UtSecretary; 7 | import com.example.experiment2.dao.StudentMapper; 8 | import com.example.experiment2.dao.UStudentMapper; 9 | import com.example.experiment2.dao.UTeacherMapper; 10 | import com.example.experiment2.dao.UtSecretaryMapper; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.stereotype.Service; 13 | 14 | /** 15 | * @author wanghu 16 | * @discrption: 17 | * @create 2021-05-08 20:49 18 | */ 19 | @Service 20 | public class LoginService { 21 | 22 | @Autowired 23 | private UStudentMapper uStudentMapper; 24 | @Autowired 25 | private UTeacherMapper uTeacherMapper; 26 | @Autowired 27 | private UtSecretaryMapper utSecretaryMapper; 28 | @Autowired 29 | private StudentMapper studentMapper; 30 | 31 | public UStudent getUserInfo(String id) { 32 | return uStudentMapper.selectByPrimaryKey(id); 33 | } 34 | 35 | public Student getUsernameById(String id) { 36 | return studentMapper.selectByPrimaryKey(id); 37 | } 38 | 39 | public UTeacher getTeacherInfo(String id) { 40 | return uTeacherMapper.selectByPrimaryKey(id); 41 | } 42 | 43 | public UtSecretary getSecretaryInfo(String id) { 44 | return utSecretaryMapper.selectByPrimaryKey(id); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/service/OtherService.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.service; 2 | 3 | import com.example.experiment2.bean.Student; 4 | import com.example.experiment2.bean.StudentExample; 5 | import com.example.experiment2.dao.StudentMapper; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.ArrayList; 10 | import java.util.List; 11 | 12 | /** 13 | * @author wanghu 14 | * @discrption: 15 | * @create 2021-05-13 15:17 16 | */ 17 | @Service 18 | public class OtherService { 19 | 20 | @Autowired 21 | private StudentMapper studentMapper; 22 | 23 | public List getAllMajors() { 24 | List majors = studentMapper.selectAllMajors(); 25 | return majors; 26 | } 27 | 28 | public List getClassesByMajor(String major) { 29 | return studentMapper.getClassesByMajor(major); 30 | } 31 | 32 | public List getStudentIdsByClass(String className,ArrayList list) { 33 | StudentExample example = new StudentExample(); 34 | example.createCriteria().andClassNameEqualTo(className).andIdIn(list); 35 | List students = studentMapper.selectByExample(example); 36 | ArrayList ids = new ArrayList<>(); 37 | for(Student student:students){ 38 | ids.add(student.getId()); 39 | } 40 | return ids; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/example/experiment2/service/TrainingProgramService.java: -------------------------------------------------------------------------------- 1 | package com.example.experiment2.service; 2 | 3 | import com.example.experiment2.bean.TrainingProgram; 4 | import com.example.experiment2.bean.TrainingProgramExample; 5 | import com.example.experiment2.dao.TrainingProgramMapper; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.ArrayList; 10 | import java.util.List; 11 | 12 | /** 13 | * @author wanghu 14 | * @discrption: 15 | * @create 2021-05-08 22:51 16 | */ 17 | @Service 18 | public class TrainingProgramService { 19 | 20 | @Autowired 21 | private TrainingProgramMapper trainingProgramMapper; 22 | 23 | public List getTrainProgramByMajor(String major) { 24 | List list = new ArrayList<>(); 25 | list.add("公共课"); 26 | list.add(major); 27 | TrainingProgramExample example = new TrainingProgramExample(); 28 | example.createCriteria().andCourseMajorIn(list); 29 | List trainingPrograms = trainingProgramMapper.selectByExample(example); 30 | return trainingPrograms; 31 | } 32 | 33 | public List getTrainProgramByCourseIds(List ids){ 34 | TrainingProgramExample example = new TrainingProgramExample(); 35 | example.createCriteria().andCourseIdIn(ids); 36 | return trainingProgramMapper.selectByExample(example); 37 | } 38 | 39 | public List getTeachingCoursesByName(String teacherName) { 40 | TrainingProgramExample example = new TrainingProgramExample(); 41 | example.createCriteria().andCourseTeacherEqualTo(teacherName); 42 | return trainingProgramMapper.selectByExample(example); 43 | } 44 | 45 | public void updateTeachingCourse(TrainingProgram course){ 46 | trainingProgramMapper.updateByPrimaryKeySelective(course); 47 | } 48 | 49 | public List getAllTrainProgram() { 50 | return trainingProgramMapper.selectByExample(null); 51 | } 52 | 53 | public void addTrainProgram(TrainingProgram trainingProgram) { 54 | trainingProgramMapper.insertSelective(trainingProgram); 55 | } 56 | 57 | public void UpdateTrainProgram(TrainingProgram trainingProgram) { 58 | trainingProgramMapper.updateByPrimaryKeySelective(trainingProgram); 59 | } 60 | 61 | public void deleteTrainProgramByCourseId(Integer courseId) { 62 | trainingProgramMapper.deleteByPrimaryKey(courseId); 63 | } 64 | 65 | public List getCourseNamesByMajor(String major) { 66 | List courseNames = trainingProgramMapper.getCourseNamesByMajor(major); 67 | return courseNames; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/resources/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/main/resources/dbconfig.properties: -------------------------------------------------------------------------------- 1 | jdbc.username=root 2 | jdbc.password=5517 3 | jdbc.driver=com.mysql.cj.jdbc.Driver 4 | jdbc.url=jdbc:mysql:///college 5 | -------------------------------------------------------------------------------- /src/main/resources/mapper/ClassInfoMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | and ${criterion.condition} 20 | 21 | 22 | and ${criterion.condition} #{criterion.value} 23 | 24 | 25 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 26 | 27 | 28 | and ${criterion.condition} 29 | 30 | #{listItem} 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | and ${criterion.condition} 49 | 50 | 51 | and ${criterion.condition} #{criterion.value} 52 | 53 | 54 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 55 | 56 | 57 | and ${criterion.condition} 58 | 59 | #{listItem} 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | class_name, student_num, monitor, study_committee, life_committee 71 | 72 | 86 | 92 | 93 | delete from class_info 94 | where class_name = #{className,jdbcType=VARCHAR} 95 | 96 | 97 | delete from class_info 98 | 99 | 100 | 101 | 102 | 103 | insert into class_info (class_name, student_num, monitor, 104 | study_committee, life_committee) 105 | values (#{className,jdbcType=VARCHAR}, #{studentNum,jdbcType=INTEGER}, #{monitor,jdbcType=VARCHAR}, 106 | #{studyCommittee,jdbcType=VARCHAR}, #{lifeCommittee,jdbcType=VARCHAR}) 107 | 108 | 109 | insert into class_info 110 | 111 | 112 | class_name, 113 | 114 | 115 | student_num, 116 | 117 | 118 | monitor, 119 | 120 | 121 | study_committee, 122 | 123 | 124 | life_committee, 125 | 126 | 127 | 128 | 129 | #{className,jdbcType=VARCHAR}, 130 | 131 | 132 | #{studentNum,jdbcType=INTEGER}, 133 | 134 | 135 | #{monitor,jdbcType=VARCHAR}, 136 | 137 | 138 | #{studyCommittee,jdbcType=VARCHAR}, 139 | 140 | 141 | #{lifeCommittee,jdbcType=VARCHAR}, 142 | 143 | 144 | 145 | 151 | 152 | update class_info 153 | 154 | 155 | class_name = #{record.className,jdbcType=VARCHAR}, 156 | 157 | 158 | student_num = #{record.studentNum,jdbcType=INTEGER}, 159 | 160 | 161 | monitor = #{record.monitor,jdbcType=VARCHAR}, 162 | 163 | 164 | study_committee = #{record.studyCommittee,jdbcType=VARCHAR}, 165 | 166 | 167 | life_committee = #{record.lifeCommittee,jdbcType=VARCHAR}, 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | update class_info 176 | set class_name = #{record.className,jdbcType=VARCHAR}, 177 | student_num = #{record.studentNum,jdbcType=INTEGER}, 178 | monitor = #{record.monitor,jdbcType=VARCHAR}, 179 | study_committee = #{record.studyCommittee,jdbcType=VARCHAR}, 180 | life_committee = #{record.lifeCommittee,jdbcType=VARCHAR} 181 | 182 | 183 | 184 | 185 | 186 | update class_info 187 | 188 | 189 | student_num = #{studentNum,jdbcType=INTEGER}, 190 | 191 | 192 | monitor = #{monitor,jdbcType=VARCHAR}, 193 | 194 | 195 | study_committee = #{studyCommittee,jdbcType=VARCHAR}, 196 | 197 | 198 | life_committee = #{lifeCommittee,jdbcType=VARCHAR}, 199 | 200 | 201 | where class_name = #{className,jdbcType=VARCHAR} 202 | 203 | 204 | update class_info 205 | set student_num = #{studentNum,jdbcType=INTEGER}, 206 | monitor = #{monitor,jdbcType=VARCHAR}, 207 | study_committee = #{studyCommittee,jdbcType=VARCHAR}, 208 | life_committee = #{lifeCommittee,jdbcType=VARCHAR} 209 | where class_name = #{className,jdbcType=VARCHAR} 210 | 211 | -------------------------------------------------------------------------------- /src/main/resources/mapper/StuCurriculumMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | and ${criterion.condition} 23 | 24 | 25 | and ${criterion.condition} #{criterion.value} 26 | 27 | 28 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 29 | 30 | 31 | and ${criterion.condition} 32 | 33 | #{listItem} 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | and ${criterion.condition} 52 | 53 | 54 | and ${criterion.condition} #{criterion.value} 55 | 56 | 57 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 58 | 59 | 60 | and ${criterion.condition} 61 | 62 | #{listItem} 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | id, course_id, course_name, course_nature, course_selected_ID, course_selected_stu, 74 | course_status, grade 75 | 76 | 90 | 96 | 97 | delete from stu_curriculum 98 | where id = #{id,jdbcType=INTEGER} 99 | 100 | 101 | delete from stu_curriculum 102 | 103 | 104 | 105 | 106 | 107 | insert into stu_curriculum (id, course_id, course_name, 108 | course_nature, course_selected_ID, course_selected_stu, 109 | course_status, grade) 110 | values (#{id,jdbcType=INTEGER}, #{courseId,jdbcType=INTEGER}, #{courseName,jdbcType=VARCHAR}, 111 | #{courseNature,jdbcType=VARCHAR}, #{courseSelectedId,jdbcType=VARCHAR}, #{courseSelectedStu,jdbcType=VARCHAR}, 112 | #{courseStatus,jdbcType=VARCHAR}, #{grade,jdbcType=INTEGER}) 113 | 114 | 115 | insert into stu_curriculum 116 | 117 | 118 | id, 119 | 120 | 121 | course_id, 122 | 123 | 124 | course_name, 125 | 126 | 127 | course_nature, 128 | 129 | 130 | course_selected_ID, 131 | 132 | 133 | course_selected_stu, 134 | 135 | 136 | course_status, 137 | 138 | 139 | grade, 140 | 141 | 142 | 143 | 144 | #{id,jdbcType=INTEGER}, 145 | 146 | 147 | #{courseId,jdbcType=INTEGER}, 148 | 149 | 150 | #{courseName,jdbcType=VARCHAR}, 151 | 152 | 153 | #{courseNature,jdbcType=VARCHAR}, 154 | 155 | 156 | #{courseSelectedId,jdbcType=VARCHAR}, 157 | 158 | 159 | #{courseSelectedStu,jdbcType=VARCHAR}, 160 | 161 | 162 | #{courseStatus,jdbcType=VARCHAR}, 163 | 164 | 165 | #{grade,jdbcType=INTEGER}, 166 | 167 | 168 | 169 | 175 | 176 | update stu_curriculum 177 | 178 | 179 | id = #{record.id,jdbcType=INTEGER}, 180 | 181 | 182 | course_id = #{record.courseId,jdbcType=INTEGER}, 183 | 184 | 185 | course_name = #{record.courseName,jdbcType=VARCHAR}, 186 | 187 | 188 | course_nature = #{record.courseNature,jdbcType=VARCHAR}, 189 | 190 | 191 | course_selected_ID = #{record.courseSelectedId,jdbcType=VARCHAR}, 192 | 193 | 194 | course_selected_stu = #{record.courseSelectedStu,jdbcType=VARCHAR}, 195 | 196 | 197 | course_status = #{record.courseStatus,jdbcType=VARCHAR}, 198 | 199 | 200 | grade = #{record.grade,jdbcType=INTEGER}, 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | update stu_curriculum 209 | set id = #{record.id,jdbcType=INTEGER}, 210 | course_id = #{record.courseId,jdbcType=INTEGER}, 211 | course_name = #{record.courseName,jdbcType=VARCHAR}, 212 | course_nature = #{record.courseNature,jdbcType=VARCHAR}, 213 | course_selected_ID = #{record.courseSelectedId,jdbcType=VARCHAR}, 214 | course_selected_stu = #{record.courseSelectedStu,jdbcType=VARCHAR}, 215 | course_status = #{record.courseStatus,jdbcType=VARCHAR}, 216 | grade = #{record.grade,jdbcType=INTEGER} 217 | 218 | 219 | 220 | 221 | 222 | update stu_curriculum 223 | 224 | 225 | course_id = #{courseId,jdbcType=INTEGER}, 226 | 227 | 228 | course_name = #{courseName,jdbcType=VARCHAR}, 229 | 230 | 231 | course_nature = #{courseNature,jdbcType=VARCHAR}, 232 | 233 | 234 | course_selected_ID = #{courseSelectedId,jdbcType=VARCHAR}, 235 | 236 | 237 | course_selected_stu = #{courseSelectedStu,jdbcType=VARCHAR}, 238 | 239 | 240 | course_status = #{courseStatus,jdbcType=VARCHAR}, 241 | 242 | 243 | grade = #{grade,jdbcType=INTEGER}, 244 | 245 | 246 | where id = #{id,jdbcType=INTEGER} 247 | 248 | 249 | update stu_curriculum 250 | set course_id = #{courseId,jdbcType=INTEGER}, 251 | course_name = #{courseName,jdbcType=VARCHAR}, 252 | course_nature = #{courseNature,jdbcType=VARCHAR}, 253 | course_selected_ID = #{courseSelectedId,jdbcType=VARCHAR}, 254 | course_selected_stu = #{courseSelectedStu,jdbcType=VARCHAR}, 255 | course_status = #{courseStatus,jdbcType=VARCHAR}, 256 | grade = #{grade,jdbcType=INTEGER} 257 | where id = #{id,jdbcType=INTEGER} 258 | 259 | 260 | 261 | update stu_curriculum 262 | set course_status = "未修", 263 | grade = null 264 | where course_name = #{param1} and course_selected_ID = #{param2} 265 | 266 | -------------------------------------------------------------------------------- /src/main/resources/mapper/StudentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | and ${criterion.condition} 23 | 24 | 25 | and ${criterion.condition} #{criterion.value} 26 | 27 | 28 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 29 | 30 | 31 | and ${criterion.condition} 32 | 33 | #{listItem} 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | and ${criterion.condition} 52 | 53 | 54 | and ${criterion.condition} #{criterion.value} 55 | 56 | 57 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 58 | 59 | 60 | and ${criterion.condition} 61 | 62 | #{listItem} 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | ID, student_name, ID_card, phone_number, start_year, student_source, major, class_name 74 | 75 | 89 | 95 | 96 | delete from student 97 | where ID = #{id,jdbcType=VARCHAR} 98 | 99 | 100 | delete from student 101 | 102 | 103 | 104 | 105 | 106 | insert into student (ID, student_name, ID_card, 107 | phone_number, start_year, student_source, 108 | major, class_name) 109 | values (#{id,jdbcType=VARCHAR}, #{studentName,jdbcType=VARCHAR}, #{idCard,jdbcType=VARCHAR}, 110 | #{phoneNumber,jdbcType=VARCHAR}, #{startYear,jdbcType=DATE}, #{studentSource,jdbcType=VARCHAR}, 111 | #{major,jdbcType=VARCHAR}, #{className,jdbcType=VARCHAR}) 112 | 113 | 114 | insert into student 115 | 116 | 117 | ID, 118 | 119 | 120 | student_name, 121 | 122 | 123 | ID_card, 124 | 125 | 126 | phone_number, 127 | 128 | 129 | start_year, 130 | 131 | 132 | student_source, 133 | 134 | 135 | major, 136 | 137 | 138 | class_name, 139 | 140 | 141 | 142 | 143 | #{id,jdbcType=VARCHAR}, 144 | 145 | 146 | #{studentName,jdbcType=VARCHAR}, 147 | 148 | 149 | #{idCard,jdbcType=VARCHAR}, 150 | 151 | 152 | #{phoneNumber,jdbcType=VARCHAR}, 153 | 154 | 155 | #{startYear,jdbcType=DATE}, 156 | 157 | 158 | #{studentSource,jdbcType=VARCHAR}, 159 | 160 | 161 | #{major,jdbcType=VARCHAR}, 162 | 163 | 164 | #{className,jdbcType=VARCHAR}, 165 | 166 | 167 | 168 | 174 | 175 | update student 176 | 177 | 178 | ID = #{record.id,jdbcType=VARCHAR}, 179 | 180 | 181 | student_name = #{record.studentName,jdbcType=VARCHAR}, 182 | 183 | 184 | ID_card = #{record.idCard,jdbcType=VARCHAR}, 185 | 186 | 187 | phone_number = #{record.phoneNumber,jdbcType=VARCHAR}, 188 | 189 | 190 | start_year = #{record.startYear,jdbcType=DATE}, 191 | 192 | 193 | student_source = #{record.studentSource,jdbcType=VARCHAR}, 194 | 195 | 196 | major = #{record.major,jdbcType=VARCHAR}, 197 | 198 | 199 | class_name = #{record.className,jdbcType=VARCHAR}, 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | update student 208 | set ID = #{record.id,jdbcType=VARCHAR}, 209 | student_name = #{record.studentName,jdbcType=VARCHAR}, 210 | ID_card = #{record.idCard,jdbcType=VARCHAR}, 211 | phone_number = #{record.phoneNumber,jdbcType=VARCHAR}, 212 | start_year = #{record.startYear,jdbcType=DATE}, 213 | student_source = #{record.studentSource,jdbcType=VARCHAR}, 214 | major = #{record.major,jdbcType=VARCHAR}, 215 | class_name = #{record.className,jdbcType=VARCHAR} 216 | 217 | 218 | 219 | 220 | 221 | update student 222 | 223 | 224 | student_name = #{studentName,jdbcType=VARCHAR}, 225 | 226 | 227 | ID_card = #{idCard,jdbcType=VARCHAR}, 228 | 229 | 230 | phone_number = #{phoneNumber,jdbcType=VARCHAR}, 231 | 232 | 233 | start_year = #{startYear,jdbcType=DATE}, 234 | 235 | 236 | student_source = #{studentSource,jdbcType=VARCHAR}, 237 | 238 | 239 | major = #{major,jdbcType=VARCHAR}, 240 | 241 | 242 | class_name = #{className,jdbcType=VARCHAR}, 243 | 244 | 245 | where ID = #{id,jdbcType=VARCHAR} 246 | 247 | 248 | update student 249 | set student_name = #{studentName,jdbcType=VARCHAR}, 250 | ID_card = #{idCard,jdbcType=VARCHAR}, 251 | phone_number = #{phoneNumber,jdbcType=VARCHAR}, 252 | start_year = #{startYear,jdbcType=DATE}, 253 | student_source = #{studentSource,jdbcType=VARCHAR}, 254 | major = #{major,jdbcType=VARCHAR}, 255 | class_name = #{className,jdbcType=VARCHAR} 256 | where ID = #{id,jdbcType=VARCHAR} 257 | 258 | 259 | 262 | 265 | 266 | -------------------------------------------------------------------------------- /src/main/resources/mapper/TrainingProgramMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | and ${criterion.condition} 23 | 24 | 25 | and ${criterion.condition} #{criterion.value} 26 | 27 | 28 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 29 | 30 | 31 | and ${criterion.condition} 32 | 33 | #{listItem} 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | and ${criterion.condition} 52 | 53 | 54 | and ${criterion.condition} #{criterion.value} 55 | 56 | 57 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 58 | 59 | 60 | and ${criterion.condition} 61 | 62 | #{listItem} 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | course_id, course_name, course_nature, course_major, course_teacher, course_attributes, 74 | preliminary_course, followup_course 75 | 76 | 90 | 96 | 97 | delete from training_program 98 | where course_id = #{courseId,jdbcType=INTEGER} 99 | 100 | 101 | delete from training_program 102 | 103 | 104 | 105 | 106 | 107 | insert into training_program (course_id, course_name, course_nature, 108 | course_major, course_teacher, course_attributes, 109 | preliminary_course, followup_course) 110 | values (#{courseId,jdbcType=INTEGER}, #{courseName,jdbcType=VARCHAR}, #{courseNature,jdbcType=VARCHAR}, 111 | #{courseMajor,jdbcType=VARCHAR}, #{courseTeacher,jdbcType=VARCHAR}, #{courseAttributes,jdbcType=VARCHAR}, 112 | #{preliminaryCourse,jdbcType=VARCHAR}, #{followupCourse,jdbcType=VARCHAR}) 113 | 114 | 115 | insert into training_program 116 | 117 | 118 | course_id, 119 | 120 | 121 | course_name, 122 | 123 | 124 | course_nature, 125 | 126 | 127 | course_major, 128 | 129 | 130 | course_teacher, 131 | 132 | 133 | course_attributes, 134 | 135 | 136 | preliminary_course, 137 | 138 | 139 | followup_course, 140 | 141 | 142 | 143 | 144 | #{courseId,jdbcType=INTEGER}, 145 | 146 | 147 | #{courseName,jdbcType=VARCHAR}, 148 | 149 | 150 | #{courseNature,jdbcType=VARCHAR}, 151 | 152 | 153 | #{courseMajor,jdbcType=VARCHAR}, 154 | 155 | 156 | #{courseTeacher,jdbcType=VARCHAR}, 157 | 158 | 159 | #{courseAttributes,jdbcType=VARCHAR}, 160 | 161 | 162 | #{preliminaryCourse,jdbcType=VARCHAR}, 163 | 164 | 165 | #{followupCourse,jdbcType=VARCHAR}, 166 | 167 | 168 | 169 | 175 | 176 | update training_program 177 | 178 | 179 | course_id = #{record.courseId,jdbcType=INTEGER}, 180 | 181 | 182 | course_name = #{record.courseName,jdbcType=VARCHAR}, 183 | 184 | 185 | course_nature = #{record.courseNature,jdbcType=VARCHAR}, 186 | 187 | 188 | course_major = #{record.courseMajor,jdbcType=VARCHAR}, 189 | 190 | 191 | course_teacher = #{record.courseTeacher,jdbcType=VARCHAR}, 192 | 193 | 194 | course_attributes = #{record.courseAttributes,jdbcType=VARCHAR}, 195 | 196 | 197 | preliminary_course = #{record.preliminaryCourse,jdbcType=VARCHAR}, 198 | 199 | 200 | followup_course = #{record.followupCourse,jdbcType=VARCHAR}, 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | update training_program 209 | set course_id = #{record.courseId,jdbcType=INTEGER}, 210 | course_name = #{record.courseName,jdbcType=VARCHAR}, 211 | course_nature = #{record.courseNature,jdbcType=VARCHAR}, 212 | course_major = #{record.courseMajor,jdbcType=VARCHAR}, 213 | course_teacher = #{record.courseTeacher,jdbcType=VARCHAR}, 214 | course_attributes = #{record.courseAttributes,jdbcType=VARCHAR}, 215 | preliminary_course = #{record.preliminaryCourse,jdbcType=VARCHAR}, 216 | followup_course = #{record.followupCourse,jdbcType=VARCHAR} 217 | 218 | 219 | 220 | 221 | 222 | update training_program 223 | 224 | 225 | course_name = #{courseName,jdbcType=VARCHAR}, 226 | 227 | 228 | course_nature = #{courseNature,jdbcType=VARCHAR}, 229 | 230 | 231 | course_major = #{courseMajor,jdbcType=VARCHAR}, 232 | 233 | 234 | course_teacher = #{courseTeacher,jdbcType=VARCHAR}, 235 | 236 | 237 | course_attributes = #{courseAttributes,jdbcType=VARCHAR}, 238 | 239 | 240 | preliminary_course = #{preliminaryCourse,jdbcType=VARCHAR}, 241 | 242 | 243 | followup_course = #{followupCourse,jdbcType=VARCHAR}, 244 | 245 | 246 | where course_id = #{courseId,jdbcType=INTEGER} 247 | 248 | 249 | update training_program 250 | set course_name = #{courseName,jdbcType=VARCHAR}, 251 | course_nature = #{courseNature,jdbcType=VARCHAR}, 252 | course_major = #{courseMajor,jdbcType=VARCHAR}, 253 | course_teacher = #{courseTeacher,jdbcType=VARCHAR}, 254 | course_attributes = #{courseAttributes,jdbcType=VARCHAR}, 255 | preliminary_course = #{preliminaryCourse,jdbcType=VARCHAR}, 256 | followup_course = #{followupCourse,jdbcType=VARCHAR} 257 | where course_id = #{courseId,jdbcType=INTEGER} 258 | 259 | 262 | -------------------------------------------------------------------------------- /src/main/resources/mapper/UStudentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | and ${criterion.condition} 17 | 18 | 19 | and ${criterion.condition} #{criterion.value} 20 | 21 | 22 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 23 | 24 | 25 | and ${criterion.condition} 26 | 27 | #{listItem} 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | and ${criterion.condition} 46 | 47 | 48 | and ${criterion.condition} #{criterion.value} 49 | 50 | 51 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 52 | 53 | 54 | and ${criterion.condition} 55 | 56 | #{listItem} 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | ID, password 68 | 69 | 83 | 89 | 90 | delete from u_student 91 | where ID = #{id,jdbcType=VARCHAR} 92 | 93 | 94 | delete from u_student 95 | 96 | 97 | 98 | 99 | 100 | insert into u_student (ID, password) 101 | values (#{id,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}) 102 | 103 | 104 | insert into u_student 105 | 106 | 107 | ID, 108 | 109 | 110 | password, 111 | 112 | 113 | 114 | 115 | #{id,jdbcType=VARCHAR}, 116 | 117 | 118 | #{password,jdbcType=VARCHAR}, 119 | 120 | 121 | 122 | 128 | 129 | update u_student 130 | 131 | 132 | ID = #{record.id,jdbcType=VARCHAR}, 133 | 134 | 135 | password = #{record.password,jdbcType=VARCHAR}, 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | update u_student 144 | set ID = #{record.id,jdbcType=VARCHAR}, 145 | password = #{record.password,jdbcType=VARCHAR} 146 | 147 | 148 | 149 | 150 | 151 | update u_student 152 | 153 | 154 | password = #{password,jdbcType=VARCHAR}, 155 | 156 | 157 | where ID = #{id,jdbcType=VARCHAR} 158 | 159 | 160 | update u_student 161 | set password = #{password,jdbcType=VARCHAR} 162 | where ID = #{id,jdbcType=VARCHAR} 163 | 164 | -------------------------------------------------------------------------------- /src/main/resources/mapper/UTeacherMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | and ${criterion.condition} 18 | 19 | 20 | and ${criterion.condition} #{criterion.value} 21 | 22 | 23 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 24 | 25 | 26 | and ${criterion.condition} 27 | 28 | #{listItem} 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | and ${criterion.condition} 47 | 48 | 49 | and ${criterion.condition} #{criterion.value} 50 | 51 | 52 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 53 | 54 | 55 | and ${criterion.condition} 56 | 57 | #{listItem} 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | ID, username, password 69 | 70 | 84 | 90 | 91 | delete from u_teacher 92 | where ID = #{id,jdbcType=VARCHAR} 93 | 94 | 95 | delete from u_teacher 96 | 97 | 98 | 99 | 100 | 101 | insert into u_teacher (ID, username, password 102 | ) 103 | values (#{id,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR} 104 | ) 105 | 106 | 107 | insert into u_teacher 108 | 109 | 110 | ID, 111 | 112 | 113 | username, 114 | 115 | 116 | password, 117 | 118 | 119 | 120 | 121 | #{id,jdbcType=VARCHAR}, 122 | 123 | 124 | #{username,jdbcType=VARCHAR}, 125 | 126 | 127 | #{password,jdbcType=VARCHAR}, 128 | 129 | 130 | 131 | 137 | 138 | update u_teacher 139 | 140 | 141 | ID = #{record.id,jdbcType=VARCHAR}, 142 | 143 | 144 | username = #{record.username,jdbcType=VARCHAR}, 145 | 146 | 147 | password = #{record.password,jdbcType=VARCHAR}, 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | update u_teacher 156 | set ID = #{record.id,jdbcType=VARCHAR}, 157 | username = #{record.username,jdbcType=VARCHAR}, 158 | password = #{record.password,jdbcType=VARCHAR} 159 | 160 | 161 | 162 | 163 | 164 | update u_teacher 165 | 166 | 167 | username = #{username,jdbcType=VARCHAR}, 168 | 169 | 170 | password = #{password,jdbcType=VARCHAR}, 171 | 172 | 173 | where ID = #{id,jdbcType=VARCHAR} 174 | 175 | 176 | update u_teacher 177 | set username = #{username,jdbcType=VARCHAR}, 178 | password = #{password,jdbcType=VARCHAR} 179 | where ID = #{id,jdbcType=VARCHAR} 180 | 181 | -------------------------------------------------------------------------------- /src/main/resources/mapper/UtSecretaryMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | and ${criterion.condition} 18 | 19 | 20 | and ${criterion.condition} #{criterion.value} 21 | 22 | 23 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 24 | 25 | 26 | and ${criterion.condition} 27 | 28 | #{listItem} 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | and ${criterion.condition} 47 | 48 | 49 | and ${criterion.condition} #{criterion.value} 50 | 51 | 52 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 53 | 54 | 55 | and ${criterion.condition} 56 | 57 | #{listItem} 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | ID, username, password 69 | 70 | 84 | 90 | 91 | delete from u_tsecretary 92 | where ID = #{id,jdbcType=VARCHAR} 93 | 94 | 95 | delete from u_tsecretary 96 | 97 | 98 | 99 | 100 | 101 | insert into u_tsecretary (ID, username, password 102 | ) 103 | values (#{id,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR} 104 | ) 105 | 106 | 107 | insert into u_tsecretary 108 | 109 | 110 | ID, 111 | 112 | 113 | username, 114 | 115 | 116 | password, 117 | 118 | 119 | 120 | 121 | #{id,jdbcType=VARCHAR}, 122 | 123 | 124 | #{username,jdbcType=VARCHAR}, 125 | 126 | 127 | #{password,jdbcType=VARCHAR}, 128 | 129 | 130 | 131 | 137 | 138 | update u_tsecretary 139 | 140 | 141 | ID = #{record.id,jdbcType=VARCHAR}, 142 | 143 | 144 | username = #{record.username,jdbcType=VARCHAR}, 145 | 146 | 147 | password = #{record.password,jdbcType=VARCHAR}, 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | update u_tsecretary 156 | set ID = #{record.id,jdbcType=VARCHAR}, 157 | username = #{record.username,jdbcType=VARCHAR}, 158 | password = #{record.password,jdbcType=VARCHAR} 159 | 160 | 161 | 162 | 163 | 164 | update u_tsecretary 165 | 166 | 167 | username = #{username,jdbcType=VARCHAR}, 168 | 169 | 170 | password = #{password,jdbcType=VARCHAR}, 171 | 172 | 173 | where ID = #{id,jdbcType=VARCHAR} 174 | 175 | 176 | update u_tsecretary 177 | set username = #{username,jdbcType=VARCHAR}, 178 | password = #{password,jdbcType=VARCHAR} 179 | where ID = #{id,jdbcType=VARCHAR} 180 | 181 | -------------------------------------------------------------------------------- /src/main/resources/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/dispatcherServlet-servlet.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/pages/login.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 | 3 | 4 | 登录 5 | <% 6 | pageContext.setAttribute("APP_PATH", request.getContextPath()); 7 | %> 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |
19 |

CAPTITAL NORMAL UNIVERSITY Cultivation management system

20 | 26 |
27 | 28 |
29 |
30 | 31 | 32 | 33 |
34 | 35 |
36 |
37 |

Log in

38 |

39 | 40 | 41 |

42 |

43 | 44 | 46 |

47 | 50 |

51 | 学生登录 52 |

53 |
54 |
55 | 56 |
57 |
58 |

Log in

59 |

60 | 61 | 62 |

63 |

64 | 65 | 67 |

68 | 71 |

72 | 教师登录 73 |

74 |
75 |
76 | 77 |
78 |
79 |

Log in

80 |

81 | 82 | 83 |

84 |

85 | 86 | 88 |

89 | 92 |

93 | 教秘登录 94 |

95 |
96 |
97 | 98 |
99 |
100 |
101 | 102 |
103 | 181 | 182 | 183 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/pages/stu_index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 | 3 | 4 | 学生教务系统 5 | <% 6 | pageContext.setAttribute("APP_PATH",request.getContextPath()); 7 | %> 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | <%--导航栏--%> 16 | 41 | <%--培养方案--%> 42 |
43 |
44 |
45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 |
课程性质课程号课程名开课专业教师课程属性前导课后续课选择
61 |
62 |
63 |
64 | <%--选课管理--%> 65 |
66 |
67 |
68 | 75 |
76 |
77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 |
课程号课程名课程性质课程状态操作
89 |
90 |
91 |
92 | <%--成绩查询--%> 93 |
94 |
95 |
96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 |
课程号课程名课程性质成绩
107 |
108 |
109 |
110 | 283 | 284 | 285 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | contextConfigLocation 10 | classpath:applicationContext.xml 11 | 12 | 13 | org.springframework.web.context.ContextLoaderListener 14 | 15 | 16 | 17 | 18 | dispatcherServlet 19 | org.springframework.web.servlet.DispatcherServlet 20 | 1 21 | 22 | 23 | dispatcherServlet 24 | / 25 | 26 | 27 | 28 | 29 | CharacterEncodingFilter 30 | org.springframework.web.filter.CharacterEncodingFilter 31 | 32 | encoding 33 | utf-8 34 | 35 | 36 | forceRequestEncoding 37 | true 38 | 39 | 40 | forceResponseEncoding 41 | true 42 | 43 | 44 | 45 | CharacterEncodingFilter 46 | /* 47 | 48 | 49 | 50 | 51 | LoginFilter 52 | com.example.experiment2.filter.LoginFilter 53 | 54 | 55 | LoginFilter 56 | /* 57 | 58 | 59 | 60 | 61 | HiddenHttpMethodFilter 62 | org.springframework.web.filter.HiddenHttpMethodFilter 63 | 64 | 65 | HiddenHttpMethodFilter 66 | /* 67 | 68 | 69 | 70 | 71 | HttpPutFormContentFilter 72 | org.springframework.web.filter.HttpPutFormContentFilter 73 | 74 | 75 | HttpPutFormContentFilter 76 | /* 77 | 78 | 79 | -------------------------------------------------------------------------------- /src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> 2 | -------------------------------------------------------------------------------- /src/main/webapp/static/bootstrap-3.3.7-dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangHu17/Course_Selection_and_Grade_Management_system/42830b502f488b8e728074bc2818f3d2d365241b/src/main/webapp/static/bootstrap-3.3.7-dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /src/main/webapp/static/bootstrap-3.3.7-dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangHu17/Course_Selection_and_Grade_Management_system/42830b502f488b8e728074bc2818f3d2d365241b/src/main/webapp/static/bootstrap-3.3.7-dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /src/main/webapp/static/bootstrap-3.3.7-dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangHu17/Course_Selection_and_Grade_Management_system/42830b502f488b8e728074bc2818f3d2d365241b/src/main/webapp/static/bootstrap-3.3.7-dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/main/webapp/static/bootstrap-3.3.7-dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangHu17/Course_Selection_and_Grade_Management_system/42830b502f488b8e728074bc2818f3d2d365241b/src/main/webapp/static/bootstrap-3.3.7-dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /src/main/webapp/static/bootstrap-3.3.7-dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /src/main/webapp/static/css/demo.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'BebasNeueRegular'; 3 | src: url('../fonts/BebasNeue-webfont.eot'); 4 | src: url('../fonts/BebasNeue-webfont.eot?#iefix') format('embedded-opentype'), 5 | url('../fonts/BebasNeue-webfont.woff') format('woff'), 6 | url('../fonts/BebasNeue-webfont.ttf') format('truetype'), 7 | url('../fonts/BebasNeue-webfont.svg#BebasNeueRegular') format('svg'); 8 | font-weight: normal; 9 | font-style: normal; 10 | } 11 | /* CSS reset */ 12 | body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td { 13 | margin:0; 14 | padding:0; 15 | } 16 | html,body { 17 | margin:0; 18 | padding:0; 19 | height: 100%; 20 | } 21 | table { 22 | border-collapse:collapse; 23 | border-spacing:0; 24 | } 25 | fieldset,img { 26 | border:0; 27 | } 28 | address,caption,cite,code,dfn,th,var { 29 | font-style:normal; 30 | font-weight:normal; 31 | } 32 | ol,ul { 33 | list-style:none; 34 | } 35 | caption,th { 36 | text-align:left; 37 | } 38 | h1,h2,h3,h4,h5,h6 { 39 | font-size:100%; 40 | font-weight:normal; 41 | } 42 | q:before,q:after { 43 | content:''; 44 | } 45 | abbr,acronym { border:0; 46 | } 47 | article, aside, details, figcaption, figure, 48 | footer, header, hgroup, menu, nav, section { 49 | display: block; 50 | } 51 | /* General Demo Style */ 52 | body{ 53 | font-family: Cambria, Palatino, "Palatino Linotype", "Palatino LT STD", Georgia, serif; 54 | background: #fff url(../imgs/bg.jpg) repeat top left; 55 | font-weight: 400; 56 | font-size: 15px; 57 | color: #1d3c41; 58 | overflow-y: scroll; 59 | } 60 | a{ 61 | color: #333; 62 | text-decoration: none; 63 | } 64 | .container{ 65 | width: 100%; 66 | height: 100%; 67 | position: relative; 68 | text-align: center; 69 | } 70 | .clr{ 71 | clear: both; 72 | } 73 | .container > header{ 74 | padding: 20px 30px 10px 30px; 75 | margin: 0px 20px 10px 20px; 76 | position: relative; 77 | display: block; 78 | text-shadow: 1px 1px 1px rgba(0,0,0,0.2); 79 | text-align: center; 80 | } 81 | .container > header h1{ 82 | font-family: 'BebasNeueRegular', 'Arial Narrow', Arial, sans-serif; 83 | font-size: 35px; 84 | line-height: 35px; 85 | position: relative; 86 | font-weight: 400; 87 | color: rgba(26,89,120,0.9); 88 | text-shadow: 1px 1px 1px rgba(0,0,0,0.1); 89 | padding: 0px 0px 5px 0px; 90 | } 91 | .container > header h1 span{ 92 | color: #7cbcd6; 93 | text-shadow: 0px 1px 1px rgba(255,255,255,0.8); 94 | } 95 | .container > header h2{ 96 | font-size: 16px; 97 | font-style: italic; 98 | color: #2d6277; 99 | text-shadow: 0px 1px 1px rgba(255,255,255,0.8); 100 | } 101 | /* Header Style */ 102 | .codrops-top{ 103 | line-height: 24px; 104 | font-size: 11px; 105 | background: rgba(255, 255, 255, 0.4); 106 | text-transform: uppercase; 107 | z-index: 9999; 108 | position: relative; 109 | box-shadow: 1px 0px 2px rgba(0,0,0,0.2); 110 | } 111 | .codrops-top a{ 112 | padding: 0px 10px; 113 | letter-spacing: 1px; 114 | color: #333; 115 | text-shadow: 0px 1px 1px #fff; 116 | display: block; 117 | float: left; 118 | } 119 | .codrops-top a:hover{ 120 | background: #fff; 121 | } 122 | .codrops-top span.right{ 123 | float: right; 124 | } 125 | .codrops-top span.right a{ 126 | float: left; 127 | display: block; 128 | } 129 | 130 | .codrops-demos{ 131 | text-align:center; 132 | display: block; 133 | padding: 14px; 134 | } 135 | .codrops-demos span{ 136 | display: inline-block; 137 | padding-right: 15px; 138 | text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.8); 139 | } 140 | .codrops-demos a, 141 | .codrops-demos a.current-demo, 142 | .codrops-demos a.current-demo:hover{ 143 | display: inline-block; 144 | font-style: italic; 145 | font-size: 12px; 146 | padding: 3px 5px; 147 | margin: 0px 3px; 148 | font-weight: 800; 149 | box-shadow: 1px 1px 1px rgba(0,0,0,0.05) inset; 150 | color: #fff; 151 | text-shadow: 1px 1px 1px rgba(0,0,0,0.1); 152 | background: rgba(104,171,194,0.5); 153 | } 154 | .codrops-demos a:hover{ 155 | background: #4fa2c4; 156 | } 157 | .codrops-demos a.current-demo, 158 | .codrops-demos a.current-demo:hover{ 159 | color: rgba(104,171,194,1); 160 | background: rgba(255,255,255,0.9); 161 | box-shadow: 0px 1px 1px rgba(0,0,0,0.1); 162 | } 163 | -------------------------------------------------------------------------------- /src/main/webapp/static/css/my.css: -------------------------------------------------------------------------------- 1 | #trainingProgramsIndex,#stuCurriculumIndex,#gradeViewIndex 2 | ,#teachingManagementIndex,#gradesManagementIndex,#coursesTaughtIndex 3 | ,#trainingProgramsIndex,#gradesManagementIndex{ 4 | display: none; 5 | } 6 | .show{ 7 | display: block; 8 | } 9 | #search_form{ 10 | float: right!important; 11 | margin-top: 0; 12 | } 13 | #search_form input{ 14 | width: 120px; 15 | } 16 | #course_ul{ 17 | margin-top: 10px; 18 | } 19 | #selected_major_and_class{ 20 | margin-top: 10px; 21 | display: none; 22 | } 23 | .hide_this{ 24 | display: none; 25 | } -------------------------------------------------------------------------------- /src/main/webapp/static/css/style.css: -------------------------------------------------------------------------------- 1 | /* remove codrops styles and reset the whole thing */ 2 | #container_demo{ 3 | text-align: left; 4 | margin: 0; 5 | padding: 0; 6 | margin: 0 auto; 7 | font-family: "Trebuchet MS","Myriad Pro",Arial,sans-serif; 8 | } 9 | 10 | /** fonts used for the icons **/ 11 | @font-face { 12 | font-family: 'FontomasCustomRegular'; 13 | src: url('../fonts/fontomas-webfont.eot'); 14 | src: url('../fonts/fontomas-webfont.eot?#iefix') format('embedded-opentype'), 15 | url('../fonts/fontomas-webfont.woff') format('woff'), 16 | url('../fonts/fontomas-webfont.ttf') format('truetype'), 17 | url('../fonts/fontomas-webfont.svg#FontomasCustomRegular') format('svg'); 18 | font-weight: normal; 19 | font-style: normal; 20 | } 21 | @font-face { 22 | font-family: 'FranchiseRegular'; 23 | src: url('../fonts/franchise-bold-webfont.eot'); 24 | src: url('../fonts/franchise-bold-webfont.eot?#iefix') format('embedded-opentype'), 25 | url('../fonts/franchise-bold-webfont.woff') format('woff'), 26 | url('../fonts/franchise-bold-webfont.ttf') format('truetype'), 27 | url('../fonts/franchise-bold-webfont.svg#FranchiseRegular') format('svg'); 28 | font-weight: normal; 29 | font-style: normal; 30 | 31 | } 32 | a.hiddenanchor{ 33 | display: none; 34 | } 35 | /** The wrapper that will contain our two forms **/ 36 | #wrapper{ 37 | width: 60%; 38 | right: 0px; 39 | min-height: 560px; 40 | margin: 0px auto; 41 | width: 500px; 42 | position: relative; 43 | } 44 | /**** Styling the form elements **/ 45 | 46 | /**** general text styling ****/ 47 | #wrapper a{ 48 | color: rgb(95, 155, 198); 49 | text-decoration: underline; 50 | } 51 | 52 | #wrapper h1{ 53 | font-size: 48px; 54 | color: rgb(6, 106, 117); 55 | padding: 2px 0 10px 0; 56 | font-family: 'FranchiseRegular','Arial Narrow',Arial,sans-serif; 57 | font-weight: bold; 58 | text-align: center; 59 | padding-bottom: 30px; 60 | } 61 | /** For the moment only webkit supports the background-clip:text; */ 62 | #wrapper h1{ 63 | background: -webkit-repeating-linear-gradient(-45deg, 64 | rgb(18, 83, 93) , 65 | rgb(18, 83, 93) 20px, 66 | rgb(64, 111, 118) 20px, 67 | rgb(64, 111, 118) 40px, 68 | rgb(18, 83, 93) 40px); 69 | -webkit-text-fill-color: transparent; 70 | -webkit-background-clip: text; 71 | } 72 | #wrapper h1:after{ 73 | content: ' '; 74 | display: block; 75 | width: 100%; 76 | height: 2px; 77 | margin-top: 10px; 78 | background: -moz-linear-gradient(left, rgba(147,184,189,0) 0%, rgba(147,184,189,0.8) 20%, rgba(147,184,189,1) 53%, rgba(147,184,189,0.8) 79%, rgba(147,184,189,0) 100%); 79 | background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(147,184,189,0)), color-stop(20%,rgba(147,184,189,0.8)), color-stop(53%,rgba(147,184,189,1)), color-stop(79%,rgba(147,184,189,0.8)), color-stop(100%,rgba(147,184,189,0))); 80 | background: -webkit-linear-gradient(left, rgba(147,184,189,0) 0%,rgba(147,184,189,0.8) 20%,rgba(147,184,189,1) 53%,rgba(147,184,189,0.8) 79%,rgba(147,184,189,0) 100%); 81 | background: -o-linear-gradient(left, rgba(147,184,189,0) 0%,rgba(147,184,189,0.8) 20%,rgba(147,184,189,1) 53%,rgba(147,184,189,0.8) 79%,rgba(147,184,189,0) 100%); 82 | background: -ms-linear-gradient(left, rgba(147,184,189,0) 0%,rgba(147,184,189,0.8) 20%,rgba(147,184,189,1) 53%,rgba(147,184,189,0.8) 79%,rgba(147,184,189,0) 100%); 83 | background: linear-gradient(left, rgba(147,184,189,0) 0%,rgba(147,184,189,0.8) 20%,rgba(147,184,189,1) 53%,rgba(147,184,189,0.8) 79%,rgba(147,184,189,0) 100%); 84 | } 85 | 86 | #wrapper p{ 87 | margin-bottom:15px; 88 | } 89 | #wrapper p:first-child{ 90 | margin: 0px; 91 | } 92 | #wrapper label{ 93 | color: rgb(64, 92, 96); 94 | position: relative; 95 | } 96 | 97 | /**** advanced input styling ****/ 98 | /* placeholder */ 99 | ::-webkit-input-placeholder { 100 | color: rgb(190, 188, 188); 101 | font-style: italic; 102 | } 103 | input:-moz-placeholder, 104 | textarea:-moz-placeholder{ 105 | color: rgb(190, 188, 188); 106 | font-style: italic; 107 | } 108 | input { 109 | outline: none; 110 | } 111 | 112 | /* all the input except submit and checkbox */ 113 | #wrapper input:not([type="checkbox"]){ 114 | width: 92%; 115 | margin-top: 4px; 116 | padding: 10px 5px 10px 32px; 117 | border: 1px solid rgb(178, 178, 178); 118 | -webkit-appearance: textfield; 119 | -webkit-box-sizing: content-box; 120 | -moz-box-sizing : content-box; 121 | box-sizing : content-box; 122 | -webkit-border-radius: 3px; 123 | -moz-border-radius: 3px; 124 | border-radius: 3px; 125 | -webkit-box-shadow: 0px 1px 4px 0px rgba(168, 168, 168, 0.6) inset; 126 | -moz-box-shadow: 0px 1px 4px 0px rgba(168, 168, 168, 0.6) inset; 127 | box-shadow: 0px 1px 4px 0px rgba(168, 168, 168, 0.6) inset; 128 | -webkit-transition: all 0.2s linear; 129 | -moz-transition: all 0.2s linear; 130 | -o-transition: all 0.2s linear; 131 | transition: all 0.2s linear; 132 | } 133 | #wrapper input:not([type="checkbox"]):active, 134 | #wrapper input:not([type="checkbox"]):focus{ 135 | border: 1px solid rgba(91, 90, 90, 0.7); 136 | background: rgba(238, 236, 240, 0.2); 137 | -webkit-box-shadow: 0px 1px 4px 0px rgba(168, 168, 168, 0.9) inset; 138 | -moz-box-shadow: 0px 1px 4px 0px rgba(168, 168, 168, 0.9) inset; 139 | box-shadow: 0px 1px 4px 0px rgba(168, 168, 168, 0.9) inset; 140 | } 141 | 142 | /** the magic icon trick ! **/ 143 | [data-icon]:after { 144 | content: attr(data-icon); 145 | font-family: 'FontomasCustomRegular'; 146 | color: rgb(106, 159, 171); 147 | position: absolute; 148 | left: 10px; 149 | top: 35px; 150 | width: 30px; 151 | } 152 | 153 | /*styling both submit buttons */ 154 | #wrapper p.button input{ 155 | width: 30%; 156 | cursor: pointer; 157 | background: rgb(61, 157, 179); 158 | padding: 8px 5px; 159 | font-family: 'BebasNeueRegular','Arial Narrow',Arial,sans-serif; 160 | color: #fff; 161 | font-size: 24px; 162 | border: 1px solid rgb(28, 108, 122); 163 | margin-bottom: 10px; 164 | text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5); 165 | -webkit-border-radius: 3px; 166 | -moz-border-radius: 3px; 167 | border-radius: 3px; 168 | -webkit-box-shadow: 0px 1px 6px 4px rgba(0, 0, 0, 0.07) inset, 169 | 0px 0px 0px 3px rgb(254, 254, 254), 170 | 0px 5px 3px 3px rgb(210, 210, 210); 171 | -moz-box-shadow:0px 1px 6px 4px rgba(0, 0, 0, 0.07) inset, 172 | 0px 0px 0px 3px rgb(254, 254, 254), 173 | 0px 5px 3px 3px rgb(210, 210, 210); 174 | box-shadow:0px 1px 6px 4px rgba(0, 0, 0, 0.07) inset, 175 | 0px 0px 0px 3px rgb(254, 254, 254), 176 | 0px 5px 3px 3px rgb(210, 210, 210); 177 | -webkit-transition: all 0.2s linear; 178 | -moz-transition: all 0.2s linear; 179 | -o-transition: all 0.2s linear; 180 | transition: all 0.2s linear; 181 | } 182 | #wrapper p.button input:hover{ 183 | background: rgb(74, 179, 198); 184 | } 185 | #wrapper p.button input:active, 186 | #wrapper p.button input:focus{ 187 | background: rgb(40, 137, 154); 188 | position: relative; 189 | top: 1px; 190 | border: 1px solid rgb(12, 76, 87); 191 | -webkit-box-shadow: 0px 1px 6px 4px rgba(0, 0, 0, 0.2) inset; 192 | -moz-box-shadow: 0px 1px 6px 4px rgba(0, 0, 0, 0.2) inset; 193 | box-shadow: 0px 1px 6px 4px rgba(0, 0, 0, 0.2) inset; 194 | } 195 | p.login.button, 196 | p.signin.button{ 197 | text-align: right; 198 | margin: 5px 0; 199 | } 200 | 201 | /*styling the links to change from one form to another */ 202 | 203 | p.character{ 204 | position: absolute; 205 | color: rgb(127, 124, 124); 206 | left: 0px; 207 | height: 20px; 208 | width: 440px; 209 | padding: 17px 30px 20px 30px; 210 | font-size: 16px ; 211 | text-align: right; 212 | border-top: 1px solid rgb(219, 229, 232); 213 | -webkit-border-radius: 0 0 5px 5px; 214 | -moz-border-radius: 0 0 5px 5px; 215 | border-radius: 0 0 5px 5px; 216 | background: rgb(225, 234, 235); 217 | background: -moz-repeating-linear-gradient(-45deg, 218 | rgb(247, 247, 247) , 219 | rgb(247, 247, 247) 15px, 220 | rgb(225, 234, 235) 15px, 221 | rgb(225, 234, 235) 30px, 222 | rgb(247, 247, 247) 30px 223 | ); 224 | background: -webkit-repeating-linear-gradient(-45deg, 225 | rgb(247, 247, 247) , 226 | rgb(247, 247, 247) 15px, 227 | rgb(225, 234, 235) 15px, 228 | rgb(225, 234, 235) 30px, 229 | rgb(247, 247, 247) 30px 230 | ); 231 | background: -o-repeating-linear-gradient(-45deg, 232 | rgb(247, 247, 247) , 233 | rgb(247, 247, 247) 15px, 234 | rgb(225, 234, 235) 15px, 235 | rgb(225, 234, 235) 30px, 236 | rgb(247, 247, 247) 30px 237 | ); 238 | background: repeating-linear-gradient(-45deg, 239 | rgb(247, 247, 247) , 240 | rgb(247, 247, 247) 15px, 241 | rgb(225, 234, 235) 15px, 242 | rgb(225, 234, 235) 30px, 243 | rgb(247, 247, 247) 30px 244 | ); 245 | } 246 | #wrapper p.character a { 247 | display: inline-block; 248 | font-weight: bold; 249 | background: rgb(247, 248, 241); 250 | padding: 2px 6px; 251 | color: rgb(29, 162, 193); 252 | margin-left: 10px; 253 | text-decoration: none; 254 | -webkit-border-radius: 4px; 255 | -moz-border-radius: 4px; 256 | border-radius: 4px; 257 | border: 1px solid rgb(203, 213, 214); 258 | -webkit-transition: all 0.4s linear; 259 | -moz-transition: all 0.4s linear; 260 | -o-transition: all 0.4s linear; 261 | -ms-transition: all 0.4s linear; 262 | transition: all 0.4s linear; 263 | } 264 | #wrapper p.character a:hover { 265 | color: rgb(57, 191, 215); 266 | background: rgb(247, 247, 247); 267 | border: 1px solid rgb(74, 179, 198); 268 | } 269 | #wrapper p.character a:active{ 270 | position: relative; 271 | top: 1px; 272 | } 273 | /** Styling both forms **/ 274 | #sec_login, 275 | #tea_login, 276 | #stu_login{ 277 | position: absolute; 278 | top: 0px; 279 | width: 88%; 280 | padding: 18px 6% 60px 6%; 281 | margin: 0 0 35px 0; 282 | background: rgb(247, 247, 247); 283 | border: 1px solid rgba(147, 184, 189,0.8); 284 | -webkit-box-shadow: 0pt 2px 5px rgba(105, 108, 109, 0.7), 0px 0px 8px 5px rgba(208, 223, 226, 0.4) inset; 285 | -moz-box-shadow: 0pt 2px 5px rgba(105, 108, 109, 0.7), 0px 0px 8px 5px rgba(208, 223, 226, 0.4) inset; 286 | box-shadow: 0pt 2px 5px rgba(105, 108, 109, 0.7), 0px 0px 8px 5px rgba(208, 223, 226, 0.4) inset; 287 | -webkit-box-shadow: 5px; 288 | -moz-border-radius: 5px; 289 | border-radius: 5px; 290 | } 291 | #sec_login{ 292 | z-index: 20; 293 | opacity: 0; 294 | } 295 | #tea_login{ 296 | z-index: 21; 297 | opacity: 0; 298 | } 299 | #stu_login{ 300 | z-index: 22; 301 | } 302 | #to_tea_login:target ~ #wrapper #tea_login, 303 | #to_sec_login:target ~ #wrapper #sec_login, 304 | #to_stu_login:target ~ #wrapper #stu_login{ 305 | z-index: 22; 306 | -webkit-animation-name: fadeInLeft; 307 | -moz-animation-name: fadeInLeft; 308 | -ms-animation-name: fadeInLeft; 309 | -o-animation-name: fadeInLeft; 310 | animation-name: fadeInLeft; 311 | -webkit-animation-delay: .1s; 312 | -moz-animation-delay: .1s; 313 | -o-animation-delay: .1s; 314 | -ms-animation-delay: .1s; 315 | animation-delay: .1s; 316 | } 317 | #to_tea_login:target ~ #wrapper #stu_login, 318 | #to_tea_login:target ~ #wrapper #sec_login, 319 | #to_stu_login:target ~ #wrapper #tea_login, 320 | #to_stu_login:target ~ #wrapper #sec_login, 321 | #to_sec_login:target ~ #wrapper #tea_login, 322 | #to_sec_login:target ~ #wrapper #stu_login{ 323 | -webkit-animation-name: fadeOutLeft; 324 | -moz-animation-name: fadeOutLeft; 325 | -ms-animation-name: fadeOutLeft; 326 | -o-animation-name: fadeOutLeft; 327 | animation-name: fadeOutLeft; 328 | } 329 | 330 | /** the actual animation, credit where due : http://daneden.me/animate/ ***/ 331 | .animate{ 332 | -webkit-animation-duration: 0.5s; 333 | -webkit-animation-timing-function: ease; 334 | -webkit-animation-fill-mode: both; 335 | 336 | -moz-animation-duration: 0.5s; 337 | -moz-animation-timing-function: ease; 338 | -moz-animation-fill-mode: both; 339 | 340 | -o-animation-duration: 0.5s; 341 | -o-animation-timing-function: ease; 342 | -o-animation-fill-mode: both; 343 | 344 | -ms-animation-duration: 0.5s; 345 | -ms-animation-timing-function: ease; 346 | -ms-animation-fill-mode: both; 347 | 348 | animation-duration: 0.5s; 349 | animation-timing-function: ease; 350 | animation-fill-mode: both; 351 | } 352 | 353 | /** yerk some ugly IE fixes 'cause I know someone will ask "why does it look ugly in IE?", no matter how many warnings I will put in the article */ 354 | 355 | .lt8 #wrapper input{ 356 | padding: 10px 5px 10px 32px; 357 | width: 92%; 358 | } 359 | .lt8 #wrapper input[type=checkbox]{ 360 | width: 10px; 361 | padding: 0; 362 | } 363 | .lt8 #wrapper h1{ 364 | color: #066A75; 365 | } 366 | .lt8 #tea_login{ 367 | display: none; 368 | } 369 | .lt8 #sec_login{ 370 | display: none; 371 | } 372 | .lt8 p.character, 373 | .ie9 p.character{ 374 | position: absolute; 375 | height: 90px; 376 | background: transparent; 377 | } -------------------------------------------------------------------------------- /src/main/webapp/static/fonts/BebasNeue-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangHu17/Course_Selection_and_Grade_Management_system/42830b502f488b8e728074bc2818f3d2d365241b/src/main/webapp/static/fonts/BebasNeue-webfont.woff -------------------------------------------------------------------------------- /src/main/webapp/static/fonts/fontomas-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangHu17/Course_Selection_and_Grade_Management_system/42830b502f488b8e728074bc2818f3d2d365241b/src/main/webapp/static/fonts/fontomas-webfont.woff -------------------------------------------------------------------------------- /src/main/webapp/static/fonts/franchise-bold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangHu17/Course_Selection_and_Grade_Management_system/42830b502f488b8e728074bc2818f3d2d365241b/src/main/webapp/static/fonts/franchise-bold-webfont.woff -------------------------------------------------------------------------------- /src/main/webapp/static/fonts/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangHu17/Course_Selection_and_Grade_Management_system/42830b502f488b8e728074bc2818f3d2d365241b/src/main/webapp/static/fonts/icon.png -------------------------------------------------------------------------------- /src/main/webapp/static/imgs/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangHu17/Course_Selection_and_Grade_Management_system/42830b502f488b8e728074bc2818f3d2d365241b/src/main/webapp/static/imgs/bg.jpg -------------------------------------------------------------------------------- /src/mbg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 38 | 39 | 40 | 41 | 42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
-------------------------------------------------------------------------------- /src/test/java/MBGTest.java: -------------------------------------------------------------------------------- 1 | import org.junit.jupiter.api.Test; 2 | import org.mybatis.generator.api.MyBatisGenerator; 3 | import org.mybatis.generator.config.Configuration; 4 | import org.mybatis.generator.config.xml.ConfigurationParser; 5 | import org.mybatis.generator.internal.DefaultShellCallback; 6 | 7 | import java.io.File; 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | /** 12 | * @author wanghu 13 | * @discrption: 14 | * @create 2021-04-24 22:04 15 | */ 16 | public class MBGTest { 17 | 18 | @Test 19 | public void test1() throws Exception { 20 | List warnings = new ArrayList(); 21 | boolean overwrite = true; 22 | File configFile = new File("src/mbg.xml"); 23 | ConfigurationParser cp = new ConfigurationParser(warnings); 24 | Configuration config = cp.parseConfiguration(configFile); 25 | DefaultShellCallback callback = new DefaultShellCallback(overwrite); 26 | MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings); 27 | myBatisGenerator.generate(null); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/test/java/Test.java: -------------------------------------------------------------------------------- 1 | import com.example.experiment2.bean.UStudent; 2 | import com.example.experiment2.dao.UStudentMapper; 3 | import org.apache.ibatis.session.SqlSession; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.test.context.ContextConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | import java.io.IOException; 10 | import java.text.DecimalFormat; 11 | import java.time.Year; 12 | import java.util.ArrayList; 13 | import java.util.List; 14 | import java.util.UUID; 15 | 16 | /** 17 | * @author wanghu 18 | * @discrption: 19 | * @create 2021-05-12 10:52 20 | */ 21 | @RunWith(SpringJUnit4ClassRunner.class) 22 | @ContextConfiguration(locations = {"classpath:applicationContext.xml"}) 23 | public class Test { 24 | 25 | @Autowired 26 | UStudentMapper uStudentMapper; 27 | 28 | @Autowired 29 | SqlSession sqlSession; 30 | 31 | @org.junit.Test 32 | public void testAddStudents() throws IOException { 33 | for (int i=2; i<=50; i++){ 34 | DecimalFormat decimalFormat = new DecimalFormat("00"); 35 | String s = decimalFormat.format(i); 36 | UStudent uStudent = new UStudent("22010020" + s, "20"+s); 37 | uStudentMapper.insert(uStudent); 38 | } 39 | 40 | } 41 | 42 | } 43 | --------------------------------------------------------------------------------