首页 > 图灵资讯 > 技术篇>正文

游戏三级分类部分代码

2023-04-19 16:06:50

  //查询一级分类,来源分类表Appcategory,根据id查询一级查询 List oneList = appCategoryService.getOneList(1); System.out.println(oneList + "one"); //查询二级分类 List twoList = new ArrayList(); //查询三级分类 List threeList = new ArrayList(); for (AppCategory app : oneList) { //根据一级查二级,根据查询2 List one = appCategoryService.getOneList(app.getId()); //根据二级检查三级 for (AppCategory two : one) { ///遍历添加二级分类 twoList.add(two); //查询三级分类 List three = appCategoryService.getOneList(two.getId()); for (AppCategory four : three) { ///遍历添加三级分类 threeList.add(four); } } }

游戏三级分类部分代码_System

  原理是根据parentid进行一级分类,他的id为2,所以要根据一级分类的id查询parentid为2的值,查询三级分类等等。(只为自己总结,不要喷)

上一篇 浅析ReentrantLock和AQS
下一篇 动力节点全新版MyBatisPlus教程—进阶篇

文章素材均来源于网络,如有侵权,请联系管理员删除。