查询逻辑修改
This commit is contained in:
parent
5aeee2da3a
commit
2ea74b96b7
|
|
@ -24,5 +24,5 @@ public interface CourseDetailsDao extends BaseMapper<CourseDetails> {
|
|||
|
||||
Map<String,Object> countCourse(Long courseId);
|
||||
|
||||
List<CourseDetails> countByCourseId(@Param("detailIdList") Set<Long> detailIdList);
|
||||
List<CourseDetails> countByCourseId();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ public class CourseCollectServiceImpl extends ServiceImpl<CourseCollectDao, Cour
|
|||
.in(CourseDetails::getCourseDetailsId, detailIdList)).stream()
|
||||
.collect(Collectors.toMap(CourseDetails::getCourseDetailsId, item->item));
|
||||
|
||||
Map<Long, Integer> countMap = detailIdList.isEmpty() ? new HashMap<>() : courseDetailsDao.countByCourseId(detailIdList).stream().collect(Collectors.toMap(CourseDetails::getCourseId, CourseDetails::getCourseDetailsCount));
|
||||
Map<Long, Integer> countMap = courseDetailsDao.countByCourseId().stream().collect(Collectors.toMap(CourseDetails::getCourseId, CourseDetails::getCourseDetailsCount));
|
||||
|
||||
PageInfo<Course> pageInfo = new PageInfo<>(courseList);
|
||||
if (CollectionUtil.isNotEmpty(courseList)) {
|
||||
|
|
|
|||
|
|
@ -68,9 +68,7 @@
|
|||
FROM
|
||||
course_details
|
||||
where course_details_id in
|
||||
<foreach collection="detailIdList" item="ids" open="(" separator="," close=")">
|
||||
#{ids}
|
||||
</foreach>
|
||||
|
||||
GROUP BY
|
||||
course_id
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in New Issue