当前位置:网站首页>关于我写的循环遍历
关于我写的循环遍历
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实现

Based on the EEMD + + MLR GRU helped time series prediction

MySQL外键(详解)

Computer software: recommend a disk space analysis tool - WizTree

Detailed explanation of DenseNet and Keras reproduction code

零分贝超静音无线鼠标!数量有限!!先到先得!!!【元旦专享】

HbuilderX 启动微信小程序 无法打开项目
![[漏洞问题] log4j漏洞 关于2.17.0升级到2.18.0 方案](/img/f2/2052277ae440279b33248ae51a970f.png)
[漏洞问题] log4j漏洞 关于2.17.0升级到2.18.0 方案

MySQL大总结

无监督特征对齐的迁移学习理论框架
随机推荐
对产品设计,架构设计的一点思考
YOLOv3详解:从零开始搭建YOLOv3网络
Based on the EEMD + + MLR GRU helped time series prediction
Implementation of ICEEMDAN Decomposition Code in MATLAB
异步编程之promise,任务队列,事件循环
如何用matlab做高精度计算?【第二辑】
this关键字,构造函数
秒杀系统设计
电脑知识:台式电脑应该选择品牌和组装,值得收藏
Database document generation tool V1.0
手把手教你Charles抓包工具使用
Network skills: teach you to install batteries on the router, you can still surf the Internet when the power is cut off!
电脑软件:推荐一款磁盘空间分析工具——WizTree
ThreadLocal内存泄漏问题讲解
用matlab打造的摩斯电码加解码器音频版,支持包括中文在内的任意字符
子空间结构保持的多层极限学习机自编码器(ML-SELM-AE)
SegNet——论文笔记
对象的扩展补充
GRNN、RBF、PNN、KELM之间究竟有什么联系?
Unable to preventDefault inside passive event listener due to target being treated as passive. See