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

在电脑上怎么做网站html代码hr表示

在电脑上怎么做网站,html代码hr表示,微软雅黑 wordpress,东莞有哪些互联网公司需求 得到树结构数据也可以用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://www.yayakq.cn/news/585079/

相关文章:

  • 南沙区网站建设企业管理咨询做什么的
  • 网站开发绑定微信qq注册专门做书单的网站
  • 濮阳建设企业网站公司购物商城外贸网站建设
  • 5个网站建设大连建设网网址是多少啊
  • 定制网站设计方案wordpress pdf下载插件
  • 自己做网络主播的网站建设网站相关法律条文
  • 百度资源站长平台专门做自助游的网站
  • 建立企业网站方案网站开发前端规范
  • 网站开发用的开源系统包牛牛网站怎么做
  • 做文库网站怎么赚钱吗电子商务网站建设的试卷
  • 网站开发怎么设置打印按钮做app一般多少钱
  • 中兴通讯的网站建设分析昆明网站设计能实现什么功能
  • 四会城乡建设局网站哈尔滨网络推广经理招聘
  • 好的装修效果图网站能自己做生物实验的网站
  • 西安网站优化平台天蓝色网站
  • 网站图片分辨率尺寸网站建设报价单 excel
  • 金色世纪做网站的是哪个岗位采购管理系统软件
  • 重庆网站建设网站网站建设成功案例宣传
  • 蓝色经典通用网站模板徐州苏视网站建设
  • 郑州便宜网站建设wordpress朗读功能
  • 揭阳 网站建设wordpress安装上传
  • 黑五手表网站分类目录模板
  • 天宁寺网站建设推荐好用的分销平台
  • 娄底网站建设设计友情链接的检查方法
  • 网站点击量 哪里查询开发手机网站多少钱
  • 手机网站设计开发服务网站开发语言有哪些
  • 乐陵网站建设广东网页空间租赁
  • 这样做微信网站市场营销手段13种手段
  • 银行收取网站建设费的会计科目四川城乡住房和城乡建设厅网站首页
  • 金华网站建设方案策划做网站信息