当前位置:网站首页>关于我写的循环遍历
关于我写的循环遍历
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说我博文质量低。
边栏推荐
- Database Skills: Organize SQL Server's Very Practical Scripts
- SQL去重的三种方法汇总
- 数据库:整理四个实用的SQLServer脚本函数
- FCN——语义分割的开山鼻祖(基于tf-Kersa复现代码)
- Hardware Knowledge: Introduction to RTMP and RTSP Traditional Streaming Protocols
- curl (7) Failed connect to localhost8080; Connection refused
- Jenkins pipeline 自动部署实践
- Database knowledge: SQLServer creates non-sa user notes
- VS 2017编译 QT no such slot || 找不到*** 问题
- MySQL(4)
猜你喜欢

Online public account article content to audio file practical gadget

matlab封闭曲线拟合 (针对一些列离散点)

MySQL内存淘汰策略

狗都能看懂的Vision Transformer的讲解和代码实现

MySQL(4)

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

SQL去重的三种方法汇总

IoU, GIoU, DIoU and CIoU in target detection

误差指标分析计算之matlab实现【开源1.0.0版】

DenseNet详解及Keras复现代码
随机推荐
Sql优化总结!详细!(2021最新面试必问)
A semi-supervised Laplace skyhawk optimization depth nuclear extreme learning machine for classification
狗都能看懂的变化检测网络Siam-NestedUNet讲解——解决工业检测的痛点
QT QOpenGLWidget 全屏导致其他控件显示问题
代码小变化带来的大不同
更改mysql数据库默认的字符集(mysql 存储 emoji表情)
golang chan
布隆过滤器
数据库文档生成工具V1.0
matlab让我的旧手机起死回生
系统流量预估、架构设计方案
Implementation of ICEEMDAN Decomposition Code in MATLAB
curl (7) Failed connect to localhost8080; Connection refused
golang rtsp拉流测试
狗都能看懂的Pytorch MAML代码详解
MySQL - Row size too large (> 8126). Changing some columns to TEXT or BLOB
SQL去重的三种方法汇总
Error EPERM operation not permitted, mkdir ‘Dsoftwarenodejsnode_cache_cacach两种解决办法
Error ER_NOT_SUPPORTED_AUTH_MODE Client does not support authentication protocol requested by serv
Faster RCNN原理及复现代码