查询逻辑修改
This commit is contained in:
@@ -24,5 +24,5 @@ public interface CourseDetailsDao extends BaseMapper<CourseDetails> {
|
|||||||
|
|
||||||
Map<String,Object> countCourse(Long courseId);
|
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()
|
.in(CourseDetails::getCourseDetailsId, detailIdList)).stream()
|
||||||
.collect(Collectors.toMap(CourseDetails::getCourseDetailsId, item->item));
|
.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);
|
PageInfo<Course> pageInfo = new PageInfo<>(courseList);
|
||||||
if (CollectionUtil.isNotEmpty(courseList)) {
|
if (CollectionUtil.isNotEmpty(courseList)) {
|
||||||
|
|||||||
@@ -68,9 +68,7 @@
|
|||||||
FROM
|
FROM
|
||||||
course_details
|
course_details
|
||||||
where course_details_id in
|
where course_details_id in
|
||||||
<foreach collection="detailIdList" item="ids" open="(" separator="," close=")">
|
|
||||||
#{ids}
|
|
||||||
</foreach>
|
|
||||||
GROUP BY
|
GROUP BY
|
||||||
course_id
|
course_id
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user