课程和标签排序

This commit is contained in:
wuchunlei
2024-05-14 10:39:23 +08:00
parent 4f6f3f7779
commit f73b8f30e6
3 changed files with 9 additions and 0 deletions

View File

@@ -17,6 +17,8 @@ public class CourseToSociologyEntity {
private Integer sociologyId;
private Integer sort;
private Date createTime;
@TableLogic

View File

@@ -77,4 +77,10 @@ public class CourseSociologyController {
}
}
@RequestMapping("/updateCourseToSociologySort")
public R updateCourseToSociologySort(@RequestBody CourseToSociologyEntity courseToSociologyEntity){
courseToSociologyService.updateById(courseToSociologyEntity);
return R.ok();
}
}

View File

@@ -105,6 +105,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
wrapper.selectAs(CourseToSociologyEntity::getId,"bindId");
wrapper.leftJoin(CourseEntity.class,CourseEntity::getId,CourseToSociologyEntity::getCourseId);
wrapper.eq(CourseToSociologyEntity::getSociologyId,sociologyId);
wrapper.orderByAsc(CourseToSociologyEntity::getSort);
List<CourseEntity> courseEntities = courseToSociologyDao.selectJoinList(CourseEntity.class, wrapper);
return courseEntities;
}