From 05abc39cf7e8c32f003136c56e4b4af1af78c9c6 Mon Sep 17 00:00:00 2001 From: SKYID <2569982966@qq.com> Date: Mon, 25 Jan 2021 10:14:22 +0800 Subject: [PATCH] fix bug for CourseMapper --- .../com/letoy/study/entity/CourseInfo.java | 70 ------------------- src/main/resources/mapper/CourseMapper.xml | 18 ++--- .../com/letoy/study/dao/CourseMapperTest.java | 1 - 3 files changed, 9 insertions(+), 80 deletions(-) diff --git a/src/main/java/com/letoy/study/entity/CourseInfo.java b/src/main/java/com/letoy/study/entity/CourseInfo.java index 43f0006..fec3680 100644 --- a/src/main/java/com/letoy/study/entity/CourseInfo.java +++ b/src/main/java/com/letoy/study/entity/CourseInfo.java @@ -32,75 +32,5 @@ public class CourseInfo { @ApiModelProperty(value = "课程发布时间", example = "", dataType = "java.sql.Timestamp") private java.sql.Timestamp coursePublishTime; - public long getCourseId() { - return courseId; - } - public void setCourseId(long courseId) { - this.courseId = courseId; - } - - public String getCourseName() { - return courseName; - } - - public void setCourseName(String courseName) { - this.courseName = courseName; - } - - public String getCourseType() { - return courseType; - } - - public void setCourseType(String courseType) { - this.courseType = courseType; - } - - public String getCourseVideoUrl() { - return courseVideoUrl; - } - - public void setCourseVideoUrl(String courseVideoUrl) { - this.courseVideoUrl = courseVideoUrl; - } - - public String getCourseDescribe() { - return courseDescribe; - } - - public void setCourseDescribe(String courseDescribe) { - this.courseDescribe = courseDescribe; - } - - public String getCourseViews() { - return courseViews; - } - - public void setCourseViews(String courseViews) { - this.courseViews = courseViews; - } - - public long getUserId() { - return userId; - } - - public void setUserId(long userId) { - this.userId = userId; - } - - public long getCourseCommentId() { - return courseCommentId; - } - - public void setCourseCommentId(long courseCommentId) { - this.courseCommentId = courseCommentId; - } - - public Timestamp getCoursePublishTime() { - return coursePublishTime; - } - - public void setCoursePublishTime(Timestamp coursePublishTime) { - this.coursePublishTime = coursePublishTime; - } } diff --git a/src/main/resources/mapper/CourseMapper.xml b/src/main/resources/mapper/CourseMapper.xml index ef6bae0..a764fa9 100644 --- a/src/main/resources/mapper/CourseMapper.xml +++ b/src/main/resources/mapper/CourseMapper.xml @@ -2,31 +2,31 @@ - - + + insert into course_info ( - course_id, course_name, course_type, + course_name, course_type, course_video_url,course_describe, - course_views,user_id,course_comment_id,course_publish_time, + course_views,user_id,course_comment_id,course_publish_time ) VALUES ( - #{courseId}, #{courseName}, #{courseType}, + #{courseName}, #{courseType}, #{courseVideoUrl},#{courseDescribe}, - #{courseViews},#{userId},#{courseCommentId},#{coursePublishTime}, + #{courseViews},#{userId},#{courseCommentId},#{coursePublishTime} ) - + delete from course_info where course_id =#{courseId} - select * from course_info - select * from course_info where 1=1 diff --git a/src/test/java/com/letoy/study/dao/CourseMapperTest.java b/src/test/java/com/letoy/study/dao/CourseMapperTest.java index e174a60..f8d36bc 100644 --- a/src/test/java/com/letoy/study/dao/CourseMapperTest.java +++ b/src/test/java/com/letoy/study/dao/CourseMapperTest.java @@ -27,7 +27,6 @@ public class CourseMapperTest { @Test public void releaseCourse() { CourseInfo course1 = new CourseInfo(); - course1.setCourseId(2); course1.setCourseName("spring基础"); course1.setCourseType("后端基础类型"); course1.setCourseVideoUrl("192.6.1"); -- Gitee