当前位置: 首页 > news >正文

温州网站建设专家工业外观设计

温州网站建设专家,工业外观设计,wordpress 企业站模版,网站扁平化结构和树形结构需求 得到树结构数据也可以用lambda表达式也行#xff0c;也可以直接循环递归也行#xff0c;本文采用的是直接在Mybatis层得到结果#xff0c;各有各的优势。 代码 1、实体类 Data public class CourseChapterVO implements Serializable {private static final long s…需求 得到树结构数据也可以用lambda表达式也行也可以直接循环递归也行本文采用的是直接在Mybatis层得到结果各有各的优势。 代码 1、实体类 Data public class CourseChapterVO implements Serializable {private static final long serialVersionUID -67718827554034368L;/*** 主键ID*/private Integer id;/*** 课程ID*/private Integer courseId;/*** 课程章节名称*/private String chapterName;/*** 父ID*/private Integer chapterParent;/*** 层级*/private Integer chapterLevel;JsonInclude(JsonInclude.Include.NON_EMPTY) //当children为空时不返回 private ListCourseChapterVO children;}2、mapper.xml resultMap typecom.ruoyi.manager.vo.CourseChapterVO idCourseChapterMap2result propertyid columnid jdbcTypeINTEGER/result propertycourseId columncourse_id jdbcTypeINTEGER/result propertychapterName columnchapter_name jdbcTypeVARCHAR/result propertychapterParent columnchapter_parent jdbcTypeINTEGER/result propertychapterLevel columnchapter_level jdbcTypeINTEGER/collection propertychildren ofTypecom.ruoyi.manager.vo.CourseChapterVO columnid selectselectListTree2//resultMapselect idselectListTree1 resultMapCourseChapterMap2select id , course_id, chapter_name, chapter_parent, chapter_levelfrom course_chapter where chapter_parent 0 /selectselect idselectListTree2 resultMapCourseChapterMap2select id , course_id, chapter_name, chapter_parent, chapter_level from course_chapter where chapter_parent #{id}/select3、mapper.java ListCourseChapterVO selectListTree1(CourseChapter courseChapter);4、serviceImpl.java Overridepublic ListCourseChapterVO queryAll(CourseChapter courseChapter) {return this.courseChapterMapper.selectListTree1(courseChapter);}5、service.java ListCourseChapterVO queryAll(CourseChapter courseChapter);6、controller.java GetMapping(list)public R queryAll(CourseChapter courseChapter) {return R.data(this.courseChapterService.queryAll(courseChapter));}7、实现效果 {msg: ,code: 0,data: [{id: 1,courseId: 5,chapterName: 第一章节学习,chapterParent: 0,chapterLevel: 1,children: [{id: 2,courseId: 5,chapterName: 第一章节学习子1,chapterParent: 1,chapterLevel: 2},{id: 3,courseId: 5,chapterName: 第一章节学习子2,chapterParent: 1,chapterLevel: 2},{id: 4,courseId: 5,chapterName: 第一章节学习子3,chapterParent: 1,chapterLevel: 2}]},{id: 5,courseId: 5,chapterName: 第二章节学习,chapterParent: 0,chapterLevel: 1,children: [{id: 6,courseId: 5,chapterName: 第二章节学习子,chapterParent: 5,chapterLevel: 2,children: [{id: 9,courseId: 5,chapterName: 第二章节学习子1子1,chapterParent: 6,chapterLevel: 3}]},{id: 7,courseId: 5,chapterName: 第二章节学习子1,chapterParent: 5,chapterLevel: 2},{id: 8,courseId: 5,chapterName: 第二章节学习子2,chapterParent: 5,chapterLevel: 2}]},{id: 10,courseId: 5,chapterName: 第三章节学习gfdgdf,chapterParent: 0,chapterLevel: 1}] }
http://www.w-s-a.com/news/616970/

相关文章:

  • 石家庄制作网站的公司双柏县住房和城乡建设局网站
  • 影视vip网站建设教程ppt模板免费下载 素材红色
  • 内蒙古城乡建设部网站首页平台网站建设ppt
  • 集约化网站建设项目官方网站建设
  • 原创先锋 北京网站建设网站开发电脑内存要多少
  • 婚恋网站建设项目创业计划书网站建设 食品
  • 免费建网站代码查询做导员的网站
  • 做网站的软件电子可以看女人不易做网站
  • 学校响应式网站模板下载仙居住房和城乡建设规划局网站
  • 推广网站的方法有拍卖网站建设
  • 网站建设网站排名优化中国网站服务器哪个好
  • asp网站应用程序网站建设需要提供的资料
  • 网站开发与设计.net微信小程序设计制作
  • 怎样做网站排名优化展馆设计费取费标准一览表
  • 网站建设去哪可接单网站建设与设计大作业
  • 休闲咖啡厅网站开发目标韩国小清新网站模板
  • 做微景观的网站制作网页模板适应不同分辨率
  • 最简单的网站系统昨天军事新闻最新消息
  • 做ps网页设计的网站有哪些wordpress内容付费
  • 有没有免费注册域名的网站科技小制作 手工 简单
  • 网站支付端口win10优化大师怎么样
  • 怎么做云购网站吗网站流量监测
  • 网站被恶意刷流量可以翻外墙的浏览器
  • 网站做直链下载存储解决方案怎么把网站设置为主页面
  • 西安做网站招聘深圳网站见
  • 网站怎么做优化百度能搜索到wordpress 子分类
  • 六安网站建设培训制作网站需要多少时间
  • 电子商务专业网站建设什么软件可以做动画视频网站
  • wordpress 分享主题做网站优化有必要
  • ftp 网站管理电商网站设计图片