当前位置:网站首页>关于我写的循环遍历
关于我写的循环遍历
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说我博文质量低。
边栏推荐
- 花了近70美元入手的学生版MATLAB体验到底如何?
- SQL去重的三种方法汇总
- Error EPERM operation not permitted, mkdir ‘Dsoftwarenodejsnode_cache_cacach两种解决办法
- 狗都能看懂的Self-Attention讲解
- 基于时序模式注意力机制(TPA)的长短时记忆(LSTM)网络TPA-LSTM的多变量输入风电功率预测
- 对产品设计,架构设计的一点思考
- 对象的扩展补充
- Software: Recommend a domestic and very easy-to-use efficiency software uTools to everyone
- A semi-supervised Laplace skyhawk optimization depth nuclear extreme learning machine for classification
- SQL如何从字符串截取指定字符(LEFT、MID、RIGHT三大函数)
猜你喜欢

Database knowledge: SQLServer creates non-sa user notes

QT QOpenGLWidget 全屏导致其他控件显示问题

Hardware Knowledge: Introduction to RTMP and RTSP Traditional Streaming Protocols

为什么不使用VS管理QT项目

ThreadLocal内存泄漏问题讲解

ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)解决办法

MAML原理讲解和代码实现

IDEA中创建编写JSP

Gramm Angle field GAF time-series data into the image and applied to the fault diagnosis

目标检测中的IoU、GIoU、DIoU与CIoU
随机推荐
字符串的一些方法
缓存穿透、击穿、雪崩
【C# - 爬虫】使用Selenium实现爬虫,获取近七天天气信息(包含完整代码)
【音视频开发系列】QT 采集麦克风PCM并播放
QT 出现多冲定义问题
网页中常用的两种绘图技术,用canvas绘图,绘制出一个三角形,矩形,柱状图,扇形图
Nacos 原理
基于EEMD+GRU+MLR的时间序列预测
无监督特征对齐的迁移学习理论框架
狗都能看懂的变化检测网络Siam-NestedUNet讲解——解决工业检测的痛点
53个全球免费学术资源数据库整理,查资料写论文必备【开学必备】
ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)解决办法
类图规范总结
golang chan
RuntimeError: You called this URL via POST, but the URL doesn‘t end in a slash and you have APPEND_S
2DCNN, 1DCNN, BP, SVM fault diagnosis and result visualization of matlab
Centos通过Docker搭建MySQL的PXC集群
Detailed explanation of DenseNet and Keras reproduction code
IoU, GIoU, DIoU and CIoU in target detection
set集合