package com.newfiber.api.pc.service.impl; import com.baomidou.mybatisplus.service.IService; import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.newfiber.api.pc.dao.VideoSurveillanceMapper; import com.newfiber.api.pc.model.entity.VideoSurveillance; import com.newfiber.api.pc.service.VideoSurveillanceService; import org.springframework.stereotype.Service; import java.util.List; import java.util.Map; import java.util.stream.Collectors; /** * @description: TODO * @author: 张鸿志 * @date: 2021/1/19 9:38 * @version: v1.0 */ @Service public class VideoSurveillanceServiceImpl extends ServiceImpl<VideoSurveillanceMapper, VideoSurveillance> implements VideoSurveillanceService { @Override public Map<String, List<VideoSurveillance>> selectVideoByParentGroup() { List<VideoSurveillance> videoSurveillances = this.selectList(null); return videoSurveillances.stream().collect(Collectors.groupingBy(VideoSurveillance::getParentSiteName)); } }