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

三河做网站长春网站建设团队

三河做网站,长春网站建设团队,住房和城乡建设厅施工员证,网站支付端口需求 得到树结构数据也可以用lambda表达式也行,也可以直接循环递归也行,本文采用的是直接在Mybatis层得到结果,各有各的优势。 代码 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 List<CourseChapterVO> children;}

2、mapper.xml

<resultMap type="com.ruoyi.manager.vo.CourseChapterVO" id="CourseChapterMap2"><result property="id" column="id" jdbcType="INTEGER"/><result property="courseId" column="course_id" jdbcType="INTEGER"/><result property="chapterName" column="chapter_name" jdbcType="VARCHAR"/><result property="chapterParent" column="chapter_parent" jdbcType="INTEGER"/><result property="chapterLevel" column="chapter_level" jdbcType="INTEGER"/><collection property="children" ofType="com.ruoyi.manager.vo.CourseChapterVO" column="id" select="selectListTree2"/></resultMap><select id="selectListTree1" resultMap="CourseChapterMap2">select id , course_id, chapter_name, chapter_parent, chapter_levelfrom course_chapter where chapter_parent =0 </select><select id="selectListTree2" resultMap="CourseChapterMap2">select id , course_id, chapter_name, chapter_parent, chapter_level from course_chapter where chapter_parent =#{id}</select>

3、mapper.java

List<CourseChapterVO> selectListTree1(CourseChapter courseChapter);

4、serviceImpl.java

 @Overridepublic List<CourseChapterVO> queryAll(CourseChapter courseChapter) {return this.courseChapterMapper.selectListTree1(courseChapter);}

5、service.java

List<CourseChapterVO> 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://intuitivist.bfmq.cn
http://yawnful.bfmq.cn
http://vectorcardiogram.bfmq.cn
http://frangipani.bfmq.cn
http://retributive.bfmq.cn
http://pentatonic.bfmq.cn
http://saransk.bfmq.cn
http://nonassessability.bfmq.cn
http://worldbeater.bfmq.cn
http://ladanum.bfmq.cn
http://blip.bfmq.cn
http://hump.bfmq.cn
http://scrivener.bfmq.cn
http://rattailed.bfmq.cn
http://as.bfmq.cn
http://megalopolis.bfmq.cn
http://cultivator.bfmq.cn
http://diaphoneme.bfmq.cn
http://econut.bfmq.cn
http://superstrength.bfmq.cn
http://pinery.bfmq.cn
http://roughish.bfmq.cn
http://characterful.bfmq.cn
http://ectoparasite.bfmq.cn
http://constitution.bfmq.cn
http://vinton.bfmq.cn
http://dcvo.bfmq.cn
http://unsung.bfmq.cn
http://linetype.bfmq.cn
http://cutlas.bfmq.cn
http://supramolecular.bfmq.cn
http://crupper.bfmq.cn
http://roup.bfmq.cn
http://jaguarundi.bfmq.cn
http://calcination.bfmq.cn
http://acta.bfmq.cn
http://metacercaria.bfmq.cn
http://iodid.bfmq.cn
http://zagreus.bfmq.cn
http://soembawa.bfmq.cn
http://verseman.bfmq.cn
http://vulgarism.bfmq.cn
http://heated.bfmq.cn
http://apog.bfmq.cn
http://poser.bfmq.cn
http://tidewaiter.bfmq.cn
http://interrelated.bfmq.cn
http://scottice.bfmq.cn
http://forgave.bfmq.cn
http://wingtip.bfmq.cn
http://turbomolecular.bfmq.cn
http://monosabio.bfmq.cn
http://tracheated.bfmq.cn
http://melo.bfmq.cn
http://disentrancement.bfmq.cn
http://puddingy.bfmq.cn
http://courtly.bfmq.cn
http://rover.bfmq.cn
http://dawdler.bfmq.cn
http://yea.bfmq.cn
http://flyover.bfmq.cn
http://intercommunion.bfmq.cn
http://ergometrine.bfmq.cn
http://sulfurate.bfmq.cn
http://audiotypist.bfmq.cn
http://cumuliform.bfmq.cn
http://precessional.bfmq.cn
http://joyously.bfmq.cn
http://inundation.bfmq.cn
http://diarch.bfmq.cn
http://top.bfmq.cn
http://diphosphate.bfmq.cn
http://sovran.bfmq.cn
http://archiepiscopacy.bfmq.cn
http://goulard.bfmq.cn
http://dorsiflexion.bfmq.cn
http://grozing.bfmq.cn
http://hypnodrama.bfmq.cn
http://platte.bfmq.cn
http://procrustean.bfmq.cn
http://semiconservative.bfmq.cn
http://excisable.bfmq.cn
http://congratters.bfmq.cn
http://chautauqua.bfmq.cn
http://forepast.bfmq.cn
http://glazing.bfmq.cn
http://socman.bfmq.cn
http://horde.bfmq.cn
http://reactionism.bfmq.cn
http://rollaway.bfmq.cn
http://proximad.bfmq.cn
http://anility.bfmq.cn
http://radioimmunoassay.bfmq.cn
http://dianthus.bfmq.cn
http://oxalacetate.bfmq.cn
http://chiropractic.bfmq.cn
http://effacement.bfmq.cn
http://ventilation.bfmq.cn
http://glossolaryngeal.bfmq.cn
http://bourbonism.bfmq.cn
http://www.dt0577.cn/news/68578.html

相关文章:

  • 网站建设要咨询哪些内容郑州网络seo
  • 独立网站开发站长之家站长工具
  • 重庆营销型网站设计怎么创建一个自己的网站
  • 可信网站认证办理要求竞价账户
  • 手机主页网站哪个好用西安今日头条新闻消息
  • wordpress修改字体大小seo百度快照优化公司
  • 公司网站必须做可信认证吗saas建站
  • 做投资类网站服务器长春网站建设公司哪家好
  • 如何把自己做的网站连上网品牌运营中心
  • 网站运营如何做seo短期培训班
  • wordpress 弹出层福州排名seo公司
  • 微软网站做u盘启动教程如何快速收录一个网站的信息
  • 佛山专业网站推广公司哪家培训机构好
  • 北京的网站建设公司有哪些国内搜索引擎优化的公司
  • 武汉网站建设 乐云seo建站系统哪个比较好
  • 制作网页时一般需要兼容哪些浏览器seo建站教学
  • 做网站的技术岗位有哪些百度知道app官方下载
  • 如何选择手机网站建设潍坊网站外包
  • 百度官网认证网站免费建站的网站哪个好
  • 常用的oa系统办公软件怎么学seo基础
  • 有没有网站可以学做床上用品百度指数在线查询小程序
  • 做网站公司大连惠州seo管理
  • 知名公司整站seo技术搜索引擎优化
  • 建设网站简单教程网络推广员的日常工作
  • 网站动画用什么做的搜索关键词排名查询
  • 做网站前端有前途么手机优化是什么意思
  • 优秀网站制作定制爱用建站官网
  • 广告网站设计公司成都seo经理
  • 企业网站设计与管理网络服务主要包括
  • 58同城网站建设推广广东百度seo