he2802 2 жил өмнө
parent
commit
9904c8367f

+ 66 - 1
run-prod.sh

@@ -1,5 +1,36 @@
 #!/usr/bin/env bash
 #!/usr/bin/env bash
-
+# 定义应用组名
+group_name='zhongzheng'
+# 定义应用名称
+app_name='zhongzheng-saas-api'
+# 定义应用版本
+app_version='1.0-SNAPSHOT'
+# 定义应用环境
+profile_active='prod'
+echo '----copy jar----'
+docker stop ${app_name}
+echo '----stop container----'
+docker rm ${app_name}
+echo '----rm container----'
+docker rmi ${group_name}/${app_name}:${app_version}
+echo '----rm image----'
+# 打包编译docker镜像
+docker build -f /mydata/maven/build/Dockerfile -t ${group_name}/${app_name}:${app_version} .
+echo '----build image----'
+docker run -p 5055:5055 --name ${app_name} \
+--restart=always \
+-e 'spring.profiles.active'=${profile_active} \
+-e TZ="Asia/Shanghai" \
+-m 10240m \
+--cpus=3 \
+--log-opt max-size=50m \
+--log-opt max-file=3 \
+-v /etc/localtime:/etc/localtime \
+-v /usr/share/fonts:/usr/share/fonts \
+-v /data/logs/prod_api:/logs \
+-v /mydata/app/${app_name}/logs:/var/logs \
+-d ${group_name}/${app_name}:${app_version}
+echo '----start container----'
 
 
 echo "开始等待20秒..."
 echo "开始等待20秒..."
 # 1-10秒内随机
 # 1-10秒内随机
@@ -46,6 +77,40 @@ echo "开始等待20秒..."
 sleep 5
 sleep 5
 echo "等待后继续"
 echo "等待后继续"
 
 
+#!/usr/bin/env bash
+# 定义应用组名
+group_admin_name='zhongzheng'
+# 定义应用名称
+app_admin_name='zhongzheng-saas-admin-top'
+# 定义应用版本
+app_admin_version='1.0-SNAPSHOT'
+# 定义应用环境
+profile_active='prod'
+echo '----copy jar admin top----'
+docker stop ${app_admin_name}
+echo '----stop container admin top----'
+docker rm ${app_admin_name}
+echo '----rm container admin top----'
+docker rmi ${group_admin_name}/${app_admin_name}:${app_admin_version}
+echo '----rm image admin top----'
+# 打包编译docker镜像
+docker build -f /mydata/maven/build/Dockerfile-saas -t ${group_admin_name}/${app_admin_name}:${app_admin_version} .
+echo '----build image admin top----'
+docker run \
+-p 7077:7077 \
+--name ${app_admin_name} \
+--restart=always \
+--log-opt max-size=50m \
+--log-opt max-file=3 \
+-e 'spring.profiles.active'=${profile_active} \
+-e TZ="Asia/Shanghai" \
+-v /etc/localtime:/etc/localtime \
+-v /usr/share/fonts:/usr/share/fonts \
+-v /data/logs/prod_admin_top:/logs \
+-v /mydata/app/${app_admin_name}/logs:/var/logs \
+-v /data/nginx/conf.d:/data/nginx/conf.d \
+-d ${group_admin_name}/${app_admin_name}:${app_admin_version}
+echo '----start container admin top----'
 
 
 
 
 
 

+ 16 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/goods/GoodsController.java

@@ -182,6 +182,14 @@ public class GoodsController extends BaseController {
         return toAjax(iGoodsService.insertBankByAddBo(bo)>0 ? 1 : 0);
         return toAjax(iGoodsService.insertBankByAddBo(bo)>0 ? 1 : 0);
     }
     }
 
 
+    @ApiOperation("新增讲义商品")
+    @PreAuthorize("@ss.hasPermi('system:goods:add')")
+    @Log(title = "商品", businessType = BusinessType.INSERT)
+    @PostMapping("/handouts")
+    public AjaxResult<Void> addHandouts(@RequestBody GoodsAddBo bo) {
+        return toAjax(iGoodsService.insertHandoutsByAddBo(bo)>0 ? 1 : 0);
+    }
+
     /**
     /**
      * 修改商品
      * 修改商品
      */
      */
@@ -193,6 +201,14 @@ public class GoodsController extends BaseController {
         return toAjax(iGoodsService.updateBankByEditBo(bo) ? 1 : 0);
         return toAjax(iGoodsService.updateBankByEditBo(bo) ? 1 : 0);
     }
     }
 
 
+    @ApiOperation("修改讲义商品")
+    @PreAuthorize("@ss.hasPermi('system:goods:edit')")
+    @Log(title = "讲义商品", businessType = BusinessType.UPDATE)
+    @PostMapping("/handouts/edit")
+    public AjaxResult<Void> editHandouts(@RequestBody GoodsEditBo bo) {
+        return toAjax(iGoodsService.updateHandoutsByEditBo(bo) ? 1 : 0);
+    }
+
     /**
     /**
      * 查询题目业务层次关系列表
      * 查询题目业务层次关系列表
      */
      */

+ 13 - 5
zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonCourseController.java

@@ -16,12 +16,10 @@ import com.zhongzheng.modules.bank.service.IQuestionModuleChapterService;
 import com.zhongzheng.modules.bank.vo.ExamQuestionVo;
 import com.zhongzheng.modules.bank.vo.ExamQuestionVo;
 import com.zhongzheng.modules.bank.vo.ExamVo;
 import com.zhongzheng.modules.bank.vo.ExamVo;
 import com.zhongzheng.modules.bank.vo.QuestionChapterVo;
 import com.zhongzheng.modules.bank.vo.QuestionChapterVo;
+import com.zhongzheng.modules.course.bo.CourseHandoutsFileQueryBo;
 import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
 import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
 import com.zhongzheng.modules.course.bo.CourseSubjectQueryBo;
 import com.zhongzheng.modules.course.bo.CourseSubjectQueryBo;
-import com.zhongzheng.modules.course.service.ICourseChapterSectionService;
-import com.zhongzheng.modules.course.service.ICourseMenuService;
-import com.zhongzheng.modules.course.service.ICourseModuleChapterService;
-import com.zhongzheng.modules.course.service.ICourseSubjectService;
+import com.zhongzheng.modules.course.service.*;
 import com.zhongzheng.modules.course.vo.*;
 import com.zhongzheng.modules.course.vo.*;
 import com.zhongzheng.modules.goods.bo.GoodsAttachedQueryBo;
 import com.zhongzheng.modules.goods.bo.GoodsAttachedQueryBo;
 import com.zhongzheng.modules.goods.bo.GoodsCourseTeacherQueryBo;
 import com.zhongzheng.modules.goods.bo.GoodsCourseTeacherQueryBo;
@@ -66,7 +64,7 @@ public class CommonCourseController extends BaseController {
 
 
     private final ICourseSubjectService iCourseSubjectService;
     private final ICourseSubjectService iCourseSubjectService;
 
 
-
+    private final ICourseHandoutsService iCourseHandoutsService;
 
 
     /**
     /**
      * 查询课程目录结构列表
      * 查询课程目录结构列表
@@ -120,4 +118,14 @@ public class CommonCourseController extends BaseController {
         List<CourseSubjectVo> list = iCourseSubjectService.queryList(bo);
         List<CourseSubjectVo> list = iCourseSubjectService.queryList(bo);
         return AjaxResult.success(list);
         return AjaxResult.success(list);
     }
     }
+
+    /**
+     * 获取讲义列详细信息
+     */
+    @ApiOperation("获取讲义列详细信息去地址")
+    @GetMapping("/handouts/file/detail")
+    public AjaxResult<CourseHandoutsVo> getInfo(CourseHandoutsFileQueryBo queryBo) {
+        CourseHandoutsVo detail = iCourseHandoutsService.queryByIdNoUrl(queryBo);
+        return AjaxResult.success(detail);
+    }
 }
 }

+ 10 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/course/CourseController.java

@@ -75,6 +75,16 @@ public class CourseController extends BaseController {
         return getDataTable(list);
         return getDataTable(list);
     }
     }
 
 
+    @ApiOperation("查询用户拥有的讲义商品")
+    @GetMapping("/goodsHandoutsList")
+    public TableDataInfo<GoodsUserVo> goodsHandoutsList(CourseQueryBo bo) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
+        startPage();
+        List<GoodsUserVo> list = iCourseService.goodsHandoutsList(bo);
+        return getDataTable(list);
+    }
+
     @ApiOperation("查询用户商品重修状态")
     @ApiOperation("查询用户商品重修状态")
     @GetMapping("/goodsRebuildStatus")
     @GetMapping("/goodsRebuildStatus")
     public AjaxResult<Long> goodsRebuildStatus(CourseQueryBo bo) {
     public AjaxResult<Long> goodsRebuildStatus(CourseQueryBo bo) {

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMapper.java

@@ -36,6 +36,8 @@ public interface CourseMapper extends BaseMapper<Course> {
 
 
     List<GoodsUserVo> goodsList(CourseQueryBo bo);
     List<GoodsUserVo> goodsList(CourseQueryBo bo);
 
 
+    List<GoodsUserVo> goodsHandoutsList(CourseQueryBo bo);
+
     List<CourseUserVo> courseList(CourseQueryBo bo);
     List<CourseUserVo> courseList(CourseQueryBo bo);
 
 
     CourseUserVo getCourseUserVoInfo(Long id);
     CourseUserVo getCourseUserVoInfo(Long id);

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseHandoutsService.java

@@ -24,6 +24,8 @@ public interface ICourseHandoutsService extends IService<CourseHandouts> {
 	 */
 	 */
 	CourseHandoutsVo queryById(CourseHandoutsFileQueryBo queryBo);
 	CourseHandoutsVo queryById(CourseHandoutsFileQueryBo queryBo);
 
 
+	CourseHandoutsVo queryByIdNoUrl(CourseHandoutsFileQueryBo queryBo);
+
 	/**
 	/**
 	 * 查询列表
 	 * 查询列表
 	 */
 	 */

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseService.java

@@ -74,6 +74,8 @@ public interface ICourseService extends IService<Course> {
 
 
     List<GoodsUserVo> goodsList(CourseQueryBo bo);
     List<GoodsUserVo> goodsList(CourseQueryBo bo);
 
 
+	List<GoodsUserVo> goodsHandoutsList(CourseQueryBo bo);
+
 	List<CourseUserVo> courseList(CourseQueryBo bo);
 	List<CourseUserVo> courseList(CourseQueryBo bo);
 
 
 	CourseUserVo getCourseUserVoInfo(Long courseId);
 	CourseUserVo getCourseUserVoInfo(Long courseId);

+ 53 - 6
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseHandoutsServiceImpl.java

@@ -79,7 +79,7 @@ public class CourseHandoutsServiceImpl extends ServiceImpl<CourseHandoutsMapper,
                 String path = file.getUrlName();
                 String path = file.getUrlName();
                 file.setFilePath(getFilePath(file, path));
                 file.setFilePath(getFilePath(file, path));
                 if (file.getType() == 2) {
                 if (file.getType() == 2) {
-                    handleCourseFile(file);
+                    handleCourseFile(file,true);
                 }
                 }
             });
             });
             courseHandoutsVo.setFileList(courseFileVos);
             courseHandoutsVo.setFileList(courseFileVos);
@@ -87,7 +87,48 @@ public class CourseHandoutsServiceImpl extends ServiceImpl<CourseHandoutsMapper,
             List<CourseFileVo> fileVos = courseFileVos.stream().filter(item -> item.getParentId() == 0L).collect(Collectors.toList());
             List<CourseFileVo> fileVos = courseFileVos.stream().filter(item -> item.getParentId() == 0L).collect(Collectors.toList());
             if (!CollectionUtils.isEmpty(fileVos)) {
             if (!CollectionUtils.isEmpty(fileVos)) {
                 fileVos.forEach(file -> {
                 fileVos.forEach(file -> {
-                    assembleFile(file, courseFileVos);
+                    assembleFile(file, courseFileVos,true);
+                });
+                courseHandoutsVo.setFileList(fileVos);
+            }
+        }
+        return courseHandoutsVo;
+    }
+
+    @Override
+    public CourseHandoutsVo queryByIdNoUrl(CourseHandoutsFileQueryBo queryBo) {
+        CourseHandouts db = this.baseMapper.selectById(queryBo.getHandoutsId());
+        if (Validator.isEmpty(db)) {
+            throw new CustomException("查无数据");
+        }
+        //获得讲义业务层
+        CourseHandoutsVo courseHandoutsVo = BeanUtil.toBean(db, CourseHandoutsVo.class);
+        List<CourseHandoutsBusinessVo> courseHandoutsBusinessVos = baseMapper.selectEntity(courseHandoutsVo.getHandoutsId());
+        courseHandoutsVo.setCourseHandoutsBusinessVo(courseHandoutsBusinessVos);
+
+        CourseFileQueryBo bo = new CourseFileQueryBo();
+        bo.setHandoutsId(courseHandoutsVo.getHandoutsId());
+        bo.setUrlName(queryBo.getFileName());
+        List<CourseFileVo> courseFileVos = iCourseFileService.queryList(bo);
+        if (CollectionUtils.isEmpty(courseFileVos)) {
+            courseHandoutsVo.setFileList(new ArrayList<>());
+            return courseHandoutsVo;
+        }
+        if (StringUtils.isNotBlank(queryBo.getFileName())) {
+            courseFileVos.forEach(file -> {
+                //获取路径
+                String path = file.getUrlName();
+                file.setFilePath(getFilePath(file, path));
+                if (file.getType() == 2) {
+                    handleCourseFile(file,false);
+                }
+            });
+            courseHandoutsVo.setFileList(courseFileVos);
+        } else {
+            List<CourseFileVo> fileVos = courseFileVos.stream().filter(item -> item.getParentId() == 0L).collect(Collectors.toList());
+            if (!CollectionUtils.isEmpty(fileVos)) {
+                fileVos.forEach(file -> {
+                    assembleFile(file, courseFileVos,false);
                 });
                 });
                 courseHandoutsVo.setFileList(fileVos);
                 courseHandoutsVo.setFileList(fileVos);
             }
             }
@@ -104,7 +145,10 @@ public class CourseHandoutsServiceImpl extends ServiceImpl<CourseHandoutsMapper,
         return getFilePath(BeanUtil.toBean(courseFile, CourseFileVo.class), urlName);
         return getFilePath(BeanUtil.toBean(courseFile, CourseFileVo.class), urlName);
     }
     }
 
 
-    private void handleCourseFile(CourseFileVo file) {
+    private void handleCourseFile(CourseFileVo file,Boolean withUrl) {
+        if(!withUrl){
+            file.setUrl(null);
+        }
         List<CourseFile> list = iCourseFileService
         List<CourseFile> list = iCourseFileService
                 .list(new LambdaQueryWrapper<CourseFile>()
                 .list(new LambdaQueryWrapper<CourseFile>()
                         .eq(CourseFile::getParentId, file.getFileId())
                         .eq(CourseFile::getParentId, file.getFileId())
@@ -113,12 +157,15 @@ public class CourseHandoutsServiceImpl extends ServiceImpl<CourseHandoutsMapper,
             return;
             return;
         }
         }
         list.forEach(item -> {
         list.forEach(item -> {
-            handleCourseFile(BeanUtil.toBean(item, CourseFileVo.class));
+            handleCourseFile(BeanUtil.toBean(item, CourseFileVo.class),withUrl);
         });
         });
         file.setChildren(list.stream().map(x -> BeanUtil.toBean(x, CourseFileVo.class)).collect(Collectors.toList()));
         file.setChildren(list.stream().map(x -> BeanUtil.toBean(x, CourseFileVo.class)).collect(Collectors.toList()));
     }
     }
 
 
-    private void assembleFile(CourseFileVo parent, List<CourseFileVo> childs) {
+    private void assembleFile(CourseFileVo parent, List<CourseFileVo> childs,Boolean withUrl) {
+        if(!withUrl){
+            parent.setUrl(null);
+        }
         if (CollectionUtils.isEmpty(childs)) {
         if (CollectionUtils.isEmpty(childs)) {
             return;
             return;
         }
         }
@@ -128,7 +175,7 @@ public class CourseHandoutsServiceImpl extends ServiceImpl<CourseHandoutsMapper,
         }
         }
         parent.setChildren(collect);
         parent.setChildren(collect);
         collect.forEach(item -> {
         collect.forEach(item -> {
-            assembleFile(item, childs);
+            assembleFile(item, childs,withUrl);
         });
         });
     }
     }
 
 

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java

@@ -569,6 +569,12 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
         return goodsUserVos;
         return goodsUserVos;
     }
     }
 
 
+    @Override
+    public List<GoodsUserVo> goodsHandoutsList(CourseQueryBo bo) {
+        List<GoodsUserVo> goodsUserVos = baseMapper.goodsHandoutsList(bo);
+        return goodsUserVos;
+    }
+
 
 
     @Override
     @Override
     public List<GoodsUserVo> goodsProgressList(CourseQueryBo bo) {
     public List<GoodsUserVo> goodsProgressList(CourseQueryBo bo) {

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsService.java

@@ -55,6 +55,8 @@ public interface IGoodsService extends IService<Goods> {
 
 
 	Long insertBankByAddBo(GoodsBankAddBo bo);
 	Long insertBankByAddBo(GoodsBankAddBo bo);
 
 
+	Long insertHandoutsByAddBo(GoodsAddBo bo);
+
 	/**
 	/**
 	 * 根据编辑业务对象修改商品
 	 * 根据编辑业务对象修改商品
 	 * @param bo 商品编辑业务对象
 	 * @param bo 商品编辑业务对象
@@ -64,6 +66,8 @@ public interface IGoodsService extends IService<Goods> {
 
 
 	Boolean updateBankByEditBo(GoodsBankEditBo bo);
 	Boolean updateBankByEditBo(GoodsBankEditBo bo);
 
 
+	Boolean updateHandoutsByEditBo(GoodsEditBo bo);
+
 	/**
 	/**
 	 * 校验并删除数据
 	 * 校验并删除数据
 	 * @param ids 主键集合
 	 * @param ids 主键集合

+ 42 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -632,6 +632,24 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         return add.getGoodsId();
         return add.getGoodsId();
     }
     }
 
 
+    @Override
+    public Long insertHandoutsByAddBo(GoodsAddBo bo) {
+        if (StringUtils.isNotBlank(bo.getExternalLink())){
+            Pattern pattern = Pattern.compile("^([hH][tT]{2}[pP]://|[hH][tT]{2}[pP][sS]://)(([A-Za-z0-9-~]+).)+([A-Za-z0-9-~\\/])+$");
+            if (!pattern.matcher(bo.getExternalLink()).matches()){
+                throw new CustomException("请输入正确的商品外链");
+            }
+        }
+        Goods add = BeanUtil.toBean(bo, Goods.class);
+        add.setCode(ServletUtils.getEncoded("SP"));
+        validEntityBeforeSave(add);
+        add.setCreateTime(DateUtils.getNowTime());
+        add.setUpdateTime(DateUtils.getNowTime());
+        boolean result = this.save(add);
+        Long goodsId = add.getGoodsId();
+        return goodsId;
+    }
+
     @Override
     @Override
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     public Boolean updateByEditBo(GoodsEditBo bo) {
     public Boolean updateByEditBo(GoodsEditBo bo) {
@@ -769,6 +787,29 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         return this.updateById(update);
         return this.updateById(update);
     }
     }
 
 
+    @Override
+    public Boolean updateHandoutsByEditBo(GoodsEditBo bo) {
+        if (StringUtils.isNotBlank(bo.getExternalLink())){
+            Pattern pattern = Pattern.compile("^([hH][tT]{2}[pP]://|[hH][tT]{2}[pP][sS]://)(([A-Za-z0-9-~]+).)+([A-Za-z0-9-~\\/])+$");
+            if (!pattern.matcher(bo.getExternalLink()).matches()){
+                throw new CustomException("请输入正确的商品外链");
+            }
+        }
+        Goods update = BeanUtil.toBean(bo, Goods.class);
+        validEntityBeforeSave(update);
+        update.setUpdateTime(DateUtils.getNowTime());
+
+        //购买须知
+        if (Validator.isEmpty(bo.getBuyNote())) {
+            LambdaUpdateWrapper<Goods> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
+            objectLambdaUpdateWrapper.eq(Goods::getGoodsId, bo.getGoodsId());
+            objectLambdaUpdateWrapper.set(Goods::getBuyNote, null);
+            update(null, objectLambdaUpdateWrapper);
+        }
+
+        return this.updateById(update);
+    }
+
     /**
     /**
      * 保存前的数据校验
      * 保存前的数据校验
      *
      *
@@ -4697,7 +4738,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
     }
     }
 
 
     @Override
     @Override
-    
+
     public Goods getOneGoods(String code, Long id) {
     public Goods getOneGoods(String code, Long id) {
         return getOne(new LambdaQueryWrapper<Goods>()
         return getOne(new LambdaQueryWrapper<Goods>()
                 .eq(Goods::getCode, code)
                 .eq(Goods::getCode, code)

+ 43 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml

@@ -594,6 +594,49 @@
         </if>
         </if>
         order by o.create_time desc
         order by o.create_time desc
     </select>
     </select>
+
+    <select id="goodsHandoutsList" parameterType="com.zhongzheng.modules.course.bo.CourseQueryBo"  resultMap="GoodsUserVo">
+        SELECT
+        g.*,
+        o.user_id,
+        og.study_count as order_study_count,
+        og.order_goods_id,
+        og.service_start_time,
+        og.service_end_time,
+        cb.goods_learning_order,
+        (SELECT cet.education_name FROM  course_education_type cet  where cet.id = g.education_type_id) as education_name,
+        (SELECT cet.project_name FROM  course_project_type cet where cet.id = g.project_id) as project_name,
+        (SELECT cet.business_name FROM  course_business cet  where cet.id = g.business_id) as business_name,
+        (SELECT GROUP_CONCAT(subject_name)  from course_subject where FIND_IN_SET(id,g.subject_ids)) subject_names
+        FROM
+        `order` o
+        LEFT JOIN order_goods og ON og.order_sn = o.order_sn
+        LEFT JOIN goods g on og.goods_id = g.goods_id
+        LEFT JOIN course_business cb on g.business_id = cb.id
+        where 1=1
+        AND og.`status` = 1
+        --         AND og.refund_status in (0,1,3)
+        AND og.refund_status in (0,3)
+        AND og.pay_status in (2,3,4)
+        AND g.goods_type =8
+        <if test="userId != null and userId != ''">
+            and o.user_id = #{userId}
+        </if>
+        <if test="educationTypeId != null and educationTypeId != ''">
+            AND g.education_type_id = #{educationTypeId}
+        </if>
+        <if test="businessId != null and businessId != ''">
+            AND g.business_id = #{businessId}
+        </if>
+        <if test="orderGoodsId != null and orderGoodsId != ''">
+            AND og.order_goods_id = #{orderGoodsId}
+        </if>
+        <if test="goodsId != null and goodsId != ''">
+            AND og.goods_id = #{goodsId}
+        </if>
+        order by o.create_time desc
+    </select>
+
     <select id="courseList" parameterType="com.zhongzheng.modules.course.bo.CourseQueryBo"  resultMap="CourseUserVo">
     <select id="courseList" parameterType="com.zhongzheng.modules.course.bo.CourseQueryBo"  resultMap="CourseUserVo">
         SELECT
         SELECT
             c.*,
             c.*,