Commit 6c5afc6d authored by zhangsen's avatar zhangsen

提供根据机构统计监控数量接口

parent 322980a1
......@@ -9,6 +9,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* @author ZeHua Li
......@@ -90,4 +91,6 @@ public interface VideoMapper extends BaseMapper<Video> {
String getParentSourceIds(String childrenId);
List<Map<String, String>> getVideoCountMapList();
}
......@@ -9,6 +9,7 @@ import com.yeejoin.equipmanage.common.entity.dto.VideoSaveDto;
import com.yeejoin.equipmanage.common.entity.vo.*;
import java.util.List;
import java.util.Map;
/**
* @author ZeHua Li
......@@ -79,4 +80,11 @@ public interface IVideoService extends IService<Video> {
String getVideoUrl(String videoId, String presetIndex, String defaultUrl, String code);
List<OrgMenuDto> companyTreeByUserAndType(String type);
/**
* 获取机构下的监控数量
* key:机构编码 value:数量
* @return
*/
Map<String, Long> getVideoCountMap();
}
......@@ -621,4 +621,14 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
return "";
}
@Override
public Map<String, Long> getVideoCountMap() {
List<Map<String, String>> videoCountMapList = videoMapper.getVideoCountMapList();
Map<String, Long> videoMap = new HashMap<>();
videoCountMapList.forEach(item -> {
videoMap.put(item.get("bizOrgCode"), Long.valueOf(item.get("num")));
});
return videoMap;
}
}
......@@ -387,4 +387,10 @@
<select id="getParentSourceIds" resultType="java.lang.String">
select getBuildingParentIds(#{childrenId})
</select>
<select id="getVideoCountMapList" resultType="java.util.Map">
select biz_org_code as bizOrgCode, count(biz_org_code) as num
from wl_video
group by biz_org_code
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment