4 Commits 9b3fc4c5c0 ... a1882f1f6f

Auteur SHA1 Bericht Datum
  feng_ting-ting a1882f1f6f . 1 week geleden
  feng_ting-ting bede12971b . 1 week geleden
  feng_ting-ting 10a52b05b1 . 1 week geleden
  feng_ting-ting ab09ecc5a3 . 1 week geleden
21 gewijzigde bestanden met toevoegingen van 536 en 24 verwijderingen
  1. 1 1
      XiaoETech-admin/src/main/java/com/zhentao/RuoYiApplication.java
  2. 29 0
      XiaoETech-admin/src/main/java/com/zhentao/web/controller/system/CourseCategoryController.java
  3. 43 0
      XiaoETech-admin/src/main/java/com/zhentao/web/controller/system/CourseController.java
  4. 2 2
      XiaoETech-admin/src/main/resources/application-druid.yml
  5. 9 0
      XiaoETech-admin/src/main/resources/application.yml
  6. 4 3
      XiaoETech-common/pom.xml
  7. 1 1
      XiaoETech-framework/pom.xml
  8. 10 9
      XiaoETech-framework/src/main/java/com/zhentao/framework/config/MyBatisConfig.java
  9. 1 1
      XiaoETech-framework/src/main/java/com/zhentao/framework/config/SecurityConfig.java
  10. 6 1
      XiaoETech-quartz/pom.xml
  11. 30 3
      XiaoETech-system/pom.xml
  12. 128 0
      XiaoETech-system/src/main/java/com/zhentao/system/domain/Course.java
  13. 91 0
      XiaoETech-system/src/main/java/com/zhentao/system/domain/CourseCategory.java
  14. 21 0
      XiaoETech-system/src/main/java/com/zhentao/system/mapper/CourseCategoryMapper.java
  15. 16 0
      XiaoETech-system/src/main/java/com/zhentao/system/mapper/CourseMapper.java
  16. 21 0
      XiaoETech-system/src/main/java/com/zhentao/system/service/CourseService.java
  17. 28 0
      XiaoETech-system/src/main/java/com/zhentao/system/service/impl/CourseCategoryServiceImpl.java
  18. 29 0
      XiaoETech-system/src/main/java/com/zhentao/system/service/impl/CourseServiceImpl.java
  19. 20 0
      XiaoETech-system/src/main/resources/mapper/system/CourseCategoryMapper.xml
  20. 43 0
      XiaoETech-system/src/main/resources/mapper/system/CourseMapper.xml
  21. 3 3
      pom.xml

+ 1 - 1
XiaoETech-admin/src/main/java/com/zhentao/RuoYiApplication.java

@@ -6,7 +6,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
 
 /**
  * 启动程序
- * 
+ *
  * @author ruoyi
  */
 @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })

+ 29 - 0
XiaoETech-admin/src/main/java/com/zhentao/web/controller/system/CourseCategoryController.java

@@ -0,0 +1,29 @@
+package com.zhentao.web.controller.system;
+
+import com.zhentao.common.annotation.Anonymous;
+import com.zhentao.common.core.domain.AjaxResult;
+import com.zhentao.system.domain.CourseCategory;
+import com.zhentao.system.service.CourseCategoryService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * @date: 2025/5/12 9:06
+ * @author: ftt
+ */
+@RestController
+@Anonymous
+@RequestMapping("/system/category")
+public class CourseCategoryController {
+    @Autowired
+    private CourseCategoryService service;
+
+    @RequestMapping("/findAll")
+    public AjaxResult findAll(){
+        List<CourseCategory> list = service.findAll();
+        return AjaxResult.success(list);
+    }
+}

+ 43 - 0
XiaoETech-admin/src/main/java/com/zhentao/web/controller/system/CourseController.java

@@ -0,0 +1,43 @@
+package com.zhentao.web.controller.system;
+
+import com.zhentao.common.annotation.Anonymous;
+import com.zhentao.common.core.controller.BaseController;
+import com.zhentao.common.core.domain.AjaxResult;
+import com.zhentao.common.core.page.TableDataInfo;
+import com.zhentao.system.domain.Course;
+import com.zhentao.system.service.CourseService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * @author: wzy
+ * @date: 2025/5/8 16:14
+ */
+@RestController
+@Anonymous
+@RequestMapping("/system/course")
+public class CourseController extends BaseController {
+    @Autowired
+    private CourseService courseService;
+
+    /**
+     * 课程列表查询
+     * @param course
+     * @return
+     */
+    @RequestMapping("/list")
+    public TableDataInfo list(Course course){
+        startPage();
+        List<Course> courseList = courseService.selectCourseList(course);
+        return getDataTable(courseList);
+    }
+
+    @RequestMapping("/findById")
+    public AjaxResult findById(Integer courseCategory){
+        List<Course> byId = courseService.findById(courseCategory);
+        return AjaxResult.success(byId);
+    }
+}

+ 2 - 2
XiaoETech-admin/src/main/resources/application-druid.yml

@@ -6,9 +6,9 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://123.57.134.90:3306/xiao?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                url: jdbc:mysql://localhost:3306/xiao?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                 username: root
-                password: Tingting520
+                password: root
             # 从库数据源
             slave:
                 # 从数据源开关/默认关闭

+ 9 - 0
XiaoETech-admin/src/main/resources/application.yml

@@ -133,3 +133,12 @@ xss:
 wx-app:
   appId: wxa2a76a594be60e4d
   appSecret: 73e228a4fea627fb74d5a9de8585d880
+
+#wx:
+#  pay:
+#    appId:  #微信公众号或者小程序等的appid
+#    secret:
+#    mchId: 1516562401 #微信支付商户号
+#    mchKey: 7f633cbfbd892b4d256bc6edffe3b089 #微信支付商户密钥
+#    notifyUrl: http://8.130.135.74:8053/api/order/student/pay/wxCallback #支付回调地址
+

+ 4 - 3
XiaoETech-common/pom.xml

@@ -17,6 +17,7 @@
 
     <dependencies>
 
+
         <!-- Spring框架基本的核心工具 -->
         <dependency>
             <groupId>org.springframework</groupId>
@@ -52,13 +53,13 @@
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
         </dependency>
-  
+
         <!-- JSON工具类 -->
         <dependency>
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-databind</artifactId>
         </dependency>
-        
+
         <!-- 阿里JSON解析器 -->
         <dependency>
             <groupId>com.alibaba.fastjson2</groupId>
@@ -121,4 +122,4 @@
 
     </dependencies>
 
-</project>
+</project>

+ 1 - 1
XiaoETech-framework/pom.xml

@@ -61,4 +61,4 @@
 
     </dependencies>
 
-</project>
+</project>

+ 10 - 9
XiaoETech-framework/src/main/java/com/zhentao/framework/config/MyBatisConfig.java

@@ -1,11 +1,6 @@
 package com.zhentao.framework.config;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import javax.sql.DataSource;
+import com.zhentao.common.utils.StringUtils;
 import org.apache.ibatis.io.VFS;
 import org.apache.ibatis.session.SqlSessionFactory;
 import org.mybatis.spring.SqlSessionFactoryBean;
@@ -22,11 +17,17 @@ import org.springframework.core.type.classreading.CachingMetadataReaderFactory;
 import org.springframework.core.type.classreading.MetadataReader;
 import org.springframework.core.type.classreading.MetadataReaderFactory;
 import org.springframework.util.ClassUtils;
-import com.zhentao.common.utils.StringUtils;
+
+import javax.sql.DataSource;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
 
 /**
  * Mybatis支持*匹配扫描包
- * 
+ *
  * @author ruoyi
  */
 @Configuration
@@ -129,4 +130,4 @@ public class MyBatisConfig
         sessionFactory.setConfigLocation(new DefaultResourceLoader().getResource(configLocation));
         return sessionFactory.getObject();
     }
-}
+}

+ 1 - 1
XiaoETech-framework/src/main/java/com/zhentao/framework/config/SecurityConfig.java

@@ -114,7 +114,7 @@ public class SecurityConfig
                 requests.antMatchers("/login", "/wxLogin","/register", "/captchaImage").permitAll()
                     // 静态资源,可匿名访问
                     .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
-                    .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
+                    .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**","/system/*", "/*/api-docs", "/druid/**").permitAll()
                     // 除上面外的所有请求全部需要鉴权认证
                     .anyRequest().authenticated();
             })

+ 6 - 1
XiaoETech-quartz/pom.xml

@@ -17,6 +17,11 @@
 
     <dependencies>
 
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+
         <!-- 定时任务 -->
         <dependency>
             <groupId>org.quartz-scheduler</groupId>
@@ -37,4 +42,4 @@
 
     </dependencies>
 
-</project>
+</project>

+ 30 - 3
XiaoETech-system/pom.xml

@@ -16,13 +16,40 @@
     </description>
 
     <dependencies>
-
+        <!-- 集成mybatis-plus -->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-core</artifactId>
+            <version>3.5.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>1.1.20</version>
+        </dependency>
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt</artifactId>
+            <version>0.9.1</version>
+        </dependency>
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.8.11</version> <!-- 确保版本号是正确的 -->
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
         <!-- 通用工具-->
         <dependency>
             <groupId>com.zhentao</groupId>
             <artifactId>zhentao-common</artifactId>
         </dependency>
-
     </dependencies>
 
-</project>
+</project>

+ 128 - 0
XiaoETech-system/src/main/java/com/zhentao/system/domain/Course.java

@@ -0,0 +1,128 @@
+package com.zhentao.system.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @TableName course
+ */
+@TableName(value ="course")
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class Course implements Serializable {
+    private Integer courseId;
+
+    private String courseName;
+
+    private String courseDescription;
+
+    private Integer courseCategory;
+
+    private Integer instructorId;
+
+    private String courseCover;
+
+    private BigDecimal coursePrice;
+
+    private Integer courseDuration;
+
+    private Date createTime;
+
+    private Date updateTime;
+
+    private Object courseStatus;
+
+    private Integer studyNum;
+
+    private Integer isFree;
+
+    private Integer recommendIndex;
+
+    private String courseOutline;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public boolean equals(Object that) {
+        if (this == that) {
+            return true;
+        }
+        if (that == null) {
+            return false;
+        }
+        if (getClass() != that.getClass()) {
+            return false;
+        }
+        com.zhentao.system.domain.Course other = (com.zhentao.system.domain.Course) that;
+        return (this.getCourseId() == null ? other.getCourseId() == null : this.getCourseId().equals(other.getCourseId()))
+                && (this.getCourseName() == null ? other.getCourseName() == null : this.getCourseName().equals(other.getCourseName()))
+                && (this.getCourseDescription() == null ? other.getCourseDescription() == null : this.getCourseDescription().equals(other.getCourseDescription()))
+                && (this.getCourseCategory() == null ? other.getCourseCategory() == null : this.getCourseCategory().equals(other.getCourseCategory()))
+                && (this.getInstructorId() == null ? other.getInstructorId() == null : this.getInstructorId().equals(other.getInstructorId()))
+                && (this.getCourseCover() == null ? other.getCourseCover() == null : this.getCourseCover().equals(other.getCourseCover()))
+                && (this.getCoursePrice() == null ? other.getCoursePrice() == null : this.getCoursePrice().equals(other.getCoursePrice()))
+                && (this.getCourseDuration() == null ? other.getCourseDuration() == null : this.getCourseDuration().equals(other.getCourseDuration()))
+                && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
+                && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
+                && (this.getCourseStatus() == null ? other.getCourseStatus() == null : this.getCourseStatus().equals(other.getCourseStatus()))
+                && (this.getStudyNum() == null ? other.getStudyNum() == null : this.getStudyNum().equals(other.getStudyNum()))
+                && (this.getIsFree() == null ? other.getIsFree() == null : this.getIsFree().equals(other.getIsFree()))
+                && (this.getRecommendIndex() == null ? other.getRecommendIndex() == null : this.getRecommendIndex().equals(other.getRecommendIndex()))
+                && (this.getCourseOutline() == null ? other.getCourseOutline() == null : this.getCourseOutline().equals(other.getCourseOutline()));
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((getCourseId() == null) ? 0 : getCourseId().hashCode());
+        result = prime * result + ((getCourseName() == null) ? 0 : getCourseName().hashCode());
+        result = prime * result + ((getCourseDescription() == null) ? 0 : getCourseDescription().hashCode());
+        result = prime * result + ((getCourseCategory() == null) ? 0 : getCourseCategory().hashCode());
+        result = prime * result + ((getInstructorId() == null) ? 0 : getInstructorId().hashCode());
+        result = prime * result + ((getCourseCover() == null) ? 0 : getCourseCover().hashCode());
+        result = prime * result + ((getCoursePrice() == null) ? 0 : getCoursePrice().hashCode());
+        result = prime * result + ((getCourseDuration() == null) ? 0 : getCourseDuration().hashCode());
+        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
+        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
+        result = prime * result + ((getCourseStatus() == null) ? 0 : getCourseStatus().hashCode());
+        result = prime * result + ((getStudyNum() == null) ? 0 : getStudyNum().hashCode());
+        result = prime * result + ((getIsFree() == null) ? 0 : getIsFree().hashCode());
+        result = prime * result + ((getRecommendIndex() == null) ? 0 : getRecommendIndex().hashCode());
+        result = prime * result + ((getCourseOutline() == null) ? 0 : getCourseOutline().hashCode());
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", courseId=").append(courseId);
+        sb.append(", courseName=").append(courseName);
+        sb.append(", courseDescription=").append(courseDescription);
+        sb.append(", courseCategory=").append(courseCategory);
+        sb.append(", instructorId=").append(instructorId);
+        sb.append(", courseCover=").append(courseCover);
+        sb.append(", coursePrice=").append(coursePrice);
+        sb.append(", courseDuration=").append(courseDuration);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", courseStatus=").append(courseStatus);
+        sb.append(", studyNum=").append(studyNum);
+        sb.append(", isFree=").append(isFree);
+        sb.append(", recommendIndex=").append(recommendIndex);
+        sb.append(", courseOutline=").append(courseOutline);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 91 - 0
XiaoETech-system/src/main/java/com/zhentao/system/domain/CourseCategory.java

@@ -0,0 +1,91 @@
+package com.zhentao.system.domain;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @TableName course_category
+ */
+
+@Data
+public class CourseCategory implements Serializable {
+    private Integer categoryId;
+
+    private String categoryName;
+
+    private String categoryDescription;
+
+    public Integer getCategoryId() {
+        return categoryId;
+    }
+
+    public void setCategoryId(Integer categoryId) {
+        this.categoryId = categoryId;
+    }
+
+    public String getCategoryName() {
+        return categoryName;
+    }
+
+    public void setCategoryName(String categoryName) {
+        this.categoryName = categoryName;
+    }
+
+    public String getCategoryDescription() {
+        return categoryDescription;
+    }
+
+    public void setCategoryDescription(String categoryDescription) {
+        this.categoryDescription = categoryDescription;
+    }
+
+    public CourseCategory(Integer categoryId, String categoryName, String categoryDescription) {
+        this.categoryId = categoryId;
+        this.categoryName = categoryName;
+        this.categoryDescription = categoryDescription;
+    }
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public boolean equals(Object that) {
+        if (this == that) {
+            return true;
+        }
+        if (that == null) {
+            return false;
+        }
+        if (getClass() != that.getClass()) {
+            return false;
+        }
+        CourseCategory other = (CourseCategory) that;
+        return (this.getCategoryId() == null ? other.getCategoryId() == null : this.getCategoryId().equals(other.getCategoryId()))
+            && (this.getCategoryName() == null ? other.getCategoryName() == null : this.getCategoryName().equals(other.getCategoryName()))
+            && (this.getCategoryDescription() == null ? other.getCategoryDescription() == null : this.getCategoryDescription().equals(other.getCategoryDescription()));
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((getCategoryId() == null) ? 0 : getCategoryId().hashCode());
+        result = prime * result + ((getCategoryName() == null) ? 0 : getCategoryName().hashCode());
+        result = prime * result + ((getCategoryDescription() == null) ? 0 : getCategoryDescription().hashCode());
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", categoryId=").append(categoryId);
+        sb.append(", categoryName=").append(categoryName);
+        sb.append(", categoryDescription=").append(categoryDescription);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 21 - 0
XiaoETech-system/src/main/java/com/zhentao/system/mapper/CourseCategoryMapper.java

@@ -0,0 +1,21 @@
+package com.zhentao.system.mapper;
+
+import com.zhentao.system.domain.CourseCategory;
+
+import java.util.List;
+
+/**
+* @author ASUS
+* @description 针对表【course_category(课程分类表)】的数据库操作Mapper
+* @createDate 2025-05-12 09:05:20
+* @Entity com.zhentao.system.domain.CourseCategory
+*/
+
+public interface CourseCategoryMapper{
+
+    List<CourseCategory> findAll();
+}
+
+
+
+

+ 16 - 0
XiaoETech-system/src/main/java/com/zhentao/system/mapper/CourseMapper.java

@@ -0,0 +1,16 @@
+package com.zhentao.system.mapper;
+
+
+import com.zhentao.system.domain.Course;
+
+import java.util.List;
+
+/**
+ * @author: wzy
+ * @date: 2025/5/8 17:11
+ */
+public interface CourseMapper{
+    List<Course> selectCourseList(Course course);
+
+    List<Course> findById(Integer courseCategory);
+}

+ 21 - 0
XiaoETech-system/src/main/java/com/zhentao/system/service/CourseService.java

@@ -0,0 +1,21 @@
+package com.zhentao.system.service;
+
+
+import com.zhentao.system.domain.Course;
+
+import java.util.List;
+
+/**
+ * @author: wzy
+ * @date: 2025/5/8 17:04
+ */
+public interface CourseService {
+    /**
+     * 根据条件分页查询课程列表
+     * @param course
+     * @return
+     */
+    List<Course> selectCourseList(Course course);
+
+    List<Course> findById(Integer courseCategory);
+}

+ 28 - 0
XiaoETech-system/src/main/java/com/zhentao/system/service/impl/CourseCategoryServiceImpl.java

@@ -0,0 +1,28 @@
+package com.zhentao.system.service.impl;
+
+import com.zhentao.system.domain.CourseCategory;
+import com.zhentao.system.mapper.CourseCategoryMapper;
+import com.zhentao.system.service.CourseCategoryService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+* @author ASUS
+* @description 针对表【course_category(课程分类表)】的数据库操作Service实现
+* @createDate 2025-05-12 09:05:20
+*/
+@Service
+public class CourseCategoryServiceImpl implements CourseCategoryService{
+    @Autowired
+    private CourseCategoryMapper mapper;
+    @Override
+    public List<CourseCategory> findAll() {
+        return mapper.findAll();
+    }
+}
+
+
+
+

+ 29 - 0
XiaoETech-system/src/main/java/com/zhentao/system/service/impl/CourseServiceImpl.java

@@ -0,0 +1,29 @@
+package com.zhentao.system.service.impl;
+
+
+import com.zhentao.system.domain.Course;
+import com.zhentao.system.mapper.CourseMapper;
+import com.zhentao.system.service.CourseService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author: wzy
+ * @date: 2025/5/8 17:04
+ */
+@Service
+public class CourseServiceImpl implements CourseService {
+    @Autowired
+    private CourseMapper courseMapper;
+    @Override
+    public List<Course> selectCourseList(Course course) {
+        return courseMapper.selectCourseList(course);
+    }
+
+    @Override
+    public List<Course> findById(Integer courseCategory) {
+        return courseMapper.findById(courseCategory);
+    }
+}

+ 20 - 0
XiaoETech-system/src/main/resources/mapper/system/CourseCategoryMapper.xml

@@ -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.zhentao.system.mapper.CourseCategoryMapper">
+
+    <resultMap id="BaseResultMap" type="com.zhentao.system.domain.CourseCategory">
+            <id property="categoryId" column="category_id" jdbcType="INTEGER"/>
+            <result property="categoryName" column="category_name" jdbcType="VARCHAR"/>
+            <result property="categoryDescription" column="category_description" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        category_id,category_name,category_description
+    </sql>
+    <select id="findAll" resultType="com.zhentao.system.domain.CourseCategory">
+        select * from course_category
+    </select>
+
+</mapper>

+ 43 - 0
XiaoETech-system/src/main/resources/mapper/system/CourseMapper.xml

@@ -0,0 +1,43 @@
+<?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.zhentao.system.mapper.CourseMapper">
+    <resultMap id="BaseResultMap" type="com.zhentao.system.domain.Course">
+        <id property="courseId" column="course_id" jdbcType="INTEGER"/>
+        <result property="courseName" column="course_name" jdbcType="VARCHAR"/>
+        <result property="courseDescription" column="course_description" jdbcType="VARCHAR"/>
+        <result property="courseCategory" column="course_category" jdbcType="INTEGER"/>
+        <result property="instructorId" column="instructor_id" jdbcType="INTEGER"/>
+        <result property="courseCover" column="course_cover" jdbcType="VARCHAR"/>
+        <result property="coursePrice" column="course_price" jdbcType="DECIMAL"/>
+        <result property="courseDuration" column="course_duration" jdbcType="INTEGER"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+        <result property="courseStatus" column="course_status" jdbcType="OTHER"/>
+        <result property="studyNum" column="study_num" jdbcType="INTEGER"/>
+        <result property="isFree" column="is_free" jdbcType="TINYINT"/>
+        <result property="recommendIndex" column="recommend_index" jdbcType="INTEGER"/>
+        <result property="courseOutline" column="course_outline" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        course_id,course_name,course_description,
+        course_category,instructor_id,course_cover,
+        course_price,course_duration,create_time,
+        update_time,course_status,study_num,
+        is_free,recommend_index,course_outline
+    </sql>
+    <select id="selectCourseList" resultType="com.zhentao.system.domain.Course">
+        select c.*, cc.category_name, i.instructor_name from course c left join course_category cc on c.course_category = cc.category_id
+        left join instructor i on c.instructor_id = i.instructor_id
+        where c.course_status = '上线'
+        <if test="courseName != null and courseName != ''">
+            and c.course_name like concat('%', #{courseName}, '%')
+        </if>
+        <if test="courseCategory != null">
+            and c.course_category = #{courseCategory}
+        </if>
+    </select>
+    <select id="findById" resultType="com.zhentao.system.domain.Course">
+        select * from course where course_category = #{courseCategory}
+    </select>
+</mapper>

+ 3 - 3
pom.xml

@@ -3,7 +3,7 @@
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 	<modelVersion>4.0.0</modelVersion>
-	
+
     <groupId>com.zhentao</groupId>
     <artifactId>zhentao</artifactId>
     <version>3.8.9</version>
@@ -11,7 +11,7 @@
     <name>XiaoETech</name>
     <url>http://www.ruoyi.vip</url>
     <description>小鹅通管理平台</description>
-    
+
     <properties>
         <zhentao.version>3.8.9</zhentao.version>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -271,4 +271,4 @@
         </pluginRepository>
     </pluginRepositories>
 
-</project>
+</project>