parent
430d8c36ee
commit
95f5396e8a
@ -0,0 +1,12 @@
|
|||||||
|
package com.tamguo.dao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.tamguo.config.dao.SuperMapper;
|
||||||
|
import com.tamguo.model.CourseEntity;
|
||||||
|
|
||||||
|
public interface CourseMapper extends SuperMapper<CourseEntity>{
|
||||||
|
|
||||||
|
List<CourseEntity> findBySubjectId(String uid);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,93 @@
|
|||||||
|
package com.tamguo.model;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import com.baomidou.mybatisplus.annotations.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotations.TableName;
|
||||||
|
import com.tamguo.config.dao.SuperEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The persistent class for the tiku_chapter database table.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableName(value="tiku_chapter")
|
||||||
|
public class ChapterEntity extends SuperEntity<ChapterEntity> implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private String courseId;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private String parentId;
|
||||||
|
|
||||||
|
private Integer questionNum;
|
||||||
|
|
||||||
|
private Integer pointNum;
|
||||||
|
|
||||||
|
private Integer orders;
|
||||||
|
|
||||||
|
@TableField(exist=false)
|
||||||
|
private List<ChapterEntity> childChapterList;
|
||||||
|
|
||||||
|
public ChapterEntity() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCourseId() {
|
||||||
|
return this.courseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseId(String courseId) {
|
||||||
|
this.courseId = courseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getParentId() {
|
||||||
|
return this.parentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParentId(String parentId) {
|
||||||
|
this.parentId = parentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ChapterEntity> getChildChapterList() {
|
||||||
|
return childChapterList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChildChapterList(List<ChapterEntity> childChapterList) {
|
||||||
|
this.childChapterList = childChapterList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getQuestionNum() {
|
||||||
|
return questionNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuestionNum(Integer questionNum) {
|
||||||
|
this.questionNum = questionNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPointNum() {
|
||||||
|
return pointNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPointNum(Integer pointNum) {
|
||||||
|
this.pointNum = pointNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getOrders() {
|
||||||
|
return orders;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrders(Integer orders) {
|
||||||
|
this.orders = orders;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,129 @@
|
|||||||
|
package com.tamguo.model;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import com.baomidou.mybatisplus.annotations.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotations.TableName;
|
||||||
|
import com.tamguo.config.dao.SuperEntity;
|
||||||
|
|
||||||
|
import java.math.BigInteger;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The persistent class for the tiku_course database table.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableName(value="tiku_course")
|
||||||
|
public class CourseEntity extends SuperEntity<CourseEntity> implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private BigInteger subjectId;
|
||||||
|
|
||||||
|
private BigInteger pointNum;
|
||||||
|
|
||||||
|
private BigInteger questionNum;
|
||||||
|
|
||||||
|
private Integer orders;
|
||||||
|
|
||||||
|
private String seoTitle;
|
||||||
|
|
||||||
|
private String seoKeywords;
|
||||||
|
|
||||||
|
private String seoDescription;
|
||||||
|
|
||||||
|
@TableField(exist=false)
|
||||||
|
private String subjectName;
|
||||||
|
|
||||||
|
@TableField(exist=false)
|
||||||
|
private List<ChapterEntity> chapterList;
|
||||||
|
|
||||||
|
public CourseEntity() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigInteger getSubjectId() {
|
||||||
|
return this.subjectId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubjectId(BigInteger subjectId) {
|
||||||
|
this.subjectId = subjectId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigInteger getQuestionNum() {
|
||||||
|
return questionNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuestionNum(BigInteger questionNum) {
|
||||||
|
this.questionNum = questionNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigInteger getPointNum() {
|
||||||
|
return pointNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPointNum(BigInteger pointNum) {
|
||||||
|
this.pointNum = pointNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getOrders() {
|
||||||
|
return orders;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrders(Integer orders) {
|
||||||
|
this.orders = orders;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ChapterEntity> getChapterList() {
|
||||||
|
return chapterList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChapterList(List<ChapterEntity> chapterList) {
|
||||||
|
this.chapterList = chapterList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSeoTitle() {
|
||||||
|
return seoTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSeoTitle(String seoTitle) {
|
||||||
|
this.seoTitle = seoTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSeoKeywords() {
|
||||||
|
return seoKeywords;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSeoKeywords(String seoKeywords) {
|
||||||
|
this.seoKeywords = seoKeywords;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSeoDescription() {
|
||||||
|
return seoDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSeoDescription(String seoDescription) {
|
||||||
|
this.seoDescription = seoDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long getSerialversionuid() {
|
||||||
|
return serialVersionUID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubjectName() {
|
||||||
|
return subjectName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubjectName(String subjectName) {
|
||||||
|
this.subjectName = subjectName;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package com.tamguo.model;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotations.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotations.TableName;
|
||||||
|
import com.tamguo.config.dao.SuperEntity;
|
||||||
|
|
||||||
|
@TableName(value="tiku_subject")
|
||||||
|
public class SubjectEntity extends SuperEntity<SubjectEntity> implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private String courseId;
|
||||||
|
|
||||||
|
private String courseName;
|
||||||
|
|
||||||
|
@TableField(exist=false)
|
||||||
|
private List<CourseEntity> courseList;
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCourseId() {
|
||||||
|
return courseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseId(String courseId) {
|
||||||
|
this.courseId = courseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCourseName() {
|
||||||
|
return courseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseName(String courseName) {
|
||||||
|
this.courseName = courseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<CourseEntity> getCourseList() {
|
||||||
|
return courseList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseList(List<CourseEntity> courseList) {
|
||||||
|
this.courseList = courseList;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
package com.tamguo.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.tamguo.model.CourseEntity;
|
||||||
|
|
||||||
|
public interface ISubjectService {
|
||||||
|
|
||||||
|
public List<CourseEntity> findCourseList(String subjectId);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
package com.tamguo.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.tamguo.dao.CourseMapper;
|
||||||
|
import com.tamguo.model.CourseEntity;
|
||||||
|
import com.tamguo.service.ISubjectService;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class SubjectService implements ISubjectService{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
CourseMapper courseMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CourseEntity> findCourseList(String subjectId) {
|
||||||
|
return courseMapper.findBySubjectId(subjectId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.tamguo.dao.CourseMapper">
|
||||||
|
|
||||||
|
<select id="findBySubjectId" resultType="CourseEntity">
|
||||||
|
SELECT
|
||||||
|
c.uid,
|
||||||
|
c.`name`,
|
||||||
|
c.orders,
|
||||||
|
c.point_num,
|
||||||
|
c.question_num,
|
||||||
|
c.subject_id
|
||||||
|
FROM
|
||||||
|
tiku_course c
|
||||||
|
WHERE
|
||||||
|
c.subject_id = #{subjectId}
|
||||||
|
ORDER BY orders ASC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in new issue