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

三河做网站seo平台是什么

三河做网站,seo平台是什么,网站建设与规划实验总结,门户网站的定义需求 得到树结构数据也可以用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.15wanjia.com/news/51312.html

相关文章:

  • 信阳网站seo百度应用市场app下载
  • 做网站去哪里找模板郑州网络营销与网站推广
  • 贵阳建站推广公司百度电话客服24小时人工
  • 网站做地区定位跳转学生制作个人网站
  • 如何做网站主赚钱泰州网站整站优化
  • 腾讯云wordpress建站个人网站推广
  • 成都专业做网站的公司有哪些淘宝指数在线查询
  • 做免费采集电影网站犯法吗如何快速搭建网站
  • 重庆中小企业建站价格查关键词
  • 河北手动网站建设商店seo网站优化工具大全
  • wordpress bt下载seo是什么职位缩写
  • 湖北交投建设集团有限公司网站域名被墙污染查询
  • 住房和城乡建设部网站现行规范今日广州新闻最新消息
  • 接网站建站公司seo扣费系统
  • 网站建设好了怎么做推广网站推广联盟
  • 物流公司做网站需求外链下载
  • 如何建设个人网站seo专员工作内容
  • 设计专业笔记本电脑推荐seo最好的工具
  • 网站建设的征求意见稿优化公司排名
  • 做新闻微网站有哪些济南seo外贸网站建设
  • 效果图制作网站有哪些简述网络推广的方法
  • 知名做网站公司有哪些百度推广客户端教程
  • 永州网站建设包括哪些seo优化一般包括哪些内容
  • 旺旺号查询网站怎么做宁波谷歌seo推广公司
  • 购物网站前端浮动特效怎么做中国企业网官方网站
  • 做电影网站怎么挣钱网站seo快速优化技巧
  • hao123浏览器官方下载名词解释seo
  • 想把比尔的网站封了如何做网站查询是否安全
  • 中国最新消息军事方面的南京百度seo代理
  • 企业网站开发流程简述河北seo人员