课程留言板点赞
This commit is contained in:
@@ -262,17 +262,30 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
||||
@Override
|
||||
public R getCourseLableLinkList(Map<String, Object> param) {
|
||||
List resList = new ArrayList();
|
||||
//医学
|
||||
MPJLambdaWrapper<CourseToMedicine> toMedicineWrapper = new MPJLambdaWrapper<>();
|
||||
toMedicineWrapper.leftJoin(CourseMedicine.class,CourseMedicine::getId,CourseToMedicine::getMedicalId);
|
||||
toMedicineWrapper.selectAll(CourseMedicine.class);
|
||||
toMedicineWrapper.eq(CourseToMedicine::getCourseId,param.get("courseId"));
|
||||
List<CourseMedicine> list = toMedicalDao.selectJoinList(CourseMedicine.class,toMedicineWrapper);
|
||||
if (list.size() > 0) {
|
||||
for (CourseMedicine m:list){
|
||||
List<CourseMedicine> mlist = toMedicalDao.selectJoinList(CourseMedicine.class,toMedicineWrapper);
|
||||
if (mlist.size() > 0) {
|
||||
for (CourseMedicine m:mlist){
|
||||
m = getPCourseMedicine(m);
|
||||
resList.add(m);
|
||||
}
|
||||
}
|
||||
//国学
|
||||
MPJLambdaWrapper<CourseToSociologyEntity> toSociologyWrapper = new MPJLambdaWrapper<>();
|
||||
toSociologyWrapper.leftJoin(CourseSociologyEntity.class,CourseSociologyEntity::getId,CourseToSociologyEntity::getSociologyId);
|
||||
toSociologyWrapper.selectAll(CourseSociologyEntity.class);
|
||||
toSociologyWrapper.eq(CourseToSociologyEntity::getCourseId,param.get("courseId"));
|
||||
List<CourseSociologyEntity> slist = courseToSociologyDao.selectJoinList(CourseSociologyEntity.class,toSociologyWrapper);
|
||||
if (slist.size() > 0) {
|
||||
for (CourseSociologyEntity s:slist){
|
||||
s = getPCourseSociology(s);
|
||||
resList.add(s);
|
||||
}
|
||||
}
|
||||
return R.ok().put("resList",resList);
|
||||
}
|
||||
|
||||
@@ -287,6 +300,17 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
||||
return m;
|
||||
}
|
||||
|
||||
private CourseSociologyEntity getPCourseSociology(CourseSociologyEntity s){
|
||||
if (s.getPid()!=0){
|
||||
CourseSociologyEntity pm = courseSociologyDao.selectById(s.getPid());
|
||||
List<CourseSociologyEntity> list = new ArrayList<>();
|
||||
list.add(s);
|
||||
pm.setChildren(list);
|
||||
s = getPCourseSociology(pm);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
private List<Integer> sociologyIds(Integer id){
|
||||
ArrayList<Integer> integers = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user