当前位置:网站首页>关于我写的循环遍历
关于我写的循环遍历
2022-08-04 05:39:00 【雾喔】
先上代码
@Override
public Response queryDownStarName(String staName) {
Map<String,List>map=new HashMap<>();
Standard staOne=standardRepository.queryDownStarName(staName);
if(staOne != null) {
List<Standard> list = new LinkedList<>();
list.add(staOne);
map.put("1", list);
int num = 1;
Integer id = staOne.getStaId();
List<Standard> standardList = standardRepository.queryByFatherID(id);
if (!standardList.isEmpty()) {
num++;
map.put("" + num, standardList);
}
while (!standardList.isEmpty()) {
List<Integer> integerList = new LinkedList<>();
for (int i = 0; i < standardList.size(); i++) {
Standard standard = standardList.get(i);
int sId = standard.getStaId();
integerList.add(sId);
}
if (!integerList.isEmpty()) {
List<Standard> standardList1 = new LinkedList<>();
for (int i = 0; i < integerList.size(); i++) {
int sId = integerList.get(i);
List<Standard> standardList3 = standardRepository.queryByFatherID(sId);
if (!standardList3.isEmpty()) {
for (int a = 0; a < standardList3.size(); a++) {
Standard standard = standardList3.get(a);
standardList1.add(standard);
}
}
}
num++;
map.put("" + num, standardList1);
standardList = standardList1;
} else {
standardList = null;
}
}
return Response.ok(map);
}else{
return Response.error("不存在此学分类型!");
}
}这个是
主要遍历这样的数据。
这个是service层,调用的dao层的方法可以望名生义。
个人总结:
最近很忙,整天出去跑,在这个过程中收获了一个新皮肤,》〉精致黑皮〈《。

最近几天天气贼拉热,ljcsdn说我博文质量低。
边栏推荐
猜你喜欢

如何用matlab做高精度计算?【第二辑】

数据库:整理四个实用的SQLServer脚本函数

窥探晶体世界的奥秘 —— 230种空间群晶体结构模型全在这里

狗都能看懂的变化检测网络Siam-NestedUNet讲解——解决工业检测的痛点

Error EPERM operation not permitted, mkdir ‘Dsoftwarenodejsnode_cache_cacach两种解决办法

A priori box (Anchor) in target detection

用手机也能轻松玩转MATLAB编程

idea使用@Autowired注解爆红原因及解决方法

Faster - RCNN principle and repetition code
![[漏洞问题] log4j漏洞 关于2.17.0升级到2.18.0 方案](/img/f2/2052277ae440279b33248ae51a970f.png)
[漏洞问题] log4j漏洞 关于2.17.0升级到2.18.0 方案
随机推荐
Based on the EEMD + + MLR GRU helped time series prediction
mysql:列类型之float、double
自适应迁移学习核极限学习机用于预测
YOLOv3详解:从零开始搭建YOLOv3网络
Online public account article content to audio file practical gadget
IoU, GIoU, DIoU and CIoU in target detection
JVM工具之 JPS
Error ER_NOT_SUPPORTED_AUTH_MODE Client does not support authentication protocol requested by serv
GRNN、RBF、PNN、KELM之间究竟有什么联系?
花了近70美元入手的学生版MATLAB体验到底如何?
ffmpeg打开rtsp流应该设置的几个参数
基于EEMD+GRU+MLR的时间序列预测
SENet detailed explanation and Keras reproduction code
数据库文档生成工具V1.0
Database knowledge: SQLServer creates non-sa user notes
水平垂直居中的12种方法,任意插入节点的方法,事件的绑定的三种方法和解绑的方法,事件对象,盒子模型
E-R图总结规范
“需求370解决解决爬取章节之后主题讨论评论消失问题”工作总结
如何画好业务架构图。
LeetCode(剑指 Offer)- 18. 删除链表的节点