diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index 03d9549..a8ad3c7 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -2,5 +2,41 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/student/springboot/src/main/java/com/example/controller/CourseController.java b/student/springboot/src/main/java/com/example/controller/CourseController.java
index 939a575..19e007a 100644
--- a/student/springboot/src/main/java/com/example/controller/CourseController.java
+++ b/student/springboot/src/main/java/com/example/controller/CourseController.java
@@ -4,10 +4,7 @@ import com.example.common.Result;
import com.example.entity.Course;
import com.example.service.CourseService;
import com.github.pagehelper.PageInfo;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -18,12 +15,41 @@ public class CourseController {
@Resource
private CourseService courseService;
+ /*
+ 分页条件查询课程
+ */
@GetMapping("/selectPage")
public Result selectPage(@RequestParam(defaultValue = "1") Integer pageNum,
- @RequestParam(defaultValue = "5") Integer pageSize){
- PageInfo pageInfo = courseService.selectPage(pageNum, pageSize);
+ @RequestParam(defaultValue = "5") Integer pageSize,
+ Course course){
+ PageInfo pageInfo = courseService.selectPage(pageNum, pageSize,course);
return Result.success(pageInfo);
}
+ /*
+ 新增课程
+ */
+ @PostMapping("/add")
+ public Result add(@RequestBody Course course){
+ courseService.add(course);
+ return Result.success();
+ }
+
+ /*
+ 更新课程
+ */
+ @PutMapping ("/update")
+ public Result update(@RequestBody Course course){
+ courseService.updateById(course);
+ return Result.success();
+ }
+ /*
+ 删除课程
+ */
+ @DeleteMapping("/delete/{id}")
+ public Result delete(@PathVariable Integer id){
+ courseService.deleteById(id);
+ return Result.success();
+ }
}
diff --git a/student/springboot/src/main/java/com/example/mapper/CourseMapper.java b/student/springboot/src/main/java/com/example/mapper/CourseMapper.java
index 7f54c87..fd41479 100644
--- a/student/springboot/src/main/java/com/example/mapper/CourseMapper.java
+++ b/student/springboot/src/main/java/com/example/mapper/CourseMapper.java
@@ -1,12 +1,25 @@
package com.example.mapper;
import com.example.entity.Course;
+import org.apache.ibatis.annotations.Delete;
+import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
import java.util.List;
public interface CourseMapper {
- @Select("select * from course order by id desc")
- List selectAll();
+ @Select("select * from course where name like concat('%',#{name},'%') and no like concat('%',#{no},'%') " +
+ "and teacher like concat('%',#{teacher},'%') order by id desc")
+ List selectAll(Course course);
+
+ @Insert("insert into course(name,no,descr,times,teacher) values (#{name},#{no},#{descr},#{times},#{teacher})")
+ void insert(Course course);
+
+ @Update("update course set name = #{name},no = #{name},descr = #{descr},times = #{times},teacher = #{teacher} where id = #{id}")
+ void updateById(Course course);
+
+ @Delete("delete from course where id = #{id}")
+ void deleteById(Integer id);
}
diff --git a/student/springboot/src/main/java/com/example/service/CourseService.java b/student/springboot/src/main/java/com/example/service/CourseService.java
index c912dc2..2bde46d 100644
--- a/student/springboot/src/main/java/com/example/service/CourseService.java
+++ b/student/springboot/src/main/java/com/example/service/CourseService.java
@@ -16,9 +16,22 @@ public class CourseService {
//total是查询的总数,list是查询的列表
//当前页码,每页个数
- public PageInfo selectPage(Integer pageNum,Integer pageSize){
+ public PageInfo selectPage(Integer pageNum,Integer pageSize,Course course){
PageHelper.startPage(pageNum,pageSize);
- List courseList = courseMapper.selectAll();
+ List courseList = courseMapper.selectAll(course);
return PageInfo.of(courseList);
}
+
+ //新增数据
+ public void add(Course course){
+ courseMapper.insert(course);
+ }
+
+ public void updateById(Course course) {
+ courseMapper.updateById(course);
+ }
+
+ public void deleteById(Integer id) {
+ courseMapper.deleteById(id);
+ }
}
diff --git a/student/springboot/target/classes/com/example/controller/CourseController.class b/student/springboot/target/classes/com/example/controller/CourseController.class
index 1416ed3..964a39f 100644
Binary files a/student/springboot/target/classes/com/example/controller/CourseController.class and b/student/springboot/target/classes/com/example/controller/CourseController.class differ
diff --git a/student/springboot/target/classes/com/example/mapper/CourseMapper.class b/student/springboot/target/classes/com/example/mapper/CourseMapper.class
index e399cec..55e290e 100644
Binary files a/student/springboot/target/classes/com/example/mapper/CourseMapper.class and b/student/springboot/target/classes/com/example/mapper/CourseMapper.class differ
diff --git a/student/springboot/target/classes/com/example/service/CourseService.class b/student/springboot/target/classes/com/example/service/CourseService.class
index b402397..6068f9b 100644
Binary files a/student/springboot/target/classes/com/example/service/CourseService.class and b/student/springboot/target/classes/com/example/service/CourseService.class differ
diff --git a/student/springboot/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/student/springboot/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
index e06cba2..3cd6f7c 100644
--- a/student/springboot/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
+++ b/student/springboot/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
@@ -1,13 +1,13 @@
-D:\Program\project\student\springboot\src\main\java\com\example\common\CorsConfig.java
-D:\Program\project\student\springboot\src\main\java\com\example\common\Result.java
-D:\Program\project\student\springboot\src\main\java\com\example\service\AdminService.java
-D:\Program\project\student\springboot\src\main\java\com\example\controller\CourseController.java
-D:\Program\project\student\springboot\src\main\java\com\example\SpringbootApplication.java
-D:\Program\project\student\springboot\src\main\java\com\example\entity\Admin.java
-D:\Program\project\student\springboot\src\main\java\com\example\mapper\AdminMapper.java
-D:\Program\project\student\springboot\src\main\java\com\example\controller\WebController.java
-D:\Program\project\student\springboot\src\main\java\com\example\entity\Course.java
-D:\Program\project\student\springboot\src\main\java\com\example\exception\CustomException.java
-D:\Program\project\student\springboot\src\main\java\com\example\exception\GlobalExceptionHandler.java
-D:\Program\project\student\springboot\src\main\java\com\example\mapper\CourseMapper.java
-D:\Program\project\student\springboot\src\main\java\com\example\service\CourseService.java
+C:\Users\LSH\IdeaProjects\1111\student\springboot\src\main\java\com\example\controller\WebController.java
+C:\Users\LSH\IdeaProjects\1111\student\springboot\src\main\java\com\example\entity\Course.java
+C:\Users\LSH\IdeaProjects\1111\student\springboot\src\main\java\com\example\service\AdminService.java
+C:\Users\LSH\IdeaProjects\1111\student\springboot\src\main\java\com\example\controller\CourseController.java
+C:\Users\LSH\IdeaProjects\1111\student\springboot\src\main\java\com\example\mapper\CourseMapper.java
+C:\Users\LSH\IdeaProjects\1111\student\springboot\src\main\java\com\example\common\CorsConfig.java
+C:\Users\LSH\IdeaProjects\1111\student\springboot\src\main\java\com\example\common\Result.java
+C:\Users\LSH\IdeaProjects\1111\student\springboot\src\main\java\com\example\entity\Admin.java
+C:\Users\LSH\IdeaProjects\1111\student\springboot\src\main\java\com\example\mapper\AdminMapper.java
+C:\Users\LSH\IdeaProjects\1111\student\springboot\src\main\java\com\example\SpringbootApplication.java
+C:\Users\LSH\IdeaProjects\1111\student\springboot\src\main\java\com\example\exception\CustomException.java
+C:\Users\LSH\IdeaProjects\1111\student\springboot\src\main\java\com\example\exception\GlobalExceptionHandler.java
+C:\Users\LSH\IdeaProjects\1111\student\springboot\src\main\java\com\example\service\CourseService.java
diff --git a/student/springboot/target/springboot-0.0.1-SNAPSHOT.jar b/student/springboot/target/springboot-0.0.1-SNAPSHOT.jar
index cc5b378..2405f51 100644
Binary files a/student/springboot/target/springboot-0.0.1-SNAPSHOT.jar and b/student/springboot/target/springboot-0.0.1-SNAPSHOT.jar differ
diff --git a/student/springboot/target/springboot-0.0.1-SNAPSHOT.jar.original b/student/springboot/target/springboot-0.0.1-SNAPSHOT.jar.original
index 542bde9..88063d1 100644
Binary files a/student/springboot/target/springboot-0.0.1-SNAPSHOT.jar.original and b/student/springboot/target/springboot-0.0.1-SNAPSHOT.jar.original differ
diff --git a/student/vue/node_modules/.vite/deps/chunk-ASLK72SZ.js b/student/vue/node_modules/.vite/deps/chunk-ASLK72SZ.js
new file mode 100644
index 0000000..60a2367
--- /dev/null
+++ b/student/vue/node_modules/.vite/deps/chunk-ASLK72SZ.js
@@ -0,0 +1,3 @@
+// node_modules/element-plus/es/components/input/style/index.mjs
+import "C:/Users/LSH/IdeaProjects/1111/student/vue/node_modules/element-plus/theme-chalk/src/input.scss";
+//# sourceMappingURL=chunk-ASLK72SZ.js.map
diff --git a/student/vue/node_modules/.vite/deps/chunk-ASLK72SZ.js.map b/student/vue/node_modules/.vite/deps/chunk-ASLK72SZ.js.map
new file mode 100644
index 0000000..8b3470a
--- /dev/null
+++ b/student/vue/node_modules/.vite/deps/chunk-ASLK72SZ.js.map
@@ -0,0 +1,7 @@
+{
+ "version": 3,
+ "sources": ["../../element-plus/es/components/input/style/index.mjs"],
+ "sourcesContent": ["import '../../base/style/index.mjs';\r\nimport 'element-plus/theme-chalk/src/input.scss';\r\n//# sourceMappingURL=index.mjs.map\r\n"],
+ "mappings": ";AACA,OAAO;",
+ "names": []
+}
diff --git a/student/vue/node_modules/.vite/deps/chunk-BQ2OVMCC.js b/student/vue/node_modules/.vite/deps/chunk-BQ2OVMCC.js
new file mode 100644
index 0000000..f9c9503
--- /dev/null
+++ b/student/vue/node_modules/.vite/deps/chunk-BQ2OVMCC.js
@@ -0,0 +1,3 @@
+// node_modules/element-plus/es/components/tooltip/style/index.mjs
+import "C:/Users/LSH/IdeaProjects/1111/student/vue/node_modules/element-plus/theme-chalk/src/tooltip.scss";
+//# sourceMappingURL=chunk-BQ2OVMCC.js.map
diff --git a/student/vue/node_modules/.vite/deps/chunk-BQ2OVMCC.js.map b/student/vue/node_modules/.vite/deps/chunk-BQ2OVMCC.js.map
new file mode 100644
index 0000000..7c5a6dc
--- /dev/null
+++ b/student/vue/node_modules/.vite/deps/chunk-BQ2OVMCC.js.map
@@ -0,0 +1,7 @@
+{
+ "version": 3,
+ "sources": ["../../element-plus/es/components/tooltip/style/index.mjs"],
+ "sourcesContent": ["import '../../base/style/index.mjs';\r\nimport 'element-plus/theme-chalk/src/tooltip.scss';\r\nimport '../../popper/style/index.mjs';\r\n//# sourceMappingURL=index.mjs.map\r\n"],
+ "mappings": ";AACA,OAAO;",
+ "names": []
+}
diff --git a/student/vue/node_modules/.vite/deps/chunk-C5ZZQD6B.js b/student/vue/node_modules/.vite/deps/chunk-C5ZZQD6B.js
new file mode 100644
index 0000000..0496f3a
--- /dev/null
+++ b/student/vue/node_modules/.vite/deps/chunk-C5ZZQD6B.js
@@ -0,0 +1,3 @@
+// node_modules/element-plus/es/components/popper/style/index.mjs
+import "C:/Users/LSH/IdeaProjects/1111/student/vue/node_modules/element-plus/theme-chalk/src/popper.scss";
+//# sourceMappingURL=chunk-C5ZZQD6B.js.map
diff --git a/student/vue/node_modules/.vite/deps/chunk-C5ZZQD6B.js.map b/student/vue/node_modules/.vite/deps/chunk-C5ZZQD6B.js.map
new file mode 100644
index 0000000..9365c00
--- /dev/null
+++ b/student/vue/node_modules/.vite/deps/chunk-C5ZZQD6B.js.map
@@ -0,0 +1,7 @@
+{
+ "version": 3,
+ "sources": ["../../element-plus/es/components/popper/style/index.mjs"],
+ "sourcesContent": ["import '../../base/style/index.mjs';\r\nimport 'element-plus/theme-chalk/src/popper.scss';\r\n//# sourceMappingURL=index.mjs.map\r\n"],
+ "mappings": ";AACA,OAAO;",
+ "names": []
+}
diff --git a/student/vue/node_modules/.vite/deps/chunk-CGUCDBFF.js b/student/vue/node_modules/.vite/deps/chunk-CGUCDBFF.js
new file mode 100644
index 0000000..610860e
--- /dev/null
+++ b/student/vue/node_modules/.vite/deps/chunk-CGUCDBFF.js
@@ -0,0 +1,3 @@
+// node_modules/element-plus/es/components/scrollbar/style/index.mjs
+import "C:/Users/LSH/IdeaProjects/1111/student/vue/node_modules/element-plus/theme-chalk/src/scrollbar.scss";
+//# sourceMappingURL=chunk-CGUCDBFF.js.map
diff --git a/student/vue/node_modules/.vite/deps/chunk-CGUCDBFF.js.map b/student/vue/node_modules/.vite/deps/chunk-CGUCDBFF.js.map
new file mode 100644
index 0000000..10d9cb9
--- /dev/null
+++ b/student/vue/node_modules/.vite/deps/chunk-CGUCDBFF.js.map
@@ -0,0 +1,7 @@
+{
+ "version": 3,
+ "sources": ["../../element-plus/es/components/scrollbar/style/index.mjs"],
+ "sourcesContent": ["import '../../base/style/index.mjs';\r\nimport 'element-plus/theme-chalk/src/scrollbar.scss';\r\n//# sourceMappingURL=index.mjs.map\r\n"],
+ "mappings": ";AACA,OAAO;",
+ "names": []
+}
diff --git a/student/vue/node_modules/.vite/deps/chunk-FJXVO5OZ.js b/student/vue/node_modules/.vite/deps/chunk-FJXVO5OZ.js
new file mode 100644
index 0000000..df000eb
--- /dev/null
+++ b/student/vue/node_modules/.vite/deps/chunk-FJXVO5OZ.js
@@ -0,0 +1,3 @@
+// node_modules/element-plus/es/components/base/style/index.mjs
+import "C:/Users/LSH/IdeaProjects/1111/student/vue/node_modules/element-plus/theme-chalk/src/base.scss";
+//# sourceMappingURL=chunk-FJXVO5OZ.js.map
diff --git a/student/vue/node_modules/.vite/deps/chunk-FJXVO5OZ.js.map b/student/vue/node_modules/.vite/deps/chunk-FJXVO5OZ.js.map
new file mode 100644
index 0000000..9fe6198
--- /dev/null
+++ b/student/vue/node_modules/.vite/deps/chunk-FJXVO5OZ.js.map
@@ -0,0 +1,7 @@
+{
+ "version": 3,
+ "sources": ["../../element-plus/es/components/base/style/index.mjs"],
+ "sourcesContent": ["import 'element-plus/theme-chalk/src/base.scss';\r\n//# sourceMappingURL=index.mjs.map\r\n"],
+ "mappings": ";AAAA,OAAO;",
+ "names": []
+}
diff --git a/student/vue/node_modules/.vite/deps/chunk-MBQX2QZO.js b/student/vue/node_modules/.vite/deps/chunk-MBQX2QZO.js
new file mode 100644
index 0000000..175e09d
--- /dev/null
+++ b/student/vue/node_modules/.vite/deps/chunk-MBQX2QZO.js
@@ -0,0 +1,3 @@
+// node_modules/element-plus/es/components/tag/style/index.mjs
+import "C:/Users/LSH/IdeaProjects/1111/student/vue/node_modules/element-plus/theme-chalk/src/tag.scss";
+//# sourceMappingURL=chunk-MBQX2QZO.js.map
diff --git a/student/vue/node_modules/.vite/deps/chunk-MBQX2QZO.js.map b/student/vue/node_modules/.vite/deps/chunk-MBQX2QZO.js.map
new file mode 100644
index 0000000..4c62dc3
--- /dev/null
+++ b/student/vue/node_modules/.vite/deps/chunk-MBQX2QZO.js.map
@@ -0,0 +1,7 @@
+{
+ "version": 3,
+ "sources": ["../../element-plus/es/components/tag/style/index.mjs"],
+ "sourcesContent": ["import '../../base/style/index.mjs';\r\nimport 'element-plus/theme-chalk/src/tag.scss';\r\n//# sourceMappingURL=index.mjs.map\r\n"],
+ "mappings": ";AACA,OAAO;",
+ "names": []
+}
diff --git a/student/vue/node_modules/.vite/deps/chunk-RLDUGRP4.js b/student/vue/node_modules/.vite/deps/chunk-RLDUGRP4.js
new file mode 100644
index 0000000..1e029b4
--- /dev/null
+++ b/student/vue/node_modules/.vite/deps/chunk-RLDUGRP4.js
@@ -0,0 +1,3 @@
+// node_modules/element-plus/es/components/checkbox/style/index.mjs
+import "C:/Users/LSH/IdeaProjects/1111/student/vue/node_modules/element-plus/theme-chalk/src/checkbox.scss";
+//# sourceMappingURL=chunk-RLDUGRP4.js.map
diff --git a/student/vue/node_modules/.vite/deps/chunk-RLDUGRP4.js.map b/student/vue/node_modules/.vite/deps/chunk-RLDUGRP4.js.map
new file mode 100644
index 0000000..7ebdb5b
--- /dev/null
+++ b/student/vue/node_modules/.vite/deps/chunk-RLDUGRP4.js.map
@@ -0,0 +1,7 @@
+{
+ "version": 3,
+ "sources": ["../../element-plus/es/components/checkbox/style/index.mjs"],
+ "sourcesContent": ["import '../../base/style/index.mjs';\r\nimport 'element-plus/theme-chalk/src/checkbox.scss';\r\n//# sourceMappingURL=index.mjs.map\r\n"],
+ "mappings": ";AACA,OAAO;",
+ "names": []
+}
diff --git a/student/vue/node_modules/.vite/deps/element-plus_es_components_dialog_style_index.js b/student/vue/node_modules/.vite/deps/element-plus_es_components_dialog_style_index.js
new file mode 100644
index 0000000..a6d6209
--- /dev/null
+++ b/student/vue/node_modules/.vite/deps/element-plus_es_components_dialog_style_index.js
@@ -0,0 +1,6 @@
+import "./chunk-UGKGD7NU.js";
+import "./chunk-FJXVO5OZ.js";
+
+// node_modules/element-plus/es/components/dialog/style/index.mjs
+import "C:/Users/LSH/IdeaProjects/1111/student/vue/node_modules/element-plus/theme-chalk/src/dialog.scss";
+//# sourceMappingURL=element-plus_es_components_dialog_style_index.js.map
diff --git a/student/vue/node_modules/.vite/deps/element-plus_es_components_dialog_style_index.js.map b/student/vue/node_modules/.vite/deps/element-plus_es_components_dialog_style_index.js.map
new file mode 100644
index 0000000..e49bbfc
--- /dev/null
+++ b/student/vue/node_modules/.vite/deps/element-plus_es_components_dialog_style_index.js.map
@@ -0,0 +1,7 @@
+{
+ "version": 3,
+ "sources": ["../../element-plus/es/components/dialog/style/index.mjs"],
+ "sourcesContent": ["import '../../base/style/index.mjs';\r\nimport 'element-plus/theme-chalk/src/dialog.scss';\r\nimport '../../overlay/style/index.mjs';\r\n//# sourceMappingURL=index.mjs.map\r\n"],
+ "mappings": ";;;;AACA,OAAO;",
+ "names": []
+}
diff --git a/student/vue/src/views/manager/Course.vue b/student/vue/src/views/manager/Course.vue
index fbcf5a8..9ab827b 100644
--- a/student/vue/src/views/manager/Course.vue
+++ b/student/vue/src/views/manager/Course.vue
@@ -21,8 +21,8 @@
- 编辑
- 删除
+ 编辑
+ 删除
@@ -68,8 +68,9 @@
\ No newline at end of file