基于javaweb的SSM+Maven学生管理系统(java+ssm+js+jsp+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

560023162402

570023162402

580023162402

590023162402

000023172402

010023172402

基于javaweb的SSM+Maven学生管理系统(java+ssm+js+jsp+mysql)

项目介绍

管理员操作包含以下功能: 管理员登录,学生管理,成绩管理,教师信息管理,课程信息管理,学院管理,专业管理,班级信息管理,用户管理等功能。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;  5.数据库:MySql 5.7版本;

技术栈

  1. 后端:Spring+SpringMVC+Mybatis 2. 前端:HTML+CSS+JavaScript+jsp

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ 登录

1
2
3
4
5
6
7
8
9
10
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
 * 添加专业信息
*
* @return
* @throws Exception
*/
@RequestMapping(value = "addMajor", method = RequestMethod.POST)
@ResponseBody
public Result addMajor(@RequestBody Major major) throws Exception {
int resultTotal;
resultTotal = baseDataService.addMajor(major);
if (resultTotal > 0) {
return ResultGenerator.genSuccessResult();
} else {
return ResultGenerator.genFailResult("FAIL");
}
}

/**
* 修改专业信息
*
* @return
* @throws Exception
*/
@RequestMapping(value = "updateMajor", method = RequestMethod.POST)
@ResponseBody
public Result updateMajor(@RequestBody Major major) throws Exception {
int resultTotal;
resultTotal = baseDataService.updateMajor(major);
if (resultTotal > 0) {
return ResultGenerator.genSuccessResult();
} else {
return ResultGenerator.genFailResult("FAIL");
}
}

/**
* 删除专业信息
*
* @param pkids
* @return
* @throws Exception
*/
@RequestMapping(value = "/deleteMajor/{pkids}", method = RequestMethod.DELETE)
@ResponseBody
public Result deleteMajor(@PathVariable(value = "pkids") String pkids) throws Exception {
1
2
3
4
5
6
7
8
9
10
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
@ResponseBody
public Result save(@RequestBody Student student) throws Exception {
int resultTotal;
resultTotal = studentService.addStudent(student);
if (resultTotal > 0) {
return ResultGenerator.genSuccessResult();
} else {
return ResultGenerator.genFailResult("FAIL");
}
}

/**
* 修改学生信息
*
* @return
* @throws Exception
*/
@RequestMapping(value = "updateSave", method = RequestMethod.POST)
@ResponseBody
public Result updateSave(@RequestBody Student student) throws Exception {
int resultTotal;
resultTotal = studentService.updateStudent(student);
if (resultTotal > 0) {
return ResultGenerator.genSuccessResult();
} else {
return ResultGenerator.genFailResult("FAIL");
}
}

/**
* 删除
*
* @param pkids
* @return
* @throws Exception
*/
@RequestMapping(value = "/delete/{pkids}", method = RequestMethod.DELETE)
@ResponseBody
public Result delete(@PathVariable(value = "pkids") String pkids) throws Exception {
String[] pkidArr = pkids.split(",");
studentService.deleteStudent(pkidArr);
1
2
3
4
5
6
7
8
9
10
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
@RequestMapping("/baseData")
public class BaseDataController {

@Resource
private BaseDataService baseDataService;

/**
* 添加学院信息
*
* @return
* @throws Exception
*/
@RequestMapping(value = "addDepartment", method = RequestMethod.POST)
@ResponseBody
public Result addDepartment(@RequestBody Department department) throws Exception {
int resultTotal;
resultTotal = baseDataService.addDepartment(department);
if (resultTotal > 0) {
return ResultGenerator.genSuccessResult();
} else {
return ResultGenerator.genFailResult("FAIL");
}
}

/**
* 修改学院信息
*
* @return
* @throws Exception
*/
@RequestMapping(value = "updateDepartment", method = RequestMethod.POST)
@ResponseBody
public Result updateDepartment(@RequestBody Department department) throws Exception {
int resultTotal;
resultTotal = baseDataService.updateDepartment(department);
if (resultTotal > 0) {
return ResultGenerator.genSuccessResult();
} else {
return ResultGenerator.genFailResult("FAIL");
}
}

/**
* 删除学院信息
*
* @param pkids
1
2
3
4
5
6
7
8
9
10
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
@RequestMapping(value = "/dataGrid", method = RequestMethod.POST)
public String list(@RequestParam(value = "page", required = false) String page, @RequestParam(value = "rows", required = false) String rows,
@RequestParam(value = "table") String table,
HttpServletResponse response,
@RequestParam(value = "xm",required = false) String xm,
@RequestParam(value = "teacherName",required = false) String teacherName,
@RequestParam(value = "courseName",required = false) String courseName,
@RequestParam(value = "majorName",required = false) String majorName,
@RequestParam(value = "department_name",required = false) String department_name,
@RequestParam(value = "className",required = false) String className,
@RequestParam(value = "user_name",required = false) String user_name

) throws Exception {
boolean flag = false;
Map<String, Object> map = new HashMap<>();
if(xm == null) {
map.put("where", "where 1 = 1");
}else if(xm != null){
flag = true;
map.put("where", "where xm like '%"+xm+"%'");
}
if(teacherName == null&&flag == false) {
map.put("where", "where 1 = 1");
}else if(teacherName != null){
flag = true;
map.put("where", "where teacherName like '%"+teacherName+"%'");
}
if(courseName == null&&flag == false) {
map.put("where", "where 1 = 1");
}else if(courseName != null){
flag = true;
map.put("where", "where courseName like '%"+courseName+"%'");
}
if(majorName == null&&flag == false) {
map.put("where", "where 1 = 1");
}else if(majorName != null){
flag = true;
map.put("where", "where majorName like '%"+majorName+"%'");
}
if(department_name == null&&flag == false) {
map.put("where", "where 1 = 1");
}else if(department_name != null){
flag = true;
map.put("where", "where department_name like '%"+department_name+"%'");
}
if(className == null&&flag == false) {
map.put("where", "where 1 = 1");
}else if(className != null){
flag = true;
map.put("where", "where className like '%"+className+"%'");
}
if(user_name == null&&flag == false) {
1
2
3
4
5
6
7
8
9
10
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
     * 删除
*
* @param pkids
* @return
* @throws Exception
*/
@RequestMapping(value = "/delete/{pkids}", method = RequestMethod.DELETE)
@ResponseBody
public Result delete(@PathVariable(value = "pkids") String pkids) throws Exception {
String[] pkidArr = pkids.split(",");
courseService.delete(pkidArr);
return ResultGenerator.genSuccessResult();
}

/**
* 删除班级信息
*
* @param pkids
* @return
* @throws Exception
*/
@RequestMapping(value = "/deleteClass/{pkids}", method = RequestMethod.DELETE)
@ResponseBody
public Result deleteClass(@PathVariable(value = "pkids") String pkids) throws Exception {
String[] pkidArr = pkids.split(",");
courseService.delete(pkidArr);
return ResultGenerator.genSuccessResult();
}

}
package com.wq.controller;



/**
* 教师信息管理Controller类
1
2
3
4
5
6
7
8
9
10
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

/**
* 删除专业信息
*
* @param pkids
* @return
* @throws Exception
*/
@RequestMapping(value = "/deleteMajor/{pkids}", method = RequestMethod.DELETE)
@ResponseBody
public Result deleteMajor(@PathVariable(value = "pkids") String pkids) throws Exception {
String[] pkidArr = pkids.split(",");
baseDataService.deleteMajor(pkidArr);
return ResultGenerator.genSuccessResult();
}

/**
* 添加班级信息
*
* @return
* @throws Exception
*/
@RequestMapping(value = "addClass", method = RequestMethod.POST)
@ResponseBody
public Result addClass(@RequestBody Class cls) throws Exception {
int resultTotal;
resultTotal = baseDataService.addClass(cls);
if (resultTotal > 0) {
return ResultGenerator.genSuccessResult();
} else {
return ResultGenerator.genFailResult("FAIL");
}
}

/**
* 修改班级信息
*
* @return
* @throws Exception
*/
@RequestMapping(value = "updateClass", method = RequestMethod.POST)
@ResponseBody
public Result updateClass(@RequestBody Class cls) throws Exception {
int resultTotal;
resultTotal = baseDataService.updateClass(cls);
if (resultTotal > 0) {
return ResultGenerator.genSuccessResult();


项目链接:
https://javayms.github.io?id=322322092805200mj
https://javayms.pages.dev?id=322322092805200mj