Răsfoiți Sursa

1.修复bug,设计论坛,站内信,公告,时间回显,登录,考试,统计等
2.给所有统计修复检索时间可能缺少检索时间止当天的情况
3.编写教学活动分析涉及讨论相关新接口,并修改之前接口存在的bug

honorfire 4 luni în urmă
părinte
comite
7c8d48c771
24 a modificat fișierele cu 2074 adăugiri și 203 ștergeri
  1. 19 19
      snowy-plugin/snowy-plugin-auth/snowy-plugin-auth-func/src/main/java/vip/xiaonuo/auth/modular/login/service/impl/AuthServiceImpl.java
  2. 10 0
      snowy-plugin/snowy-plugin-dev/snowy-plugin-dev-func/src/main/java/vip/xiaonuo/dev/modular/message/entity/DevMessage.java
  3. 1 1
      snowy-plugin/snowy-plugin-dev/snowy-plugin-dev-func/src/main/java/vip/xiaonuo/dev/modular/message/service/impl/DevMessageServiceImpl.java
  4. 117 8
      snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/controller/TeachingActivityController.java
  5. 6 1
      snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/PlatformStatusOverviewMapper.java
  6. 108 4
      snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/TeachingActivityMapper.java
  7. 60 0
      snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/mapping/PlatformStatusOverviewMapper.xml
  8. 5 3
      snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/mapping/ResourceStatisticMapper.xml
  9. 14 14
      snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/mapping/StatisticsLearningProgressMapper.xml
  10. 25 24
      snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/mapping/StudyBehaviorProgressMapper.xml
  11. 1226 30
      snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/mapping/TeachingActivityMapper.xml
  12. 68 64
      snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/mapping/VideoAnalysisProgressMapper.xml
  13. 32 4
      snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/service/TeachingActivityService.java
  14. 43 7
      snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/service/impl/PlatformStatusOverviewServiceImpl.java
  15. 4 1
      snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/service/impl/ResourceFootprintServiceImpl.java
  16. 286 12
      snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/service/impl/TeachingActivityServiceImpl.java
  17. 4 0
      snowy-plugin/snowy-plugin-forum/snowy-plugin-forum-func/src/main/java/vip/xiaonuo/forum/modular/postinfo/entity/ForumPostInfoVo.java
  18. 1 0
      snowy-plugin/snowy-plugin-forum/snowy-plugin-forum-func/src/main/java/vip/xiaonuo/forum/modular/postinfo/param/ForumPostInfoAddParam.java
  19. 5 5
      snowy-plugin/snowy-plugin-forum/snowy-plugin-forum-func/src/main/java/vip/xiaonuo/forum/modular/postinfo/service/impl/ForumPostInfoServiceImpl.java
  20. 1 0
      snowy-plugin/snowy-plugin-forum/snowy-plugin-forum-func/src/main/java/vip/xiaonuo/forum/modular/posttype/param/ForumPostTypeAddParam.java
  21. 1 0
      snowy-plugin/snowy-plugin-forum/snowy-plugin-forum-func/src/main/java/vip/xiaonuo/forum/modular/posttype/param/ForumPostTypeEditParam.java
  22. 1 1
      snowy-plugin/snowy-plugin-forum/snowy-plugin-forum-func/src/main/java/vip/xiaonuo/forum/modular/reportinfo/service/impl/ForumReportInfoServiceImpl.java
  23. 2 3
      snowy-plugin/snowy-plugin-sys/snowy-plugin-sys-func/src/main/java/vip/xiaonuo/sys/modular/user/result/SysUserMessageResult.java
  24. 35 2
      snowy-plugin/snowy-plugin-sys/snowy-plugin-sys-func/src/main/java/vip/xiaonuo/sys/modular/user/service/impl/SysUserServiceImpl.java

+ 19 - 19
snowy-plugin/snowy-plugin-auth/snowy-plugin-auth-func/src/main/java/vip/xiaonuo/auth/modular/login/service/impl/AuthServiceImpl.java

@@ -266,25 +266,25 @@ public class AuthServiceImpl implements AuthService {
         }
 
         // 校验验证码
-//        String defaultCaptchaOpen = devConfigApi.getValueByKey(SNOWY_SYS_DEFAULT_CAPTCHA_OPEN_KEY);
-//        if(ObjectUtil.isNotEmpty(defaultCaptchaOpen)) {
-//            if(Convert.toBool(defaultCaptchaOpen)) {
-//                // 获取验证码
-//                String validCode = authAccountPasswordLoginParam.getValidCode();
-//                // 获取验证码请求号
-//                String validCodeReqNo = authAccountPasswordLoginParam.getValidCodeReqNo();
-//                // 开启验证码则必须传入验证码
-//                if(ObjectUtil.isEmpty(validCode)) {
-//                    throw new CommonException(AuthExceptionEnum.VALID_CODE_EMPTY.getValue());
-//                }
-//                // 开启验证码则必须传入验证码请求号
-//                if(ObjectUtil.isEmpty(validCodeReqNo)) {
-//                    throw new CommonException(AuthExceptionEnum.VALID_CODE_REQ_NO_EMPTY.getValue());
-//                }
-//                // 执行校验验证码
-//                validValidCode(null, validCode, validCodeReqNo);
-//            }
-//        }
+        String defaultCaptchaOpen = devConfigApi.getValueByKey(SNOWY_SYS_DEFAULT_CAPTCHA_OPEN_KEY);
+        if(ObjectUtil.isNotEmpty(defaultCaptchaOpen)) {
+            if(Convert.toBool(defaultCaptchaOpen)) {
+                // 获取验证码
+                String validCode = authAccountPasswordLoginParam.getValidCode();
+                // 获取验证码请求号
+                String validCodeReqNo = authAccountPasswordLoginParam.getValidCodeReqNo();
+                // 开启验证码则必须传入验证码
+                if(ObjectUtil.isEmpty(validCode)) {
+                    throw new CommonException(AuthExceptionEnum.VALID_CODE_EMPTY.getValue());
+                }
+                // 开启验证码则必须传入验证码请求号
+                if(ObjectUtil.isEmpty(validCodeReqNo)) {
+                    throw new CommonException(AuthExceptionEnum.VALID_CODE_REQ_NO_EMPTY.getValue());
+                }
+                // 执行校验验证码
+                validValidCode(null, validCode, validCodeReqNo);
+            }
+        }
         // SM2解密并获得前端传来的密码哈希值
         String passwordHash;
         try {

+ 10 - 0
snowy-plugin/snowy-plugin-dev/snowy-plugin-dev-func/src/main/java/vip/xiaonuo/dev/modular/message/entity/DevMessage.java

@@ -12,12 +12,17 @@
  */
 package vip.xiaonuo.dev.modular.message.entity;
 
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
 import vip.xiaonuo.common.pojo.CommonEntity;
 
+import java.util.Date;
+
 /**
  * 站内信实体
  *
@@ -52,4 +57,9 @@ public class DevMessage extends CommonEntity {
     /** 扩展信息 */
     @ApiModelProperty(value = "扩展信息", position = 6)
     private String extJson;
+
+    /** 创建时间 */
+    @ApiModelProperty(value = "创建时间", position = 1000)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
 }

+ 1 - 1
snowy-plugin/snowy-plugin-dev/snowy-plugin-dev-func/src/main/java/vip/xiaonuo/dev/modular/message/service/impl/DevMessageServiceImpl.java

@@ -98,7 +98,7 @@ public class DevMessageServiceImpl extends ServiceImpl<DevMessageMapper, DevMess
         }
         if(ObjectUtil.isAllNotEmpty(devMessagePageParam.getSortField(), devMessagePageParam.getSortOrder())) {
             CommonSortOrderEnum.validate(devMessagePageParam.getSortOrder());
-            queryWrapper.orderBy(true, devMessagePageParam.getSortOrder().equals(CommonSortOrderEnum.ASC.getValue()),
+            queryWrapper.orderBy(true, devMessagePageParam.getSortOrder().equals(CommonSortOrderEnum.DESC.getValue()),
                     StrUtil.toUnderlineCase(devMessagePageParam.getSortField()));
         }
         return this.page(CommonPageRequest.defaultPage(), queryWrapper);

+ 117 - 8
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/controller/TeachingActivityController.java

@@ -1,5 +1,6 @@
 package vip.xiaonuo.disk.controller;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import com.github.xiaoymin.knife4j.annotations.ApiSupport;
 import io.swagger.annotations.Api;
@@ -12,6 +13,8 @@ import vip.xiaonuo.common.pojo.CommonResult;
 import vip.xiaonuo.disk.service.TeachingActivityService;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -27,8 +30,13 @@ public class TeachingActivityController {
     @ApiOperationSupport(order = 1)
     @ApiOperation("文档观看统计")
     @GetMapping("/documentStatistic")
-    public CommonResult<Map<String, Object>> documentStatistic(@RequestParam(value = "courseId", required = false) String courseId,@RequestParam(value = "type",required = false) String type) {
-        return CommonResult.data(teachingActivityService.documentStatistic(courseId,type));
+    public CommonResult<Map<String, Object>> documentStatistic(HttpServletRequest req) {
+        Map param = new HashMap();
+        param.put("courseId", req.getParameter("courseId"));
+        param.put("type", req.getParameter("type"));
+        param.put("startTime", req.getParameter("startTime"));
+        param.put("endTime", req.getParameter("endTime"));
+        return CommonResult.data(teachingActivityService.documentStatistic(param));
     }
 
 
@@ -36,8 +44,90 @@ public class TeachingActivityController {
     @ApiOperationSupport(order = 1)
     @ApiOperation("文档跳出分析")
     @GetMapping("/documentJumpStatistic")
-    public CommonResult<Map<String, Object>> documentJumpStatistic(@RequestParam(value = "courseId", required = false) String courseId,@RequestParam(value = "type",required = false) String type) {
-        return CommonResult.data(teachingActivityService.documentJumpStatistic(courseId,type));
+    public CommonResult<Map<String, Object>> documentJumpStatistic(HttpServletRequest req) {
+        Map param = new HashMap();
+        param.put("courseId", req.getParameter("courseId"));
+        param.put("type", req.getParameter("type"));
+        param.put("startTime", req.getParameter("startTime"));
+        param.put("endTime", req.getParameter("endTime"));
+        return CommonResult.data(teachingActivityService.documentJumpStatistic(param));
+    }
+
+    /**
+     * 教学活动分析-讨论互动统计
+     *
+     * @author honorfire
+     * @date  2025/07/11 18:52
+     */
+    @ApiOperationSupport(order = 1)
+    @ApiOperation("教学活动分析-讨论互动统计")
+    @GetMapping("/discussInteractionAnalyse")
+    public CommonResult<Map<String,Object>> discussInteractionAnalyse(HttpServletRequest req) {
+        Map param =new HashMap();
+        param.put("courseId", req.getParameter("courseId"));
+        param.put("startTime", req.getParameter("startTime"));
+        param.put("endTime", req.getParameter("endTime"));
+
+        Map<String,Object> result=teachingActivityService.getDiscussInteractionAnalyse(param);
+        return CommonResult.data(result);
+    }
+
+    /**
+     * 教学活动分析-学员每周发帖统计
+     *
+     * @author honorfire
+     * @date  2025/07/11 18:52
+     */
+    @ApiOperationSupport(order = 1)
+    @ApiOperation("教学活动分析-学员每周发帖统计")
+    @GetMapping("/stuWeeklyPostProgress")
+    public CommonResult<Map<String,Object>> stuWeeklyPostProgress(HttpServletRequest req) {
+        Map param =new HashMap();
+        param.put("courseId", req.getParameter("courseId"));
+        //该接口只查询最近一周,不受时间检索
+//        param.put("startTime", req.getParameter("startTime"));
+//        param.put("endTime", req.getParameter("endTime"));
+
+        Map<String,Object> result=teachingActivityService.getStuWeeklyPostProgress(param);
+        return CommonResult.data(result);
+    }
+
+    /**
+     * 教学活动分析-教员每周发帖统计
+     *
+     * @author honorfire
+     * @date  2025/07/11 18:52
+     */
+    @ApiOperationSupport(order = 1)
+    @ApiOperation("教学活动分析-教员每周发帖统计")
+    @GetMapping("/teachWeeklyPostProgress")
+    public CommonResult<Map<String,Object>> teachWeeklyPostProgress(HttpServletRequest req) {
+        Map param =new HashMap();
+        param.put("courseId", req.getParameter("courseId"));
+        //该接口只查询最近一周,不受时间检索
+//        param.put("startTime", req.getParameter("startTime"));
+//        param.put("endTime", req.getParameter("endTime"));
+
+        Map<String,Object> result=teachingActivityService.getTeachWeeklyPostProgress(param);
+        return CommonResult.data(result);
+    }
+
+    /**
+     * 教学活动分析-课程讨论详情
+     *R
+     * @author honorfire
+     * @date  2025/07/11 18:52
+     */
+    @ApiOperationSupport(order = 1)
+    @ApiOperation("教学活动分析-课程讨论详情")
+    @GetMapping("/courseDiscussDetail")
+    public CommonResult<Page<Map<String,Object>>> courseDiscussDetail(HttpServletRequest req) {
+        Map param =new HashMap();
+        param.put("courseId", req.getParameter("courseId"));
+        param.put("startTime", req.getParameter("startTime"));
+        param.put("endTime", req.getParameter("endTime"));
+        Page<Map<String,Object>> list=teachingActivityService.courseDiscussDetail(param);
+        return CommonResult.data(list);
     }
 
 
@@ -46,15 +136,34 @@ public class TeachingActivityController {
     @ApiOperationSupport(order = 1)
     @ApiOperation("开课每日访问人数统计")
     @GetMapping("/courseOpenStatistic")
-    public CommonResult<List<Map<String, Object>>> courseOpenStatistic(@RequestParam(value = "courseId", required = false) String courseId, @RequestParam(value = "type",required = false) String type) {
-        return CommonResult.data(teachingActivityService.courseOpenStatistic(courseId,type));
+    public CommonResult<List<Map<String, Object>>> courseOpenStatistic(HttpServletRequest req) {
+        Map param = new HashMap();
+        param.put("courseId", req.getParameter("courseId"));
+        param.put("type", req.getParameter("type"));
+        //该接口只查询最近一周,不受时间检索
+//        param.put("startTime", req.getParameter("startTime"));
+//        param.put("endTime", req.getParameter("endTime"));
+        return CommonResult.data(teachingActivityService.courseOpenStatistic(param));
     }
 
 
+    /**
+     * 教学活动分析-文档观看详细统计(讲义查看状况)
+     *
+     * @author honorfire
+     * @date  2025/07/11 18:52
+     */
     @ApiOperationSupport(order = 1)
     @ApiOperation("文档观看详细统计")
     @GetMapping("/documentDetailStatistic")
-    public CommonResult<List<Map<String, Object>>> documentDetailStatistic(@RequestParam(value = "courseId", required = false) String courseId, @RequestParam(value = "type",required = false) String type) {
-        return CommonResult.data(teachingActivityService.documentDetailStatistic(courseId,type));
+    public CommonResult<Page<Map<String, Object>>> documentDetailStatistic(HttpServletRequest req) {
+        Map param = new HashMap();
+        param.put("courseId", req.getParameter("courseId"));
+        param.put("type", req.getParameter("type"));
+        param.put("startTime", req.getParameter("startTime"));
+        param.put("endTime", req.getParameter("endTime"));
+//        teachingActivityService.documentDetailStatistic(param);
+        Page<Map<String, Object>> list = teachingActivityService.documentWatchDetailStatistic(param);
+        return CommonResult.data(list);
     }
 }

+ 6 - 1
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/PlatformStatusOverviewMapper.java

@@ -29,9 +29,14 @@ public interface PlatformStatusOverviewMapper {
     List<Map<String, Object>> getAllCourses();
 
     /**
-     * 获取指定课程近7天访问量趋势
+     * 获取指定课程近7天访问量趋势(旧)
      * @param courseId 课程ID
      * @return 近7天访问量趋势
      */
     List<Map<String, Object>> getCourseVisitTrend(@Param("courseId") Long courseId);
+
+    /**
+     * 获取指定课程近7天访问量趋势(新,单天获取)
+     */
+    String getOnedayCourseVisitTrendNum(Map param);
 }

+ 108 - 4
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/TeachingActivityMapper.java

@@ -1,16 +1,120 @@
 package vip.xiaonuo.disk.mapper;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 import java.util.Map;
 
 public interface TeachingActivityMapper {
-    Map<String, Object> documentStatistic(@Param("courseId") String courseId, @Param("map") Map<String, Object> map);
+    Map<String, Object> documentStatistic(@Param("param") Map<String, Object> param);
 
-    Map<String, Object> documentJumpStatistic(@Param("courseId") String courseId, @Param("map") Map<String, Object> map);
+    Map<String, Object> documentJumpStatistic(@Param("param") Map<String, Object> param);
 
-    List<Map<String, Object>> courseOpenStatistic(@Param("courseId") String courseId, @Param("map") Map<String, Object> map);
+    List<Map<String, Object>> courseOpenStatistic(@Param("param") Map<String, Object> param);
+
+    String courseOpenDayStatistic(Map param);
+
+    List<Map<String, Object>> documentDetailStatistic(@Param("param") Map<String, Object> param);
+
+    /**
+     * 教学活动分析-文档跳出分析-总跳出次数
+     */
+    String getJumpOutCount(Map param);
+
+    /**
+     * 教学活动分析-文档跳出分析-跳出率
+     */
+    String getJumpOutRate(Map param);
+
+    /**
+     * 教学活动分析-文档跳出分析-平均跳出时间
+     */
+    String getJumpAvgTime(Map param);
+
+    /**
+     * 教学活动分析-讨论互动统计-讨论总数
+     */
+    String getPostCount(Map param);
+
+    /**
+     * 教学活动分析-讨论互动统计-回帖总数
+     */
+    String getReplyCount(Map param);
+
+    /**
+     * 教学活动分析-讨论互动统计-平均回帖数
+     */
+    String getAvgReplyCount(Map param);
+
+    /**
+     * 教学活动分析-学员每周发帖统计-本周发帖数
+     */
+    String getStuWeekPostCount(Map param);
+
+    /**
+     * 教学活动分析-学员每周发帖统计-本周回帖数
+     */
+    String getStuWeekReplyCount(Map param);
+
+    /**
+     * 教学活动分析-学员每周发帖统计-日均发帖数
+     */
+    String getStuWeekAvgPostCount(Map param);
+
+    /**
+     * 教学活动分析-教员每周发帖统计-本周发帖数
+     */
+    String getTeachWeekPostCount(Map param);
+
+    /**
+     * 教学活动分析-教员每周发帖统计-本周回帖数
+     */
+    String getTeachWeekReplyCount(Map param);
+
+    /**
+     * 教学活动分析-教员每周发帖统计-日均发帖数
+     */
+    String getTeachWeekAvgPostCount(Map param);
+
+    /**
+     *教学活动分析-课程讨论详情
+     */
+    Page<Map<String,Object>> courseDiscussDetail(@Param("param") Map param, @Param("page") Page<Object> page);
+
+    /**
+     * 教学活动分析-文档观看详细统计-获取讲义相关基准信息
+     */
+    Page<Map<String,Object>> getHourTeachMaterialList(@Param("param") Map param, @Param("page") Page<Object> page);
+
+    /**
+     * 教学活动分析-文档观看详细统计-获取观看人数
+     */
+    List<Map<String,Object>> getWatchUserCountListDocWatch(Map param);
+
+    /**
+     * 教学活动分析-文档观看详细统计-获取完成人数
+     */
+    List<Map<String,Object>> getCompleteUserCountListDocWatch(Map param);
+
+    /**
+     * 教学活动分析-文档观看详细统计-获取完成率
+     */
+    List<Map<String,Object>> getCompleteRateListDocWatch(Map param);
+
+    /**
+     * 教学活动分析-文档观看详细统计-获取平均阅读时长
+     */
+    List<Map<String,Object>> getReadAvgTimeListDocWatch(Map param);
+
+    /**
+     * 教学活动分析-文档观看详细统计-获取跳出率
+     */
+    List<Map<String,Object>> getJumpOutRateListDocWatch(Map param);
+
+    /**
+     * 教学活动分析-文档观看详细统计-获取下载次数
+     */
+    List<Map<String,Object>> getDownloadCountListDocWatch(Map param);
 
-    List<Map<String, Object>> documentDetailStatistic(@Param("courseId") String courseId, @Param("map") Map<String, Object> map);
 }

+ 60 - 0
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/mapping/PlatformStatusOverviewMapper.xml

@@ -102,5 +102,65 @@
         ORDER BY
         r1.visitDate ASC
     </select>
+    <select id="getOnedayCourseVisitTrendNum" resultType="java.lang.String">
+        SELECT
+--             ci.courseId AS courseId,
+--             IFNULL(ci.courseName,'') AS courseName,
+--             IFNULL(finalTwo.csbCreateTime,'') AS csbCreateTime,
+            IFNULL(finalTwo.watchCount,0) AS watchCount
+        FROM(SELECT ci1.COURSE_ID AS courseId, IFNULL(ci1.COURSE_NAME,'') AS courseName FROM COURSE_INFO ci1 LEFT JOIN COURSE_OPEN cop ON ci1.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE' WHERE ci1.DELETE_FLAG='NOT_DELETE' GROUP BY ci1.COURSE_ID,ci1.COURSE_NAME)ci
+        LEFT JOIN(
+            SELECT
+                --		z1.courseId AS courseId,
+                --		z1.hourId AS hourId,
+                --		z1.csbId AS csbId
+                --		z1.userId AS userId
+                z1.courseId AS courseId,
+                z1.csbCreateTime AS csbCreateTime,
+                IFNULL(count(z1.userId),0) AS watchCount
+            FROM(
+                SELECT
+                    --	#比对每个人应上的所有课程对应课时中,所有看过的记录
+                    --	t1.courseId AS courseId,
+                    --	t1.hourId AS hourId,
+                    --	csb.USER_ID AS userId
+                    t1.hourId AS hourId,
+                    t1.courseId AS courseId,
+                    t1.userId AS userId,
+                    csb.csbCreateTime AS csbCreateTime,
+                    csb.ID AS csbId
+                FROM(
+                    --  #先查出,每个人应该上的所有课程和对应课时
+                    SELECT
+                        stu.ID AS userId,
+                        cch.ID AS hourId,
+                        cc.ID AS chapterId,
+                        ci.COURSE_ID AS courseId
+                    FROM COURSE_INFO ci
+                    LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+                    LEFT JOIN SYS_USER stu ON stu.GRADES_ID =cop.GRADES_ID AND stu.DELETE_FLAG='NOT_DELETE'
+                    LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID       AND cc.DELETE_FLAG ='NOT_DELETE'
+                    LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+                    WHERE ci.DELETE_FLAG ='NOT_DELETE'
+                    AND cch.ID IS NOT NULL
+                    AND cc.ID IS NOT NULL
+                    AND ci.COURSE_ID IS NOT NULL
+                    AND stu.ID IS NOT NULL
+                    GROUP BY stu.ID,cch.ID,cc.ID,ci.COURSE_ID
+                )t1
+                JOIN (SELECT csb1.ID,csb1.USER_ID,csb1.HOUR_ID,TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') AS csbCreateTime FROM COURSE_STUDENT_BURIALPOINT csb1 WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='1' AND csb1.TYPE='1') csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
+                WHERE 1=1
+                GROUP BY t1.courseId,t1.userId,t1.hourId,csb.ID,csb.csbCreateTime
+            )z1
+            GROUP BY z1.courseId,z1.csbCreateTime
+        )finalTwo ON ci.courseId =finalTwo.courseId
+        WHERE 1=1
+        <if test="courseId!=null and courseId != ''">
+            and ci.courseId=#{courseId}
+        </if>
+        <if test="day!=null and day != ''">
+            and finalTwo.csbCreateTime=#{day}
+        </if>
+    </select>
 
 </mapper>

+ 5 - 3
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/mapping/ResourceStatisticMapper.xml

@@ -29,9 +29,11 @@
                 SELECT
                     COUNT( rf.ID ) watch_total
                 FROM RESOURCE_FOOTPRINT rf
-                         LEFT JOIN RESOURCE_RECORD rr ON rf.RESOURCE_RECORD_ID = rr.ID
-                WHERE
-                    rr.CREATE_USER = #{userId}
+                JOIN RESOURCE_RECORD rr ON rf.RESOURCE_RECORD_ID = rr.ID
+                WHERE 1=1
+                and rf.FILE_NAME is not null
+                and rf.FILE_PATH is not null
+                and rr.CREATE_USER = #{userId}
             ) r3,
             (
                 SELECT

+ 14 - 14
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/mapping/StatisticsLearningProgressMapper.xml

@@ -24,10 +24,10 @@
                 and ci.COURSE_ID=#{param.courseId}
             </if>
             <if test="param.startTime!=null and param.startTime != ''">
-                and cop.CREATE_TIME &gt;=#{param.startTime}
+                and TO_CHAR(cop.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{param.startTime}
             </if>
             <if test="param.endTime!=null and param.endTime != ''">
-                and cop.CREATE_TIME &lt;=#{param.endTime}
+                and TO_CHAR(cop.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{param.endTime}
             </if>
             GROUP BY cop.COURSE_ID
         )t1 ON ci.COURSE_ID =t1.courseId
@@ -66,10 +66,10 @@
                     and ci.COURSE_ID=#{param.courseId}
                 </if>
                 <if test="param.startTime!=null and param.startTime != ''">
-                    and csb.CREATE_TIME &gt;=#{param.startTime}
+                    and TO_CHAR(csb.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{param.startTime}
                 </if>
                 <if test="param.endTime!=null and param.endTime != ''">
-                    and csb.CREATE_TIME &lt;=#{param.endTime}
+                    and TO_CHAR(csb.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{param.endTime}
                 </if>
                 GROUP BY cc.COURSE_ID
             )z1
@@ -89,10 +89,10 @@
                 and ci.COURSE_ID=#{param.courseId}
             </if>
             <if test="param.startTime!=null and param.startTime != ''">
-                and csb.CREATE_TIME &gt;=#{param.startTime}
+                and TO_CHAR(csb.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{param.startTime}
             </if>
             <if test="param.endTime!=null and param.endTime != ''">
-                and csb.CREATE_TIME &lt;=#{param.endTime}
+                and TO_CHAR(csb.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{param.endTime}
             </if>
             GROUP BY cc.COURSE_ID
         )t4 ON ci.COURSE_ID =t4.courseId
@@ -115,10 +115,10 @@
                 and ci.COURSE_ID=#{param.courseId}
             </if>
             <if test="param.startTime!=null and param.startTime != ''">
-                and tepa.create_time &gt;=#{param.startTime}
+                and TO_CHAR(tepa.create_time, 'YYYY-MM-DD') &gt;=#{param.startTime}
             </if>
             <if test="param.endTime!=null and param.endTime != ''">
-                and tepa.create_time &lt;=#{param.endTime}
+                and TO_CHAR(tepa.create_time, 'YYYY-MM-DD') &lt;=#{param.endTime}
             </if>
             GROUP BY ci.COURSE_ID
         )t5 ON ci.COURSE_ID =t5.courseId
@@ -140,10 +140,10 @@
             and cop.COURSE_ID=#{courseId}
         </if>
         <if test="startTime!=null and startTime != ''">
-            and cop.CREATE_TIME &gt;=#{startTime}
+            and TO_CHAR(cop.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
         </if>
         <if test="endTime!=null and endTime != ''">
-            and cop.CREATE_TIME &lt;=#{endTime}
+            and TO_CHAR(cop.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
         </if>
     </select>
     <select id="getCourseViewNum" resultType="java.lang.String">
@@ -155,10 +155,10 @@
             and ci.COURSE_ID=#{courseId}
         </if>
         <if test="startTime!=null and startTime != ''">
-            and ci.CREATE_TIME &gt;=#{startTime}
+            and TO_CHAR(ci.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
         </if>
         <if test="endTime!=null and endTime != ''">
-            and ci.CREATE_TIME &lt;=#{endTime}
+            and TO_CHAR(ci.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
         </if>
     </select>
     <select id="getViewTendencyNum" resultType="java.lang.String">
@@ -190,10 +190,10 @@
             and ci.COURSE_ID=#{courseId}
         </if>
         <if test="startTime!=null and startTime != ''">
-            and tepa.create_time &gt;=#{startTime}
+            and TO_CHAR(tepa.create_time, 'YYYY-MM-DD') &gt;=#{startTime}
         </if>
         <if test="endTime!=null and endTime != ''">
-            and tepa.create_time &lt;=#{endTime}
+            and TO_CHAR(tepa.create_time, 'YYYY-MM-DD') &lt;=#{endTime}
         </if>
     </select>
     <select id="paperSubmeitTendency" resultType="java.lang.String">

+ 25 - 24
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/mapping/StudyBehaviorProgressMapper.xml

@@ -13,10 +13,10 @@
             LEFT JOIN COURSE_INFO ci ON cop.COURSE_ID =ci.COURSE_ID
             WHERE ci.DELETE_FLAG ='NOT_DELETE'
             <if test="startTime!=null and startTime != ''">
-                and ci.CREATE_TIME &gt;=#{startTime}
+                and TO_CHAR(ci.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
             </if>
             <if test="endTime!=null and endTime != ''">
-                and ci.CREATE_TIME &lt;=#{endTime}
+                and TO_CHAR(ci.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
             </if>
             <if test="orgId !=null and orgId != ''">
                 and so.ID=#{orgId}
@@ -79,10 +79,10 @@
                 --		AND csb1.CREATE_TIME &gt; ='2025-09-01 00:00:00'
                 --		AND csb1.CREATE_TIME &lt; ='2025-09-30 23:59:59'
                 <if test="startTime!=null and startTime != ''">
-                    and csb1.CREATE_TIME &gt;=#{startTime}
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                 </if>
                 <if test="endTime!=null and endTime != ''">
-                    and csb1.CREATE_TIME &lt;=#{endTime}
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                 </if>
                 GROUP BY csb1.USER_ID,csb1.HOUR_ID
             ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
@@ -157,10 +157,10 @@
                             --		AND csb1.CREATE_TIME &gt;='2025-09-01 00:00:00'
                             --		AND csb1.CREATE_TIME &lt;='2025-09-30 23:59:59'
                             <if test="startTime!=null and startTime != ''">
-                                and csb1.CREATE_TIME &gt;=#{startTime}
+                                and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                             </if>
                             <if test="endTime!=null and endTime != ''">
-                                and csb1.CREATE_TIME &lt;=#{endTime}
+                                and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                             </if>
                             GROUP BY csb1.USER_ID,csb1.HOUR_ID
                         ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
@@ -178,10 +178,10 @@
         WHERE dl.CATEGORY='LOGIN'
         AND dl.EXE_STATUS='SUCCESS'
         <if test="startTime!=null and startTime != ''">
-            and dl.CREATE_TIME &gt;=#{startTime}
+            and TO_CHAR(dl.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
         </if>
         <if test="endTime!=null and endTime != ''">
-            and dl.CREATE_TIME &lt;=#{endTime}
+            and TO_CHAR(dl.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
         </if>
     </select>
     <select id="getUserCount" resultType="java.lang.String">
@@ -194,10 +194,10 @@
             and gr.COLLEGE_ID=#{orgId}
         </if>
         <if test="startTime!=null and startTime != ''">
-            and su.CREATE_TIME &gt;=#{startTime}
+            and TO_CHAR(su.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
         </if>
         <if test="endTime!=null and endTime != ''">
-            and su.CREATE_TIME &lt;=#{endTime}
+            and TO_CHAR(su.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
         </if>
     </select>
     <select id="getAvgLoginCount" resultType="java.lang.String">
@@ -211,10 +211,10 @@
             WHERE dl.CATEGORY='LOGIN'
             AND dl.EXE_STATUS='SUCCESS'
             <if test="startTime!=null and startTime != ''">
-                and dl.CREATE_TIME &gt;=#{startTime}
+                and TO_CHAR(dl.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
             </if>
             <if test="endTime!=null and endTime != ''">
-                and dl.CREATE_TIME &lt;=#{endTime}
+                and TO_CHAR(dl.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
             </if>
             GROUP BY dl.OP_USER
         )t1
@@ -329,10 +329,10 @@
                     FROM COURSE_STUDENT_BURIALPOINT csb1
                     WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='1' AND csb1.TYPE='1'
                     <if test="startTime!=null and startTime != ''">
-                        and csb1.CREATE_TIME &gt;=#{startTime}
+                        and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                     </if>
                     <if test="endTime!=null and endTime != ''">
-                        and csb1.CREATE_TIME &lt;=#{endTime}
+                        and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                     </if>
                 ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
                 WHERE 1=1
@@ -398,10 +398,10 @@
                         FROM COURSE_STUDENT_BURIALPOINT csb1
                         WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='1' AND csb1.TYPE='1'
                         <if test="startTime!=null and startTime != ''">
-                            and csb1.CREATE_TIME &gt;=#{startTime}
+                            and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                         </if>
                         <if test="endTime!=null and endTime != ''">
-                            and csb1.CREATE_TIME &lt;=#{endTime}
+                            and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                         </if>
                     ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
                     WHERE 1=1
@@ -424,10 +424,10 @@
             WHERE dl.CATEGORY='LOGIN'
             AND dl.EXE_STATUS='SUCCESS'
             <if test="param.startTime!=null and param.startTime != ''">
-                and dl.CREATE_TIME &gt;=#{param.startTime}
+                and TO_CHAR(dl.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{param.startTime}
             </if>
             <if test="param.endTime!=null and param.endTime != ''">
-                and dl.CREATE_TIME &lt;=#{param.endTime}
+                and TO_CHAR(dl.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{param.endTime}
             </if>
         )t1
         GROUP by t1.createTime
@@ -495,10 +495,10 @@
                     FROM COURSE_STUDENT_BURIALPOINT csb1
                     WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='1' AND csb1.TYPE='1'
                     <if test="param.startTime!=null and param.startTime != ''">
-                        and csb1.CREATE_TIME &gt;=#{param.startTime}
+                        and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{param.startTime}
                     </if>
                     <if test="param.endTime!=null and param.endTime != ''">
-                        and csb1.CREATE_TIME &lt;=#{param.endTime}
+                        and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{param.endTime}
                     </if>
                 ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
                 WHERE 1=1
@@ -560,10 +560,10 @@
                     </foreach>
                 </if>
                 <if test="startTime!=null and startTime != ''">
-                    and ci.CREATE_TIME &gt;=#{startTime}
+                    and TO_CHAR(ci.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                 </if>
                 <if test="endTime!=null and endTime != ''">
-                    and ci.CREATE_TIME &lt;=#{endTime}
+                    and TO_CHAR(ci.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                 </if>
                 GROUP BY so.ID,ci.COURSE_ID
             )t1
@@ -639,10 +639,10 @@
                 FROM COURSE_STUDENT_BURIALPOINT csb1
                 WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='1' AND csb1.TYPE='1'
                 <if test="startTime!=null and startTime != ''">
-                    and csb1.CREATE_TIME &gt;=#{startTime}
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                 </if>
                 <if test="endTime!=null and endTime != ''">
-                    and csb1.CREATE_TIME &lt;=#{endTime}
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                 </if>
             ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
             WHERE 1=1
@@ -1253,6 +1253,7 @@
                 WHERE ci.DELETE_FLAG ='NOT_DELETE'
                 AND cc.ID IS NOT NULL
                 AND ci.COURSE_ID IS NOT NULL
+                AND cch.ID IS NOT NULL
                 AND stu.ID IS NOT NULL
                 <if test="userIdList !=null and userIdList.size()>0">
                     and stu.ID in

+ 1226 - 30
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/mapping/TeachingActivityMapper.xml

@@ -13,7 +13,7 @@
                            2
                    )
                ELSE 0
-               END AS finishRate
+               END AS docFinishRate
         FROM COURSE_INFO ci
         LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
         LEFT JOIN SYS_USER stu ON stu.GRADES_ID =cop.GRADES_ID AND stu.DELETE_FLAG='NOT_DELETE'
@@ -21,14 +21,14 @@
         LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
         LEFT JOIN COURSE_STUDENT_BURIALPOINT ctb ON ctb.DELETE_FLAG ='NOT_DELETE' AND ctb.FUNC_TYPE='2' AND ctb.TYPE='1' AND cch.ID =ctb.HOUR_ID AND stu.ID=ctb.USER_ID
       <where>
-          <if test="courseId != null and courseId != ''">
-              AND ci.COURSE_ID = #{courseId}
+          <if test="param.courseId != null and param.courseId != ''">
+              AND ci.COURSE_ID = #{param.courseId}
           </if>
-          <if test="map.startTime != null">
-              AND ci.create_time &gt;= #{map.startTime}
+          <if test="param.startTime != null">
+              AND TO_CHAR(ci.create_time, 'YYYY-MM-DD') &gt;= #{param.startTime}
           </if>
-          <if test="map.endTime != null">
-              AND ci.create_time &lt;= #{map.endTime}
+          <if test="param.endTime != null">
+              AND TO_CHAR(ci.create_time, 'YYYY-MM-DD') &lt;= #{param.endTime}
           </if>
           AND ci.DELETE_FLAG ='NOT_DELETE'
           AND cch.ID IS NOT NULL
@@ -69,14 +69,14 @@
             LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
             LEFT JOIN COURSE_STUDENT_BURIALPOINT ctb ON ctb.DELETE_FLAG ='NOT_DELETE' AND ctb.FUNC_TYPE='2' AND ctb.TYPE='1' AND cch.ID =ctb.HOUR_ID AND stu.ID=ctb.USER_ID
             <where>
-                <if test="courseId != null and courseId != ''">
-                    AND ci.COURSE_ID = #{courseId}
+                <if test="param.courseId != null and param.courseId != ''">
+                    AND ci.COURSE_ID = #{param.courseId}
                 </if>
-                <if test="map.startTime != null">
-                    AND ci.create_time &gt;= #{map.startTime}
+                <if test="param.startTime != null">
+                    AND TO_CHAR(ci.create_time, 'YYYY-MM-DD') &gt;= #{param.startTime}
                 </if>
-                <if test="map.endTime != null">
-                    AND ci.create_time &lt;= #{map.endTime}
+                <if test="param.endTime != null">
+                    AND TO_CHAR(ci.create_time, 'YYYY-MM-DD') &lt;= #{param.endTime}
                 </if>
                 AND ci.DELETE_FLAG ='NOT_DELETE'
                 AND cch.ID IS NOT NULL
@@ -92,21 +92,21 @@
             TO_CHAR(ctb.create_time, 'YYYY-MM-DD') AS time,
             count(DISTINCT ctb.USER_ID ) num
         FROM COURSE_INFO ci
-                 LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
-                 LEFT JOIN SYS_USER stu ON stu.GRADES_ID =cop.GRADES_ID AND stu.DELETE_FLAG='NOT_DELETE'
-                 LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
-                 LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
-                 LEFT JOIN COURSE_STUDENT_BURIALPOINT ctb ON ctb.DELETE_FLAG ='NOT_DELETE' AND cch.ID =ctb.HOUR_ID AND stu.ID=ctb.USER_ID
+         LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+         LEFT JOIN SYS_USER stu ON stu.GRADES_ID =cop.GRADES_ID AND stu.DELETE_FLAG='NOT_DELETE'
+         LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+         LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+         LEFT JOIN COURSE_STUDENT_BURIALPOINT ctb ON ctb.DELETE_FLAG ='NOT_DELETE' AND cch.ID =ctb.HOUR_ID AND stu.ID=ctb.USER_ID and ctb.FUNC_TYPE='1' and ctb.TYPE='1'
         <where>
              ci.DELETE_FLAG ='NOT_DELETE'
-            <if test="courseId != null and courseId != ''">
-                AND ci.COURSE_ID = #{courseId}
+            <if test="param.courseId != null and param.courseId != ''">
+                AND ci.COURSE_ID = #{param.courseId}
             </if>
-            <if test="map.startTime != null">
-                AND ci.create_time &gt;= #{map.startTime}
+            <if test="param.startTime != null">
+                AND TO_CHAR(ctb.create_time, 'YYYY-MM-DD') &gt;= #{param.startTime}
             </if>
-            <if test="map.endTime != null">
-                AND ci.create_time &lt;= #{map.endTime}
+            <if test="param.endTime != null">
+                AND TO_CHAR(ctb.create_time, 'YYYY-MM-DD') &lt;= #{param.endTime}
             </if>
             AND cch.ID IS NOT NULL
             AND cc.ID IS NOT NULL
@@ -154,14 +154,14 @@
         <where>
             ctb.file_id IS NOT null
             AND ci.DELETE_FLAG ='NOT_DELETE'
-            <if test="courseId != null and courseId != ''">
-                AND ci.COURSE_ID = #{courseId}
+            <if test="param.courseId != null and param.courseId != ''">
+                AND ci.COURSE_ID = #{param.courseId}
             </if>
-            <if test="map.startTime != null">
-                AND ci.create_time &gt;= #{map.startTime}
+            <if test="param.startTime != null">
+                AND TO_CHAR(ci.create_time, 'YYYY-MM-DD') &gt;= #{param.startTime}
             </if>
-            <if test="map.endTime != null">
-                AND ci.create_time &lt;= #{map.endTime}
+            <if test="param.endTime != null">
+                AND TO_CHAR(ci.create_time, 'YYYY-MM-DD') &lt;= #{param.endTime}
             </if>
             AND cch.ID IS NOT NULL
             AND cc.ID IS NOT NULL
@@ -171,7 +171,1203 @@
         </where>
         GROUP BY  ctb.file_id,ctb.FILE_NAME,ctb.extend_name
     </select>
+    <select id="getJumpOutCount" resultType="java.lang.String">
+        SELECT
+            --	t1.hourId AS hourId,
+            --	t1.chapterId AS chapterId,
+            --	t1.userId AS userId,
+            --	csb.ID AS csbId,
+            --	csb.PROGRESS AS progress
+            IFNULL(count(csb.ID),0) AS jumpOutCount
+        FROM (
+            SELECT
+                cop.ID AS copId,
+                stu.ID AS userId,
+                cch.ID AS hourId,
+                cc.ID AS chapterId,
+                ci.COURSE_ID AS courseId
+            FROM COURSE_INFO ci
+            LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+            LEFT JOIN SYS_USER stu ON stu.GRADES_ID =cop.GRADES_ID AND stu.DELETE_FLAG='NOT_DELETE'
+            LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+            LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+            WHERE ci.DELETE_FLAG ='NOT_DELETE'
+            AND cch.ID IS NOT NULL
+            AND cc.ID IS NOT NULL
+            AND ci.COURSE_ID IS NOT NULL
+            AND stu.ID IS NOT NULL
+            --		AND csb.USER_ID='1948586504800468993'
+            <if test="courseId !=null and courseId != ''">
+                and ci.COURSE_ID=#{courseId}
+        </if>
+        )t1
+        JOIN (
+            SELECT csb1.ID,csb1.USER_ID,csb1.HOUR_ID,csb1.PROGRESS
+            FROM COURSE_STUDENT_BURIALPOINT csb1
+            WHERE csb1.DELETE_FLAG ='NOT_DELETE'
+            <if test="startTime!=null and startTime != ''">
+                and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
+            </if>
+            <if test="endTime!=null and endTime != ''">
+                and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
+            </if>
+            AND csb1.FUNC_TYPE='2' AND csb1.TYPE='1' AND csb1.PROGRESS &lt; 100
+        ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
+        WHERE 1=1
+    </select>
+    <select id="getJumpOutRate" resultType="java.lang.String">
+        SELECT
+            CASE
+            when z1.jumpOutCount=0 or z1.jumpOutCount is NULL OR z1.allCount=0 OR z1.allCount IS null then 0
+            else TRUNC(z1.jumpOutCount * 1.0 / z1.allCount, 2)
+            END AS jumpOutRate
+        FROM(
+            SELECT
+                --	t1.hourId AS hourId,
+                --	t1.chapterId AS chapterId,
+                --	t1.courseId AS courseId,
+                --	t1.userId AS userId,
+                --	csb.ID AS csbId,
+                --	csb.PROGRESS AS progress
+                count(CASE WHEN csb.PROGRESS &lt; 100 THEN 1 END) AS jumpOutCount,
+                count(csb.ID) AS allCount
+            FROM (
+                SELECT
+                    cop.ID AS copId,
+                    stu.ID AS userId,
+                    cch.ID AS hourId,
+                    cc.ID AS chapterId,
+                    ci.COURSE_ID AS courseId
+                FROM COURSE_INFO ci
+                LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+                LEFT JOIN SYS_USER stu ON stu.GRADES_ID =cop.GRADES_ID AND stu.DELETE_FLAG='NOT_DELETE'
+                LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+                LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+                WHERE ci.DELETE_FLAG ='NOT_DELETE'
+                AND cch.ID IS NOT NULL
+                AND cc.ID IS NOT NULL
+                AND ci.COURSE_ID IS NOT NULL
+                AND stu.ID IS NOT NULL
+                --		AND csb.USER_ID='1948586504800468993'
+                <if test="courseId !=null and courseId != ''">
+                    and ci.COURSE_ID=#{courseId}
+                </if>
+            )t1
+            JOIN (
+                SELECT csb1.ID,csb1.USER_ID,csb1.HOUR_ID,csb1.PROGRESS
+                FROM COURSE_STUDENT_BURIALPOINT csb1
+                WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='2' AND csb1.TYPE='1'
+                <if test="startTime!=null and startTime != ''">
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
+                </if>
+                <if test="endTime!=null and endTime != ''">
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
+                </if>
+            ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
+            WHERE 1=1
+        )z1
+    </select>
+    <select id="getJumpAvgTime" resultType="java.lang.String">
+        SELECT
+            CASE
+            when tt1.jumpAvgTime=0 or tt1.jumpAvgTime is NULL
+            then ''
+            else
+            CASE
+            WHEN FLOOR(tt1.jumpAvgTime / 3600000) = 0 THEN '0'
+            ELSE REGEXP_REPLACE(LPAD(FLOOR(tt1.jumpAvgTime / 3600000), 5, '0'), '^0+', '')
+            END || 'h' ||
+            IFNULL(LPAD(FLOOR((tt1.jumpAvgTime % 3600000) / 60000), 2, '0'),'00') || 'm' ||
+            IFNULL(LPAD(FLOOR((tt1.jumpAvgTime % 60000) / 1000), 2, '0'),'00') || 's'
+            END AS jumpAvgTime
+        FROM(
+            SELECT
+                --	t1.hourId AS hourId,
+                --	t1.chapterId AS chapterId,
+                --	t1.userId AS userId,
+                --	csb.ID AS csbId,
+                --    LPAD(FLOOR(csb1.END_TIME / 3600000), 2, '0') || ':' ||
+                --    LPAD(FLOOR((csb1.END_TIME % 3600000) / 60000), 2, '0') || ':' ||
+                --    LPAD(FLOOR((csb1.END_TIME % 60000) / 1000), 2, '0') AS jumpTime
+                ROUND(AVG(IFNULL(csb.END_TIME,0)), 2) AS jumpAvgTime
+            FROM (
+                SELECT
+                    cop.ID AS copId,
+                    stu.ID AS userId,
+                    cch.ID AS hourId,
+                    cc.ID AS chapterId,
+                    ci.COURSE_ID AS courseId
+                FROM COURSE_INFO ci
+                LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+                LEFT JOIN SYS_USER stu ON stu.GRADES_ID =cop.GRADES_ID AND stu.DELETE_FLAG='NOT_DELETE'
+                LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+                LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+                WHERE ci.DELETE_FLAG ='NOT_DELETE'
+                AND cch.ID IS NOT NULL
+                AND cc.ID IS NOT NULL
+                AND ci.COURSE_ID IS NOT NULL
+                AND stu.ID IS NOT NULL
+                <if test="courseId !=null and courseId != ''">
+                    and ci.COURSE_ID=#{courseId}
+                </if>
+                --		AND csb.USER_ID='1948586504800468993'
+            )t1
+            JOIN (
+                SELECT csb1.ID,csb1.USER_ID,csb1.HOUR_ID,csb1.END_TIME
+                FROM COURSE_STUDENT_BURIALPOINT csb1
+                WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='2' AND csb1.TYPE='1' AND csb1.PROGRESS &lt; 100
+                <if test="startTime!=null and startTime != ''">
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
+                </if>
+                <if test="endTime!=null and endTime != ''">
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
+                </if>
+            ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
+            WHERE 1=1
+        )tt1
+    </select>
+    <select id="getPostCount" resultType="java.lang.String">
+        SELECT
+            --	t1.userId AS userId,
+            --	t1.chapterId AS chapterId,
+            --	t1.courseId AS courseId,
+            --	t2.replyId AS replyId
+            IFNULL(count(t2.replyId),0) postCount
+        from(
+            SELECT
+                cch.ID AS hourId,
+                ci.COURSE_ID AS courseId
+            FROM COURSE_INFO ci
+            LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+            LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+            LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+            WHERE ci.DELETE_FLAG ='NOT_DELETE'
+            AND cc.ID IS NOT NULL
+            AND ci.COURSE_ID IS NOT NULL
+            AND cch.ID IS NOT NULL
+            <if test="courseId !=null and courseId != ''">
+                and ci.COURSE_ID=#{courseId}
+            </if>
+            GROUP BY cch.ID,ci.COURSE_ID
+        )t1
+        JOIN (
+            SELECT
+                reply.REPLY_ID AS replyId,
+                reply.USER_ID AS userId,
+                chapter.DISCUSSION_ID AS discussionId,
+                chapter.CHAPTER_ID AS chapterId
+            from FORUM_POST_REPLY as reply
+            left join FORUM_CHAPTER_DISCUSSION as chapter on reply.POST_ID = chapter.POST_ID
+            where
+            reply.POST_TYPE = 3
+            <if test="startTime!=null and startTime != ''">
+                and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
+            </if>
+            <if test="endTime!=null and endTime != ''">
+                and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
+            </if>
+        )t2 ON t1.hourId=t2.chapterId
+        WHERE 1=1
+    </select>
+    <select id="getReplyCount" resultType="java.lang.String">
+        SELECT
+            --	t1.userId AS userId,
+            --	t1.chapterId AS chapterId,
+            --	t1.courseId AS courseId,
+            --	t2.replyId AS replyId
+            IFNULL(count(t2.replyId),0) replyCount
+        from(
+            SELECT
+                cch.ID AS hourId,
+                ci.COURSE_ID AS courseId
+            FROM COURSE_INFO ci
+            LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+            LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+            LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+            WHERE ci.DELETE_FLAG ='NOT_DELETE'
+            AND cc.ID IS NOT NULL
+            AND ci.COURSE_ID IS NOT NULL
+            AND cch.ID IS NOT NULL
+            <if test="courseId !=null and courseId != ''">
+                and ci.COURSE_ID=#{courseId}
+            </if>
+            GROUP BY cch.ID,ci.COURSE_ID
+        )t1
+        JOIN (
+            select
+                reply.REPLY_ID AS replyId,
+                reply.USER_ID AS userId,
+                chapter.DISCUSSION_ID AS discussionId,
+                chapter.CHAPTER_ID AS chapterId
+            from FORUM_POST_REPLY as reply
+            left join FORUM_CHAPTER_DISCUSSION as chapter on reply.POST_ID = chapter.POST_ID
+            where
+            reply.POST_TYPE = 3
+            AND reply.PARENT_ID != '-1'
+            <if test="startTime!=null and startTime != ''">
+                and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
+            </if>
+            <if test="endTime!=null and endTime != ''">
+                and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
+            </if>
+        )t2 ON t1.hourId=t2.chapterId
+        WHERE 1=1
+    </select>
+    <select id="getAvgReplyCount" resultType="java.lang.String">
+        SELECT
+            TRUNC(IFNULL(AVG(z1.replyCount),0),2) avgReplyCount
+        FROM (
+            SELECT
+                --	t1.userId AS userId,
+                --	t1.hourId AS hourId,
+                --	t1.courseId AS courseId,
+                --	t2.postId AS postId,
+                --	t2.replyId AS replyId
+                t2.postId AS postId,
+                count(t2.replyId) AS replyCount
+            from(
+                SELECT
+                    cch.ID AS hourId,
+                    ci.COURSE_ID AS courseId
+                FROM COURSE_INFO ci
+                LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+                LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+                LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+                WHERE ci.DELETE_FLAG ='NOT_DELETE'
+                AND cc.ID IS NOT NULL
+                AND ci.COURSE_ID IS NOT NULL
+                AND cch.ID IS NOT NULL
+                <if test="courseId !=null and courseId != ''">
+                    and ci.COURSE_ID=#{courseId}
+                </if>
+                GROUP BY cch.ID,ci.COURSE_ID
+            )t1
+            JOIN (
+                SELECT
+                    reply.REPLY_ID AS replyId,
+                    reply.USER_ID AS userId,
+                    chapter.DISCUSSION_ID AS discussionId,
+                    chapter.CHAPTER_ID AS chapterId,
+                    fpi.POST_ID AS postId
+                from FORUM_POST_INFO fpi
+                join FORUM_CHAPTER_DISCUSSION as chapter on fpi.POST_ID = chapter.POST_ID
+                join FORUM_POST_REPLY as reply on reply.POST_ID = chapter.POST_ID
+                where
+                reply.POST_TYPE = 3
+                <if test="startTime!=null and startTime != ''">
+                    and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
+                </if>
+                <if test="endTime!=null and endTime != ''">
+                    and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
+                </if>
+            )t2 ON t1.hourId=t2.chapterId
+            WHERE 1=1
+            GROUP BY t2.postId
+        )z1
+    </select>
+    <select id="getStuWeekPostCount" resultType="java.lang.String">
+        SELECT
+            --	t1.userId AS userId,
+            --	t1.chapterId AS chapterId,
+            --	t1.courseId AS courseId,
+            --	t2.replyId AS replyId
+            IFNULL(count(t2.replyId),0) weekPostCount
+        from(
+            SELECT
+                cch.ID AS hourId,
+                ci.COURSE_ID AS courseId
+            FROM COURSE_INFO ci
+            LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+            LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+            LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+            WHERE ci.DELETE_FLAG ='NOT_DELETE'
+            AND cc.ID IS NOT NULL
+            AND ci.COURSE_ID IS NOT NULL
+            AND cch.ID IS NOT NULL
+            <if test="courseId !=null and courseId != ''">
+                and ci.COURSE_ID=#{courseId}
+            </if>
+            GROUP BY cch.ID,ci.COURSE_ID
+        )t1
+        JOIN (
+            SELECT
+                reply.*,
+                reply.REPLY_ID AS replyId,
+                reply.USER_ID AS userId,
+                chapter.DISCUSSION_ID AS discussionId,
+                chapter.CHAPTER_ID AS chapterId
+            from FORUM_POST_REPLY as reply
+            join FORUM_CHAPTER_DISCUSSION as chapter on reply.POST_ID = chapter.POST_ID
+            JOIN SYS_USER su ON reply.USER_ID= su.ID
+            where
+            reply.POST_TYPE = 3
+            AND su.EDU_IDENTITY='2'
+            <if test="startTime!=null and startTime != ''">
+                and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
+            </if>
+            <if test="endTime!=null and endTime != ''">
+                and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
+            </if>
+        )t2 ON t1.hourId=t2.chapterId
+        WHERE 1=1
+    </select>
+    <select id="getStuWeekReplyCount" resultType="java.lang.String">
+        SELECT
+            --	t1.userId AS userId,
+            --	t1.chapterId AS chapterId,
+            --	t1.courseId AS courseId,
+            --	t2.replyId AS replyId
+            IFNULL(count(t2.replyId),0) weekPostCount
+        from(
+            SELECT
+                cch.ID AS hourId,
+                ci.COURSE_ID AS courseId
+            FROM COURSE_INFO ci
+            LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+            LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+            LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+            WHERE ci.DELETE_FLAG ='NOT_DELETE'
+            AND cc.ID IS NOT NULL
+            AND ci.COURSE_ID IS NOT NULL
+            AND cch.ID IS NOT NULL
+            <if test="courseId !=null and courseId != ''">
+                and ci.COURSE_ID=#{courseId}
+            </if>
+            GROUP BY cch.ID,ci.COURSE_ID
+        )t1
+        JOIN (
+            SELECT
+                reply.*,
+                reply.REPLY_ID AS replyId,
+                reply.USER_ID AS userId,
+                chapter.DISCUSSION_ID AS discussionId,
+                chapter.CHAPTER_ID AS chapterId
+            from FORUM_POST_REPLY as reply
+            join FORUM_CHAPTER_DISCUSSION as chapter on reply.POST_ID = chapter.POST_ID
+            JOIN SYS_USER su ON reply.USER_ID= su.ID
+            where
+            reply.POST_TYPE = 3
+            AND reply.PARENT_ID != '-1'
+            AND su.EDU_IDENTITY='2'
+            <if test="startTime!=null and startTime != ''">
+                and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
+            </if>
+            <if test="endTime!=null and endTime != ''">
+                and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
+            </if>
+        )t2 ON t1.hourId=t2.chapterId
+        WHERE 1=1
+    </select>
+    <select id="getStuWeekAvgPostCount" resultType="java.lang.String">
+        SELECT
+            TRUNC(IFNULL(AVG(z1.postCount),0),2) weekAvgPostCount
+        FROM (
+            SELECT
+                --	t1.userId AS userId,
+                --	t1.chapterId AS chapterId,
+                --	t1.courseId AS courseId,
+                --	t2.replyId AS replyId
+                IFNULL(count(t2.replyId),0) postCount
+            from(
+                SELECT
+                    cch.ID AS hourId,
+                    ci.COURSE_ID AS courseId
+                FROM COURSE_INFO ci
+                LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+                LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+                LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+                WHERE ci.DELETE_FLAG ='NOT_DELETE'
+                AND cc.ID IS NOT NULL
+                AND ci.COURSE_ID IS NOT NULL
+                AND cch.ID IS NOT NULL
+                <if test="courseId !=null and courseId != ''">
+                    and ci.COURSE_ID=#{courseId}
+                </if>
+                GROUP BY cch.ID,ci.COURSE_ID
+            )t1
+            JOIN (
+                SELECT
+                    reply.*,
+                    reply.REPLY_ID AS replyId,
+                    reply.USER_ID AS userId,
+                    chapter.DISCUSSION_ID AS discussionId,
+                    chapter.CHAPTER_ID AS chapterId
+                from FORUM_POST_REPLY as reply
+                join FORUM_CHAPTER_DISCUSSION as chapter on reply.POST_ID = chapter.POST_ID
+                JOIN SYS_USER su ON reply.USER_ID= su.ID
+                where
+                reply.POST_TYPE = 3
+                AND su.EDU_IDENTITY='2'
+                <if test="startTime!=null and startTime != ''">
+                    and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
+                </if>
+                <if test="endTime!=null and endTime != ''">
+                    and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
+                </if>
+            )t2 ON t1.hourId=t2.chapterId
+            WHERE 1=1
+        )z1
+    </select>
 
+    <select id="getTeachWeekPostCount" resultType="java.lang.String">
+        SELECT
+        --	t1.userId AS userId,
+        --	t1.chapterId AS chapterId,
+        --	t1.courseId AS courseId,
+        --	t2.replyId AS replyId
+        IFNULL(count(t2.replyId),0) weekPostCount
+        from(
+        SELECT
+        cch.ID AS hourId,
+        ci.COURSE_ID AS courseId
+        FROM COURSE_INFO ci
+        LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+        LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+        LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+        WHERE ci.DELETE_FLAG ='NOT_DELETE'
+        AND cc.ID IS NOT NULL
+        AND ci.COURSE_ID IS NOT NULL
+        AND cch.ID IS NOT NULL
+        <if test="courseId !=null and courseId != ''">
+            and ci.COURSE_ID=#{courseId}
+        </if>
+        GROUP BY cch.ID,ci.COURSE_ID
+        )t1
+        JOIN (
+        SELECT
+        reply.*,
+        reply.REPLY_ID AS replyId,
+        reply.USER_ID AS userId,
+        chapter.DISCUSSION_ID AS discussionId,
+        chapter.CHAPTER_ID AS chapterId
+        from FORUM_POST_REPLY as reply
+        join FORUM_CHAPTER_DISCUSSION as chapter on reply.POST_ID = chapter.POST_ID
+        JOIN SYS_USER su ON reply.USER_ID= su.ID
+        where
+        reply.POST_TYPE = 3
+        AND su.EDU_IDENTITY='1'
+        <if test="startTime!=null and startTime != ''">
+            and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
+        </if>
+        <if test="endTime!=null and endTime != ''">
+            and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
+        </if>
+        )t2 ON t1.hourId=t2.chapterId
+        WHERE 1=1
+    </select>
+    <select id="getTeachWeekReplyCount" resultType="java.lang.String">
+        SELECT
+        --	t1.userId AS userId,
+        --	t1.chapterId AS chapterId,
+        --	t1.courseId AS courseId,
+        --	t2.replyId AS replyId
+        IFNULL(count(t2.replyId),0) weekPostCount
+        from(
+        SELECT
+        cch.ID AS hourId,
+        ci.COURSE_ID AS courseId
+        FROM COURSE_INFO ci
+        LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+        LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+        LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+        WHERE ci.DELETE_FLAG ='NOT_DELETE'
+        AND cc.ID IS NOT NULL
+        AND ci.COURSE_ID IS NOT NULL
+        AND cch.ID IS NOT NULL
+        <if test="courseId !=null and courseId != ''">
+            and ci.COURSE_ID=#{courseId}
+        </if>
+        GROUP BY cch.ID,ci.COURSE_ID
+        )t1
+        JOIN (
+        SELECT
+        reply.*,
+        reply.REPLY_ID AS replyId,
+        reply.USER_ID AS userId,
+        chapter.DISCUSSION_ID AS discussionId,
+        chapter.CHAPTER_ID AS chapterId
+        from FORUM_POST_REPLY as reply
+        join FORUM_CHAPTER_DISCUSSION as chapter on reply.POST_ID = chapter.POST_ID
+        JOIN SYS_USER su ON reply.USER_ID= su.ID
+        where
+        reply.POST_TYPE = 3
+        AND reply.PARENT_ID != '-1'
+        AND su.EDU_IDENTITY='1'
+        <if test="startTime!=null and startTime != ''">
+            and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
+        </if>
+        <if test="endTime!=null and endTime != ''">
+            and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
+        </if>
+        )t2 ON t1.hourId=t2.chapterId
+        WHERE 1=1
+    </select>
+    <select id="getTeachWeekAvgPostCount" resultType="java.lang.String">
+        SELECT
+            TRUNC(IFNULL(AVG(z1.postCount),0),2) weekAvgPostCount
+        FROM (
+            SELECT
+                --	t1.userId AS userId,
+                --	t1.chapterId AS chapterId,
+                --	t1.courseId AS courseId,
+                --	t2.replyId AS replyId
+                IFNULL(count(t2.replyId),0) postCount
+            from(
+                SELECT
+                    cch.ID AS hourId,
+                    ci.COURSE_ID AS courseId
+                FROM COURSE_INFO ci
+                LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+                LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+                LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+                WHERE ci.DELETE_FLAG ='NOT_DELETE'
+                AND cc.ID IS NOT NULL
+                AND ci.COURSE_ID IS NOT NULL
+                AND cch.ID IS NOT NULL
+                <if test="courseId !=null and courseId != ''">
+                    and ci.COURSE_ID=#{courseId}
+                </if>
+                GROUP BY cch.ID,ci.COURSE_ID
+            )t1
+            JOIN (
+                SELECT
+                    reply.REPLY_ID AS replyId,
+                    reply.USER_ID AS userId,
+                    chapter.DISCUSSION_ID AS discussionId,
+                    chapter.CHAPTER_ID AS chapterId
+                from FORUM_POST_REPLY as reply
+                join FORUM_CHAPTER_DISCUSSION as chapter on reply.POST_ID = chapter.POST_ID
+                JOIN SYS_USER su ON reply.USER_ID= su.ID
+                where
+                reply.POST_TYPE = 3
+                AND su.EDU_IDENTITY='1'
+                <if test="startTime!=null and startTime != ''">
+                    and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
+                </if>
+                <if test="endTime!=null and endTime != ''">
+                    and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
+                </if>
+            )t2 ON t1.hourId=t2.chapterId
+            WHERE 1=1
+        )z1
+    </select>
+    <select id="courseDiscussDetail" resultType="java.util.Map">
+        SELECT
+            postInfo.postId AS postId,
+            IFNULL(postInfo.postTitle,'')AS postTitle,
+            IFNULL(postInfo.postCreateTime,'')AS postCreateTime,
+            IFNULL(postInfo.postLastReplyTime,'')AS postLastReplyTime,
+            IFNULL(finalOne.postCount,'0')AS postCount
+        FROM(
+            SELECT
+                --	fpi.POST_ID AS postId,
+                --	fpi.POST_TITLE AS postTitle,
+                --	cch.ID AS hourId,
+                --	ci.COURSE_ID AS courseId
+                fpi.POST_ID AS postId,
+                IFNULL(fpi.POST_TITLE,'')AS postTitle,
+                IFNULL(fpi.CREATE_TIME,'')AS postCreateTime,
+                IFNULL(fpi.LAST_REPLY_TIME,'')AS postLastReplyTime
+            FROM COURSE_INFO ci
+            LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+            LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+            LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+            join FORUM_CHAPTER_DISCUSSION fcd on fcd.CHAPTER_ID = cch.ID AND fcd.DELETE_FLAG ='NOT_DELETE'
+            JOIN FORUM_POST_INFO fpi ON fpi.POST_ID = fcd.POST_ID AND fpi.DELETE_FLAG ='NOT_DELETE'
+            WHERE ci.DELETE_FLAG ='NOT_DELETE'
+            AND cc.ID IS NOT NULL
+            AND ci.COURSE_ID IS NOT NULL
+            AND cch.ID IS NOT NULL
+            <if test="param.courseId !=null and param.courseId != ''">
+                and ci.COURSE_ID=#{param.courseId}
+            </if>
+            <if test="param.startTime!=null and param.startTime != ''">
+                and TO_CHAR(fpi.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{param.startTime}
+            </if>
+            <if test="param.endTime!=null and param.endTime != ''">
+                and TO_CHAR(fpi.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{param.endTime}
+            </if>
+            GROUP BY fpi.POST_ID,fpi.POST_TITLE,fpi.CREATE_TIME,fpi.LAST_REPLY_TIME
+        )postInfo
+        LEFT JOIN(
+            SELECT
+                --	t1.courseId AS courseId,
+                --	t2.postId AS postId,
+                --	t2.replyId AS replyId
+                t2.postId AS postId,
+                IFNULL(count(t2.replyId),0) postCount
+            from(
+                SELECT
+                    cch.ID AS hourId,
+                    ci.COURSE_ID AS courseId
+                FROM COURSE_INFO ci
+                LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+                LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+                LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+                WHERE ci.DELETE_FLAG ='NOT_DELETE'
+                AND cc.ID IS NOT NULL
+                AND ci.COURSE_ID IS NOT NULL
+                AND cch.ID IS NOT NULL
+                <if test="param.courseId !=null and param.courseId != ''">
+                    and ci.COURSE_ID=#{param.courseId}
+                </if>
+                GROUP BY cch.ID,ci.COURSE_ID
+            )t1
+            JOIN (
+                SELECT
+                    reply.POST_ID AS postId,
+                    reply.REPLY_ID AS replyId,
+                    reply.USER_ID AS userId,
+                    chapter.DISCUSSION_ID AS discussionId,
+                    chapter.CHAPTER_ID AS chapterId
+                from FORUM_POST_REPLY as reply
+                join FORUM_CHAPTER_DISCUSSION as chapter on reply.POST_ID = chapter.POST_ID
+                JOIN SYS_USER su ON reply.USER_ID= su.ID
+                where
+                reply.POST_TYPE = 3
+                <if test="param.startTime!=null and param.startTime != ''">
+                    and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{param.startTime}
+                </if>
+                <if test="param.endTime!=null and param.endTime != ''">
+                    and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{param.endTime}
+                </if>
+            )t2 ON t1.hourId=t2.chapterId
+            WHERE 1=1
+            GROUP BY t2.postId
+        )finalOne ON finalOne.postId=postInfo.postId
+    </select>
+    <select id="getHourTeachMaterialList" resultType="java.util.Map">
+        SELECT
+            IFNULL(teachMaterial.fileName,'') AS fileName,
+            IFNULL(teachMaterial.suffix,'') AS suffix,
+            IFNULL(teachMaterial.hourId,'') AS hourId,
+            IFNULL(CONCAT(teachMaterial.courseName,'-',teachMaterial.chapterName,'-',teachMaterial.hourName) ,'') AS courseHourName
+        FROM (
+            SELECT
+                IFNULL(CAST(df.NAME AS VARCHAR),'') AS fileName,
+                IFNULL(CAST(df.SUFFIX AS VARCHAR),'') AS suffix,
+                cch.ID AS hourId,
+                IFNULL(cch.NAME,'') AS hourName,
+                cc.ID AS chapterId,
+                IFNULL(cc.NAME,'') AS chapterName,
+                ci.COURSE_ID AS courseId,
+                IFNULL(ci.COURSE_NAME,'') AS courseName
+            FROM COURSE_INFO ci
+            LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+            LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+            LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+            JOIN COURSE_RELATE cr ON cch.ID = cr.MAIN_ID  AND cr.DELETE_FLAG ='NOT_DELETE' AND cr.CHAPTERHOUR_TYPE ='1' AND cr.INFO_TYPE ='0' AND cr.FUNC_TYPE ='2'
+            JOIN DEV_FILE df ON df.ID = cr.RELATE_ID AND df.DELETE_FLAG ='NOT_DELETE'
+            WHERE ci.DELETE_FLAG ='NOT_DELETE'
+            AND cc.ID IS NOT NULL
+            AND ci.COURSE_ID IS NOT NULL
+            AND cch.ID IS NOT NULL
+            <if test="param.courseId !=null and param.courseId != ''">
+                and ci.COURSE_ID=#{param.courseId}
+            </if>
+            GROUP BY df.NAME,df.SUFFIX,cch.ID,cch.NAME,cc.ID,cc.NAME,ci.COURSE_ID,ci.COURSE_NAME
+        )teachMaterial
+    </select>
+    <select id="getWatchUserCountListDocWatch" resultType="java.util.Map">
+        SELECT
+            IFNULL(teachMaterial.hourId,'') AS hourId,
+            IFNULL(finalOne.watchUserCount,0) AS watchUserCount
+        FROM (
+            SELECT
+                cch.ID AS hourId
+            FROM COURSE_INFO ci            LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+            LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+            LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+            JOIN COURSE_RELATE cr ON cch.ID = cr.MAIN_ID  AND cr.DELETE_FLAG ='NOT_DELETE' AND cr.CHAPTERHOUR_TYPE ='1' AND cr.INFO_TYPE ='0' AND cr.FUNC_TYPE ='2'
+            JOIN DEV_FILE df ON df.ID = cr.RELATE_ID AND df.DELETE_FLAG ='NOT_DELETE'
+            WHERE ci.DELETE_FLAG ='NOT_DELETE'
+            AND cc.ID IS NOT NULL
+            AND ci.COURSE_ID IS NOT NULL
+            AND cch.ID IS NOT NULL
+            <if test="hourIdList !=null and hourIdList.size()>0">
+                and cch.ID in
+                <foreach collection=" hourIdList" close=")" index="index" item="item" open="(" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            GROUP BY cch.ID
+        )teachMaterial
+        LEFT JOIN(
+            SELECT
+                --	t1.hourId AS hourId,
+                --	t1.chapterId AS chapterId,
+                --	t1.userId AS userId,
+                --	csb.ID AS csbId
+                t1.hourId AS hourId,
+                IFNULL(count(csb.HOUR_ID),0) AS watchUserCount
+            FROM (
+                SELECT
+                    cop.ID AS copId,
+                    stu.ID AS userId,
+                    cch.ID AS hourId,
+                    cc.ID AS chapterId,
+                    ci.COURSE_ID AS courseId
+                FROM COURSE_INFO ci
+                LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+                LEFT JOIN SYS_USER stu ON stu.GRADES_ID =cop.GRADES_ID AND stu.DELETE_FLAG='NOT_DELETE'
+                LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+                LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+                WHERE ci.DELETE_FLAG ='NOT_DELETE'
+                AND cch.ID IS NOT NULL
+                AND cc.ID IS NOT NULL
+                AND ci.COURSE_ID IS NOT NULL
+                AND stu.ID IS NOT NULL
+                <if test="hourIdList !=null and hourIdList.size()>0">
+                    and cch.ID in
+                    <foreach collection=" hourIdList" close=")" index="index" item="item" open="(" separator=",">
+                        #{item}
+                    </foreach>
+                </if>
+                --		AND csb.USER_ID='1948586504800468993'
+            )t1
+            JOIN (
+                SELECT csb1.USER_ID,csb1.HOUR_ID
+                FROM COURSE_STUDENT_BURIALPOINT csb1
+                WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='2' AND csb1.TYPE='1'
+                <if test="startTime!=null and startTime != ''">
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
+                </if>
+                <if test="endTime!=null and endTime != ''">
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
+                </if>
+                GROUP BY csb1.USER_ID,csb1.HOUR_ID
+            ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
+            WHERE 1=1
+            GROUP BY t1.hourId
+        )finalOne ON teachMaterial.hourId =finalOne.hourId
+    </select>
+    <select id="getCompleteUserCountListDocWatch" resultType="java.util.Map">
+        SELECT
+            IFNULL(teachMaterial.hourId,'') AS hourId,
+            IFNULL(finalTwo.completeUserCount,0) AS completeUserCount
+        FROM (
+            SELECT
+                cch.ID AS hourId
+            FROM COURSE_INFO ci            LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+            LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+            LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+            JOIN COURSE_RELATE cr ON cch.ID = cr.MAIN_ID  AND cr.DELETE_FLAG ='NOT_DELETE' AND cr.CHAPTERHOUR_TYPE ='1' AND cr.INFO_TYPE ='0' AND cr.FUNC_TYPE ='2'
+            JOIN DEV_FILE df ON df.ID = cr.RELATE_ID AND df.DELETE_FLAG ='NOT_DELETE'
+            WHERE ci.DELETE_FLAG ='NOT_DELETE'
+            AND cc.ID IS NOT NULL
+            AND ci.COURSE_ID IS NOT NULL
+            AND cch.ID IS NOT NULL
+            <if test="hourIdList !=null and hourIdList.size()>0">
+                and cch.ID in
+                <foreach collection=" hourIdList" close=")" index="index" item="item" open="(" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            GROUP BY cch.ID
+        )teachMaterial
+        LEFT JOIN(
+            SELECT
+                --	t1.hourId AS hourId,
+                --	t1.chapterId AS chapterId,
+                --	t1.userId AS userId,
+                --	csb.ID AS csbId
+                t1.hourId AS hourId,
+                IFNULL(count(csb.HOUR_ID),0) AS completeUserCount
+            FROM (
+                SELECT
+                    cop.ID AS copId,
+                    stu.ID AS userId,
+                    cch.ID AS hourId,
+                    cc.ID AS chapterId,
+                    ci.COURSE_ID AS courseId
+                FROM COURSE_INFO ci
+                LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+                LEFT JOIN SYS_USER stu ON stu.GRADES_ID =cop.GRADES_ID AND stu.DELETE_FLAG='NOT_DELETE'
+                LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+                LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+                WHERE ci.DELETE_FLAG ='NOT_DELETE'
+                AND cch.ID IS NOT NULL
+                AND cc.ID IS NOT NULL
+                AND ci.COURSE_ID IS NOT NULL
+                AND stu.ID IS NOT NULL
+                <if test="hourIdList !=null and hourIdList.size()>0">
+                    and cch.ID in
+                    <foreach collection=" hourIdList" close=")" index="index" item="item" open="(" separator=",">
+                        #{item}
+                    </foreach>
+                </if>
+                --		AND csb.USER_ID='1948586504800468993'
+            )t1
+            JOIN (
+                SELECT csb1.USER_ID,csb1.HOUR_ID
+                FROM COURSE_STUDENT_BURIALPOINT csb1
+                WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='2' AND csb1.TYPE='1' AND csb1.PROGRESS=100
+                <if test="startTime!=null and startTime != ''">
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
+                </if>
+                <if test="endTime!=null and endTime != ''">
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
+                </if>
+                GROUP BY csb1.USER_ID,csb1.HOUR_ID
+            ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
+            WHERE 1=1
+            GROUP BY t1.hourId
+        )finalTwo ON teachMaterial.hourId =finalTwo.hourId
+    </select>
+    <select id="getCompleteRateListDocWatch" resultType="java.util.Map">
+        SELECT
+            IFNULL(teachMaterial.hourId,'') AS hourId,
+            IFNULL(finalThree.completeRate,0) AS completeRate
+        FROM (
+            SELECT
+                cch.ID AS hourId
+            FROM COURSE_INFO ci            LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+            LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+            LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+            JOIN COURSE_RELATE cr ON cch.ID = cr.MAIN_ID  AND cr.DELETE_FLAG ='NOT_DELETE' AND cr.CHAPTERHOUR_TYPE ='1' AND cr.INFO_TYPE ='0' AND cr.FUNC_TYPE ='2'
+            JOIN DEV_FILE df ON df.ID = cr.RELATE_ID AND df.DELETE_FLAG ='NOT_DELETE'
+            WHERE ci.DELETE_FLAG ='NOT_DELETE'
+            AND cc.ID IS NOT NULL
+            AND ci.COURSE_ID IS NOT NULL
+            AND cch.ID IS NOT NULL
+            <if test="hourIdList !=null and hourIdList.size()>0">
+                and cch.ID in
+                <foreach collection=" hourIdList" close=")" index="index" item="item" open="(" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            GROUP BY cch.ID
+        )teachMaterial
+        LEFT JOIN(
+            SELECT
+                z1.hourId AS hourId,
+                CASE
+                when z1.allUserCount=0 or z1.allUserCount is NULL OR z1.completeWatchUserCount=0 OR z1.completeWatchUserCount IS null then 0
+                else TRUNC(z1.completeWatchUserCount * 1.0 / z1.allUserCount, 2)
+                END AS completeRate
+            FROM(
+                SELECT
+                    --	t1.hourId AS hourId,
+                    --	t1.chapterId AS chapterId,
+                    --	t1.userId AS userId,
+                    --	csb.ID AS csbId
+                    t1.hourId AS hourId,
+                    IFNULL(count(t1.hourId),0) AS allUserCount,
+                    IFNULL(count(csb.HOUR_ID),0) AS completeWatchUserCount
+                FROM (
+                    SELECT
+                        cop.ID AS copId,
+                        stu.ID AS userId,
+                        cch.ID AS hourId,
+                        cc.ID AS chapterId,
+                        ci.COURSE_ID AS courseId
+                    FROM COURSE_INFO ci
+                    LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+                    LEFT JOIN SYS_USER stu ON stu.GRADES_ID =cop.GRADES_ID AND stu.DELETE_FLAG='NOT_DELETE'
+                    LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+                    LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+                    WHERE ci.DELETE_FLAG ='NOT_DELETE'
+                    AND cch.ID IS NOT NULL
+                    AND cc.ID IS NOT NULL
+                    AND ci.COURSE_ID IS NOT NULL
+                    AND stu.ID IS NOT NULL
+                    <if test="hourIdList !=null and hourIdList.size()>0">
+                        and cch.ID in
+                        <foreach collection=" hourIdList" close=")" index="index" item="item" open="(" separator=",">
+                            #{item}
+                        </foreach>
+                    </if>
+                    --		AND csb.USER_ID='1948586504800468993'
+                )t1
+                LEFT JOIN (
+                SELECT csb1.USER_ID,csb1.HOUR_ID
+                FROM COURSE_STUDENT_BURIALPOINT csb1
+                WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='2' AND csb1.TYPE='1' AND csb1.PROGRESS=100
+                <if test="startTime!=null and startTime != ''">
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
+                </if>
+                <if test="endTime!=null and endTime != ''">
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
+                </if>
+                GROUP BY csb1.USER_ID,csb1.HOUR_ID
+                ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
+                WHERE 1=1
+                GROUP BY t1.hourId
+            )z1
+        )finalThree ON teachMaterial.hourId =finalThree.hourId
+    </select>
+    <select id="getReadAvgTimeListDocWatch" resultType="java.util.Map">
+        SELECT
+            IFNULL(teachMaterial.hourId,'') AS hourId,
+            IFNULL(finalFour.readAvgTime,'') AS readAvgTime
+        FROM (
+            SELECT
+                cch.ID AS hourId
+            FROM COURSE_INFO ci            LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+            LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+            LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+            JOIN COURSE_RELATE cr ON cch.ID = cr.MAIN_ID  AND cr.DELETE_FLAG ='NOT_DELETE' AND cr.CHAPTERHOUR_TYPE ='1' AND cr.INFO_TYPE ='0' AND cr.FUNC_TYPE ='2'
+            JOIN DEV_FILE df ON df.ID = cr.RELATE_ID AND df.DELETE_FLAG ='NOT_DELETE'
+            WHERE ci.DELETE_FLAG ='NOT_DELETE'
+            AND cc.ID IS NOT NULL
+            AND ci.COURSE_ID IS NOT NULL
+            AND cch.ID IS NOT NULL
+            <if test="hourIdList !=null and hourIdList.size()>0">
+                and cch.ID in
+                <foreach collection=" hourIdList" close=")" index="index" item="item" open="(" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            GROUP BY cch.ID
+        )teachMaterial
+        LEFT JOIN(
+            SELECT
+                tt1.hourId AS hourId,
+                CASE
+                when tt1.readAvgTime=0 or tt1.readAvgTime is NULL then ''
+                else
+                CASE
+                WHEN FLOOR(tt1.readAvgTime / 3600000) = 0 THEN '0'
+                ELSE REGEXP_REPLACE(LPAD(FLOOR(tt1.readAvgTime / 3600000), 5, '0'), '^0+', '')
+                END || 'h' ||
+                IFNULL(LPAD(FLOOR((tt1.readAvgTime % 3600000) / 60000), 2, '0'),'00') || 'm' ||
+                IFNULL(LPAD(FLOOR((tt1.readAvgTime % 60000) / 1000), 2, '0'),'00')  || 's'
+                END AS readAvgTime
+            FROM (
+                SELECT
+                    --	t1.hourId AS hourId,
+                    --	t1.chapterId AS chapterId,
+                    --	t1.userId AS userId,
+                    --	csb.STAY_TIME AS stayTime
+                    t1.hourId AS hourId,
+                    ROUND(AVG(IFNULL(csb.STAY_TIME,0)), 2) AS readAvgTime
+                FROM (
+                    SELECT
+                        cop.ID AS copId,
+                        stu.ID AS userId,
+                        cch.ID AS hourId,
+                        cc.ID AS chapterId,
+                        ci.COURSE_ID AS courseId
+                    FROM COURSE_INFO ci
+                    LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+                    LEFT JOIN SYS_USER stu ON stu.GRADES_ID =cop.GRADES_ID AND stu.DELETE_FLAG='NOT_DELETE'
+                    LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+                    LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+                    WHERE ci.DELETE_FLAG ='NOT_DELETE'
+                    AND cch.ID IS NOT NULL
+                    AND cc.ID IS NOT NULL
+                    AND ci.COURSE_ID IS NOT NULL
+                    AND stu.ID IS NOT NULL
+                    <if test="hourIdList !=null and hourIdList.size()>0">
+                        and cch.ID in
+                        <foreach collection=" hourIdList" close=")" index="index" item="item" open="(" separator=",">
+                            #{item}
+                        </foreach>
+                    </if>
+                    --		AND csb.USER_ID='1948586504800468993'
+                )t1
+                LEFT JOIN (
+                    SELECT csb1.USER_ID,csb1.HOUR_ID,csb1.STAY_TIME
+                    FROM COURSE_STUDENT_BURIALPOINT csb1
+                    WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='2' AND csb1.TYPE='1'
+                    <if test="startTime!=null and startTime != ''">
+                        and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
+                    </if>
+                    <if test="endTime!=null and endTime != ''">
+                        and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
+                    </if>
+                ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
+                WHERE 1=1
+                GROUP BY t1.hourId
+            )tt1
+        )finalFour ON teachMaterial.hourId =finalFour.hourId
+    </select>
+    <select id="getJumpOutRateListDocWatch" resultType="java.util.Map">
+        SELECT
+            IFNULL(teachMaterial.hourId,'') AS hourId,
+            IFNULL(finalFive.jumpOutRate,0) AS jumpOutRate
+        FROM (
+            SELECT
+                cch.ID AS hourId
+            FROM COURSE_INFO ci            LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+            LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+            LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+            JOIN COURSE_RELATE cr ON cch.ID = cr.MAIN_ID  AND cr.DELETE_FLAG ='NOT_DELETE' AND cr.CHAPTERHOUR_TYPE ='1' AND cr.INFO_TYPE ='0' AND cr.FUNC_TYPE ='2'
+            JOIN DEV_FILE df ON df.ID = cr.RELATE_ID AND df.DELETE_FLAG ='NOT_DELETE'
+            WHERE ci.DELETE_FLAG ='NOT_DELETE'
+            AND cc.ID IS NOT NULL
+            AND ci.COURSE_ID IS NOT NULL
+            AND cch.ID IS NOT NULL
+            <if test="hourIdList !=null and hourIdList.size()>0">
+                and cch.ID in
+                <foreach collection=" hourIdList" close=")" index="index" item="item" open="(" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            GROUP BY cch.ID
+        )teachMaterial
+        LEFT JOIN(
+            SELECT
+                z1.hourId AS hourId,
+                CASE
+                when z1.jumpOutCount=0 or z1.jumpOutCount is NULL OR z1.allCount=0 OR z1.allCount IS null then 0
+                else TRUNC(z1.jumpOutCount * 1.0 / z1.allCount, 2)
+                END AS jumpOutRate
+            FROM(
+                --	#当前这些开课下所有课程的所有课程,所有观看过的记录
+                SELECT
+                    --	t1.hourId AS hourId,
+                    --	t1.chapterId AS chapterId,
+                    --	t1.courseId AS courseId,
+                    --	t1.userId AS userId,
+                    --	csb.ID AS csbId,
+                    --	csb.PROGRESS AS progress
+                    t1.hourId AS hourId,
+                    count(CASE WHEN csb.PROGRESS &lt; 100 THEN 1 END) AS jumpOutCount,
+                    count(csb.ID) AS allCount
+                FROM (
+                    SELECT
+                        cop.ID AS copId,
+                        stu.ID AS userId,
+                        cch.ID AS hourId,
+                        cc.ID AS chapterId,
+                        ci.COURSE_ID AS courseId
+                    FROM COURSE_INFO ci
+                    LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+                    LEFT JOIN SYS_USER stu ON stu.GRADES_ID =cop.GRADES_ID AND stu.DELETE_FLAG='NOT_DELETE'
+                    LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+                    LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+                    WHERE ci.DELETE_FLAG ='NOT_DELETE'
+                    AND cch.ID IS NOT NULL
+                    AND cc.ID IS NOT NULL
+                    AND ci.COURSE_ID IS NOT NULL
+                    AND stu.ID IS NOT NULL
+                    <if test="hourIdList !=null and hourIdList.size()>0">
+                        and cch.ID in
+                        <foreach collection=" hourIdList" close=")" index="index" item="item" open="(" separator=",">
+                            #{item}
+                        </foreach>
+                    </if>
+                    --		AND csb.USER_ID='1948586504800468993'
+                )t1
+                JOIN (
+                    SELECT csb1.ID,csb1.USER_ID,csb1.HOUR_ID,csb1.PROGRESS
+                    FROM COURSE_STUDENT_BURIALPOINT csb1
+                    WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='2' AND csb1.TYPE='1'
+                    <if test="startTime!=null and startTime != ''">
+                        and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
+                    </if>
+                    <if test="endTime!=null and endTime != ''">
+                        and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
+                    </if>
+                ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
+                WHERE 1=1
+                GROUP BY t1.hourId
+            )z1
+        )finalFive ON teachMaterial.hourId =finalFive.hourId
+    </select>
+    <select id="getDownloadCountListDocWatch" resultType="java.util.Map">
+        SELECT
+            IFNULL(teachMaterial.hourId,'') AS hourId,
+            IFNULL(finalSix.downloadCount,0) AS downloadCount
+        FROM (
+            SELECT
+                cch.ID AS hourId
+            FROM COURSE_INFO ci            LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+            LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+            LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+            JOIN COURSE_RELATE cr ON cch.ID = cr.MAIN_ID  AND cr.DELETE_FLAG ='NOT_DELETE' AND cr.CHAPTERHOUR_TYPE ='1' AND cr.INFO_TYPE ='0' AND cr.FUNC_TYPE ='2'
+            JOIN DEV_FILE df ON df.ID = cr.RELATE_ID AND df.DELETE_FLAG ='NOT_DELETE'
+            WHERE ci.DELETE_FLAG ='NOT_DELETE'
+            AND cc.ID IS NOT NULL
+            AND ci.COURSE_ID IS NOT NULL
+            AND cch.ID IS NOT NULL
+            <if test="hourIdList !=null and hourIdList.size()>0">
+                and cch.ID in
+                <foreach collection=" hourIdList" close=")" index="index" item="item" open="(" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            GROUP BY cch.ID
+        )teachMaterial
+        LEFT JOIN(
+            SELECT
+                --	t1.hourId AS hourId,
+                --	t1.chapterId AS chapterId,
+                --	t1.courseId AS courseId,
+                --	t1.userId AS userId,
+                --	csb.ID AS csbId
+                t1.hourId AS hourId,
+                IFNULL(count(csb.ID),0) AS downloadCount
+            FROM (
+                SELECT
+                    cop.ID AS copId,
+                    stu.ID AS userId,
+                    cch.ID AS hourId,
+                    cc.ID AS chapterId,
+                    ci.COURSE_ID AS courseId
+                FROM COURSE_INFO ci
+                LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+                LEFT JOIN SYS_USER stu ON stu.GRADES_ID =cop.GRADES_ID AND stu.DELETE_FLAG='NOT_DELETE'
+                LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+                LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+                WHERE ci.DELETE_FLAG ='NOT_DELETE'
+                AND cch.ID IS NOT NULL
+                AND cc.ID IS NOT NULL
+                AND ci.COURSE_ID IS NOT NULL
+                AND stu.ID IS NOT NULL
+                <if test="hourIdList !=null and hourIdList.size()>0">
+                    and cch.ID in
+                    <foreach collection=" hourIdList" close=")" index="index" item="item" open="(" separator=",">
+                        #{item}
+                    </foreach>
+                </if>
+                --		AND csb.USER_ID='1948586504800468993'
+            )t1
+            LEFT JOIN (
+                SELECT csb1.ID,csb1.USER_ID,csb1.HOUR_ID
+                FROM COURSE_STUDENT_BURIALPOINT csb1
+                WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='2' AND csb1.TYPE='2'
+                <if test="startTime!=null and startTime != ''">
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
+                </if>
+                <if test="endTime!=null and endTime != ''">
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
+                </if>
+            ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
+            WHERE 1=1
+            GROUP BY t1.hourId
+        )finalSix ON teachMaterial.hourId =finalSix.hourId
+    </select>
+    <select id="courseOpenDayStatistic" resultType="java.lang.String">
+        select t1.num as num
+        from(
+            SELECT
+                TO_CHAR(ctb.create_time, 'YYYY-MM-DD') AS dayTime,
+                count(DISTINCT ctb.USER_ID ) num
+            FROM COURSE_INFO ci
+            LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
+            LEFT JOIN SYS_USER stu ON stu.GRADES_ID =cop.GRADES_ID AND stu.DELETE_FLAG='NOT_DELETE'
+            LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+            LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
+            LEFT JOIN COURSE_STUDENT_BURIALPOINT ctb ON ctb.DELETE_FLAG ='NOT_DELETE' AND cch.ID =ctb.HOUR_ID AND stu.ID=ctb.USER_ID and ctb.FUNC_TYPE='1' and ctb.TYPE='1'
+            where ci.DELETE_FLAG ='NOT_DELETE'
+            <if test="courseId != null and courseId != ''">
+                AND ci.COURSE_ID = #{courseId}
+            </if>
+            AND cch.ID IS NOT NULL
+            AND cc.ID IS NOT NULL
+            AND ci.COURSE_ID IS NOT NULL
+            AND stu.ID IS NOT NULL
+            AND ctb.create_time IS NOT null
+            GROUP BY TO_CHAR(ctb.create_time, 'YYYY-MM-DD')
+            ORDER BY TO_CHAR(ctb.create_time, 'YYYY-MM-DD')
+        )t1
+        where 1=1
+        <if test="dayStr!=null and dayStr != ''">
+            and t1.dayTime = #{dayStr}
+        </if>
+    </select>
 
 
 </mapper>

+ 68 - 64
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/mapping/VideoAnalysisProgressMapper.xml

@@ -40,10 +40,10 @@
                 FROM COURSE_STUDENT_BURIALPOINT csb1
                 WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='1' AND csb1.TYPE='1'
                 <if test="startTime!=null and startTime != ''">
-                    and csb1.CREATE_TIME &gt;=#{startTime}
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                 </if>
                 <if test="endTime!=null and endTime != ''">
-                    and csb1.CREATE_TIME &lt;=#{endTime}
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                 </if>
                 GROUP BY csb1.USER_ID,csb1.HOUR_ID
             ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
@@ -130,10 +130,10 @@
                     FROM COURSE_STUDENT_BURIALPOINT csb1
                     WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='1' AND csb1.TYPE='1'
                     <if test="startTime!=null and startTime != ''">
-                        and csb1.CREATE_TIME &gt;=#{startTime}
+                        and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                     </if>
                     <if test="endTime!=null and endTime != ''">
-                        and csb1.CREATE_TIME &lt;=#{endTime}
+                        and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                     </if>
                     GROUP BY csb1.USER_ID,csb1.HOUR_ID
                 ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
@@ -236,10 +236,10 @@
                             FROM COURSE_STUDENT_BURIALPOINT csb1
                             WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='1' AND csb1.TYPE='1'
                             <if test="startTime!=null and startTime != ''">
-                                and csb1.CREATE_TIME &gt;=#{startTime}
+                                and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                             </if>
                             <if test="endTime!=null and endTime != ''">
-                                and csb1.CREATE_TIME &lt;=#{endTime}
+                                and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                             </if>
                             GROUP BY csb1.USER_ID,csb1.HOUR_ID
                         ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
@@ -287,10 +287,10 @@
             WHERE csb1.DELETE_FLAG ='NOT_DELETE'
             AND csb1.FUNC_TYPE='2' AND csb1.TYPE='2'
             <if test="startTime!=null and startTime != ''">
-                and csb1.CREATE_TIME &gt;=#{startTime}
+                and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
             </if>
             <if test="endTime!=null and endTime != ''">
-                and csb1.CREATE_TIME &lt;=#{endTime}
+                and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
             </if>
         ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
         WHERE 1=1
@@ -363,10 +363,10 @@
                         FROM COURSE_STUDENT_BURIALPOINT csb1
                         WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='2' AND csb1.TYPE='2'
                         <if test="startTime!=null and startTime != ''">
-                            and csb1.CREATE_TIME &gt;=#{startTime}
+                            and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                         </if>
                         <if test="endTime!=null and endTime != ''">
-                            and csb1.CREATE_TIME &lt;=#{endTime}
+                            and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                         </if>
                         GROUP BY csb1.USER_ID,csb1.HOUR_ID
                     ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
@@ -414,10 +414,10 @@
                 WHERE csb1.DELETE_FLAG ='NOT_DELETE'
                 AND csb1.FUNC_TYPE='2' AND csb1.TYPE='2'
                 <if test="startTime!=null and startTime != ''">
-                    and csb1.CREATE_TIME &gt;=#{startTime}
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                 </if>
                 <if test="endTime!=null and endTime != ''">
-                    and csb1.CREATE_TIME &lt;=#{endTime}
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                 </if>
             ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
             WHERE 1=1
@@ -459,10 +459,10 @@
             FROM COURSE_STUDENT_BURIALPOINT csb1
             WHERE csb1.DELETE_FLAG ='NOT_DELETE'
             <if test="startTime!=null and startTime != ''">
-                and csb1.CREATE_TIME &gt;=#{startTime}
+                and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
             </if>
             <if test="endTime!=null and endTime != ''">
-                and csb1.CREATE_TIME &lt;=#{endTime}
+                and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
             </if>
             AND csb1.FUNC_TYPE='1' AND csb1.TYPE='1' AND csb1.PROGRESS &lt; 100
         ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
@@ -511,10 +511,10 @@
                 FROM COURSE_STUDENT_BURIALPOINT csb1
                 WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='1' AND csb1.TYPE='1'
                 <if test="startTime!=null and startTime != ''">
-                    and csb1.CREATE_TIME &gt;=#{startTime}
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                 </if>
                 <if test="endTime!=null and endTime != ''">
-                    and csb1.CREATE_TIME &lt;=#{endTime}
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                 </if>
             ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
             WHERE 1=1
@@ -571,10 +571,10 @@
                 FROM COURSE_STUDENT_BURIALPOINT csb1
                 WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='1' AND csb1.TYPE='1' AND csb1.PROGRESS &lt; 100
                 <if test="startTime!=null and startTime != ''">
-                    and csb1.CREATE_TIME &gt;=#{startTime}
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                 </if>
                 <if test="endTime!=null and endTime != ''">
-                    and csb1.CREATE_TIME &lt;=#{endTime}
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                 </if>
             ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
             WHERE 1=1
@@ -610,10 +610,10 @@
             select cr1.* from COURSE_RELATE cr1
             WHERE cr1.DELETE_FLAG ='NOT_DELETE'
             <if test="startTime!=null and startTime != ''">
-                and cr1.CREATE_TIME &gt;=#{startTime}
+                and TO_CHAR(cr1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
             </if>
             <if test="endTime!=null and endTime != ''">
-                and cr1.CREATE_TIME &lt;=#{endTime}
+                and TO_CHAR(cr1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
             </if>
         ) cr ON t1.hourId=cr.MAIN_ID AND cr.DELETE_FLAG ='NOT_DELETE' and cr.CHAPTERHOUR_TYPE ='1' AND cr.INFO_TYPE ='1' AND FUNC_TYPE ='6'
     </select>
@@ -626,21 +626,23 @@
             IFNULL(count(t2.replyId),0) postCount
         from(
             SELECT
-            stu.ID AS userId,
-            cc.ID AS chapterId,
-            ci.COURSE_ID AS courseId
+                stu.ID AS userId,
+                cch.ID AS hourId,
+                ci.COURSE_ID AS courseId
             FROM COURSE_INFO ci
             LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
             LEFT JOIN SYS_USER stu ON stu.GRADES_ID =cop.GRADES_ID AND stu.DELETE_FLAG='NOT_DELETE'
             LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+            LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
             WHERE ci.DELETE_FLAG ='NOT_DELETE'
             AND cc.ID IS NOT NULL
             AND ci.COURSE_ID IS NOT NULL
+            AND cch.ID IS NOT NULL
             AND stu.ID IS NOT NULL
             <if test="courseId !=null and courseId != ''">
                 and ci.COURSE_ID=#{courseId}
             </if>
-            GROUP BY stu.ID,cc.ID,ci.COURSE_ID
+            GROUP BY stu.ID,cch.ID,ci.COURSE_ID
         )t1
         JOIN (
             select
@@ -657,12 +659,12 @@
             --AND chapter.COURSE_ID = '1946462050075185153'
             --AND reply.USER_ID = '1948586504800468993'
             <if test="startTime!=null and startTime != ''">
-                and reply.CREATE_TIME &gt;=#{startTime}
+                and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
             </if>
             <if test="endTime!=null and endTime != ''">
-                and reply.CREATE_TIME &lt;=#{endTime}
+                and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
             </if>
-        )t2 ON t1.chapterId=t2.chapterId AND t1.userId=t2.userId
+        )t2 ON t1.hourId=t2.chapterId AND t1.userId=t2.userId
         WHERE 1=1
     </select>
     <select id="getReplyCount" resultType="java.lang.String">
@@ -675,20 +677,22 @@
         from(
             SELECT
                 stu.ID AS userId,
-                cc.ID AS chapterId,
+                cch.ID AS hourId,
                 ci.COURSE_ID AS courseId
             FROM COURSE_INFO ci
             LEFT JOIN COURSE_OPEN cop ON ci.COURSE_ID =cop.COURSE_ID AND cop.DELETE_FLAG='NOT_DELETE'
             LEFT JOIN SYS_USER stu ON stu.GRADES_ID =cop.GRADES_ID AND stu.DELETE_FLAG='NOT_DELETE'
             LEFT JOIN COURSE_CHAPTER cc ON ci.COURSE_ID =cc.COURSE_ID AND cc.DELETE_FLAG ='NOT_DELETE'
+            LEFT JOIN COURSE_CLASSHOUR cch ON cc.ID=cch.CHAPTER_ID AND cch.DELETE_FLAG ='NOT_DELETE'
             WHERE ci.DELETE_FLAG ='NOT_DELETE'
             AND cc.ID IS NOT NULL
             AND ci.COURSE_ID IS NOT NULL
+            AND cch.ID IS NOT NULL
             AND stu.ID IS NOT NULL
             <if test="courseId !=null and courseId != ''">
                 and ci.COURSE_ID=#{courseId}
             </if>
-            GROUP BY stu.ID,cc.ID,ci.COURSE_ID
+            GROUP BY stu.ID,cch.ID,ci.COURSE_ID
         )t1
         JOIN (
             select
@@ -706,12 +710,12 @@
             --AND chapter.COURSE_ID = '1946462050075185153'
             --AND reply.USER_ID = '1948586504800468993'
             <if test="startTime!=null and startTime != ''">
-                and reply.CREATE_TIME &gt;=#{startTime}
+                and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
             </if>
             <if test="endTime!=null and endTime != ''">
-                and reply.CREATE_TIME &lt;=#{endTime}
+                and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
             </if>
-        )t2 ON t1.chapterId=t2.chapterId AND t1.userId=t2.userId
+        )t2 ON t1.hourId=t2.chapterId AND t1.userId=t2.userId
         WHERE 1=1
     </select>
 
@@ -788,10 +792,10 @@
                         </foreach>
                     </if>
                     <if test="startTime!=null and startTime != ''">
-                        and csb1.CREATE_TIME &gt;=#{startTime}
+                        and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                     </if>
                     <if test="endTime!=null and endTime != ''">
-                        and csb1.CREATE_TIME &lt;=#{endTime}
+                        and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                     </if>
                 ) csbVideo ON csbVideo.HOUR_ID =t1.hourId AND csbVideo.USER_ID=t1.userId
                 WHERE 1=1
@@ -857,10 +861,10 @@
                 </foreach>
             </if>
             <if test="startTime!=null and startTime != ''">
-                and csb1.CREATE_TIME &gt;=#{startTime}
+                and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
             </if>
             <if test="endTime!=null and endTime != ''">
-                and csb1.CREATE_TIME &lt;=#{endTime}
+                and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
             </if>
         ) csbQuickOpera ON csbQuickOpera.HOUR_ID =t1.hourId AND csbQuickOpera.USER_ID=t1.userId
         WHERE 1=1
@@ -970,10 +974,10 @@
                         </foreach>
                     </if>
                     <if test="startTime!=null and startTime != ''">
-                        and csb1.CREATE_TIME &gt;=#{startTime}
+                        and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                     </if>
                     <if test="endTime!=null and endTime != ''">
-                        and csb1.CREATE_TIME &lt;=#{endTime}
+                        and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                     </if>
                     GROUP BY csb1.USER_ID,csb1.HOUR_ID
                 ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
@@ -1033,10 +1037,10 @@
                 select cr1.* from COURSE_RELATE cr1
                 where cr1.DELETE_FLAG ='NOT_DELETE'
                 <if test="startTime!=null and startTime != ''">
-                    and cr1.CREATE_TIME &gt;=#{startTime}
+                    and TO_CHAR(cr1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                 </if>
                 <if test="endTime!=null and endTime != ''">
-                    and cr1.CREATE_TIME &lt;=#{endTime}
+                    and TO_CHAR(cr1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                 </if>
             ) cr ON t1.hourId=cr.MAIN_ID AND cr.DELETE_FLAG ='NOT_DELETE' and cr.CHAPTERHOUR_TYPE ='1' AND cr.INFO_TYPE ='1' AND FUNC_TYPE ='6'
             WHERE 1=1
@@ -1125,10 +1129,10 @@
                         </foreach>
                     </if>
                     <if test="startTime!=null and startTime != ''">
-                        and csb1.CREATE_TIME &gt;=#{startTime}
+                        and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                     </if>
                     <if test="endTime!=null and endTime != ''">
-                        and csb1.CREATE_TIME &lt;=#{endTime}
+                        and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                     </if>
                 ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
                 WHERE 1=1
@@ -1169,10 +1173,10 @@
                 </foreach>
             </if>
             <if test="startTime!=null and startTime != ''">
-                and reply.CREATE_TIME &gt;=#{startTime}
+                and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
             </if>
             <if test="endTime!=null and endTime != ''">
-                and reply.CREATE_TIME &lt;=#{endTime}
+                and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
             </if>
             GROUP BY reply.USER_ID
         )finalSix ON su.ID =finalSix.userId
@@ -1208,10 +1212,10 @@
                 </foreach>
             </if>
             <if test="startTime!=null and startTime != ''">
-                and reply.CREATE_TIME &gt;=#{startTime}
+                and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
             </if>
             <if test="endTime!=null and endTime != ''">
-                and reply.CREATE_TIME &lt;=#{endTime}
+                and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
             </if>
             GROUP BY reply.USER_ID
         )finalSeven ON su.ID =finalSeven.userId
@@ -1336,10 +1340,10 @@
                     FROM COURSE_STUDENT_BURIALPOINT csb1
                     WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='1' AND csb1.TYPE='1'
                     <if test="startTime!=null and startTime != ''">
-                        and csb1.CREATE_TIME &gt;=#{startTime}
+                        and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                     </if>
                     <if test="endTime!=null and endTime != ''">
-                        and csb1.CREATE_TIME &lt;=#{endTime}
+                        and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                     </if>
                 ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
                 WHERE 1=1
@@ -1420,10 +1424,10 @@
                     FROM COURSE_STUDENT_BURIALPOINT csb1
                     WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='1' AND csb1.TYPE='1'
                     <if test="startTime!=null and startTime != ''">
-                        and csb1.CREATE_TIME &gt;=#{startTime}
+                        and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                     </if>
                     <if test="endTime!=null and endTime != ''">
-                        and csb1.CREATE_TIME &lt;=#{endTime}
+                        and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                     </if>
                     GROUP BY csb1.USER_ID,csb1.HOUR_ID
                 ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
@@ -1554,10 +1558,10 @@
                         FROM COURSE_STUDENT_BURIALPOINT csb1
                         WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='1' AND csb1.TYPE='1'
                         <if test="startTime!=null and startTime != ''">
-                            and csb1.CREATE_TIME &gt;=#{startTime}
+                            and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                         </if>
                         <if test="endTime!=null and endTime != ''">
-                            and csb1.CREATE_TIME &lt;=#{endTime}
+                            and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                         </if>
                         GROUP BY csb1.USER_ID,csb1.HOUR_ID
                     ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
@@ -1702,10 +1706,10 @@
                             FROM COURSE_STUDENT_BURIALPOINT csb1
                             WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='1' AND csb1.TYPE='1'
                             <if test="startTime!=null and startTime != ''">
-                                and csb1.CREATE_TIME &gt;=#{startTime}
+                                and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                             </if>
                             <if test="endTime!=null and endTime != ''">
-                                and csb1.CREATE_TIME &lt;=#{endTime}
+                                and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                             </if>
                             GROUP BY csb1.USER_ID,csb1.HOUR_ID
                         ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
@@ -1803,10 +1807,10 @@
                         FROM COURSE_STUDENT_BURIALPOINT csb1
                         WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='1' AND csb1.TYPE='1'
                         <if test="startTime!=null and startTime != ''">
-                            and csb1.CREATE_TIME &gt;=#{startTime}
+                            and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                         </if>
                         <if test="endTime!=null and endTime != ''">
-                            and csb1.CREATE_TIME &lt;=#{endTime}
+                            and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                         </if>
                     ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
                     WHERE 1=1
@@ -1897,10 +1901,10 @@
                     FROM COURSE_STUDENT_BURIALPOINT csb1
                     WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='1' AND csb1.TYPE='1'
                     <if test="startTime!=null and startTime != ''">
-                        and csb1.CREATE_TIME &gt;=#{startTime}
+                        and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                     </if>
                     <if test="endTime!=null and endTime != ''">
-                        and csb1.CREATE_TIME &lt;=#{endTime}
+                        and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                     </if>
                 ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
                 WHERE 1=1
@@ -1977,10 +1981,10 @@
                 FROM COURSE_STUDENT_BURIALPOINT csb1
                 WHERE csb1.DELETE_FLAG ='NOT_DELETE' AND csb1.FUNC_TYPE='2' AND csb1.TYPE='2'
                 <if test="startTime!=null and startTime != ''">
-                    and csb1.CREATE_TIME &gt;=#{startTime}
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                 </if>
                 <if test="endTime!=null and endTime != ''">
-                    and csb1.CREATE_TIME &lt;=#{endTime}
+                    and TO_CHAR(csb1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                 </if>
             ) csb ON csb.HOUR_ID =t1.hourId AND csb.USER_ID=t1.userId
             WHERE 1=1
@@ -2056,10 +2060,10 @@
                 select cr1.* from COURSE_RELATE cr1
                 where cr1.DELETE_FLAG ='NOT_DELETE'
                 <if test="startTime!=null and startTime != ''">
-                    and cr1.CREATE_TIME &gt;=#{startTime}
+                    and TO_CHAR(cr1.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                 </if>
                 <if test="endTime!=null and endTime != ''">
-                    and cr1.CREATE_TIME &lt;=#{endTime}
+                    and TO_CHAR(cr1.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                 </if>
             ) cr ON t1.hourId=cr.MAIN_ID AND cr.DELETE_FLAG ='NOT_DELETE' and cr.CHAPTERHOUR_TYPE ='1' AND cr.INFO_TYPE ='1' AND FUNC_TYPE ='6'
             WHERE 1=1
@@ -2140,10 +2144,10 @@
                 where
                 reply.POST_TYPE = 3
                 <if test="startTime!=null and startTime != ''">
-                    and reply.CREATE_TIME &gt;=#{startTime}
+                    and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &gt;=#{startTime}
                 </if>
                 <if test="endTime!=null and endTime != ''">
-                    and reply.CREATE_TIME &lt;=#{endTime}
+                    and TO_CHAR(reply.CREATE_TIME, 'YYYY-MM-DD') &lt;=#{endTime}
                 </if>
             )t2 ON t1.hourId=t2.chapterId AND t1.userId=t2.userId
             WHERE 1=1

+ 32 - 4
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/service/TeachingActivityService.java

@@ -1,16 +1,44 @@
 package vip.xiaonuo.disk.service;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.springframework.web.bind.annotation.RequestParam;
 
 import java.util.List;
 import java.util.Map;
 
 public interface TeachingActivityService {
-    Map<String, Object> documentStatistic(String courseId,String type);
+    Map<String, Object> documentStatistic(Map param);
 
-    Map<String, Object> documentJumpStatistic(String courseId, String type);
+    Map<String, Object> documentJumpStatistic(Map param);
 
-    List<Map<String, Object>> courseOpenStatistic(String courseId, String type);
+    List<Map<String, Object>> courseOpenStatistic(Map param);
+
+
+    List<Map<String, Object>> documentDetailStatistic(Map param);
+
+    /**
+     * 教学活动分析-讨论互动统计
+     */
+    Map<String,Object> getDiscussInteractionAnalyse(Map param);
+
+    /**
+     * 教学活动分析-学员每周发帖统计
+     */
+    Map<String,Object> getStuWeeklyPostProgress(Map param);
+
+    /**
+     * 教学活动分析-教员每周发帖统计
+     */
+    Map<String,Object> getTeachWeeklyPostProgress(Map param);
+
+    /**
+     *  教学活动分析-课程讨论详情
+     */
+    Page<Map<String,Object>> courseDiscussDetail(Map param);
+
+    /**
+     *  教学活动分析-文档观看详细统计
+     */
+    Page<Map<String,Object>> documentWatchDetailStatistic(Map param);
 
-    List<Map<String, Object>> documentDetailStatistic(String courseId, String type);
 }

+ 43 - 7
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/service/impl/PlatformStatusOverviewServiceImpl.java

@@ -1,13 +1,13 @@
 package vip.xiaonuo.disk.service.impl;
 
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import vip.xiaonuo.disk.mapper.PlatformStatusOverviewMapper;
 import vip.xiaonuo.disk.service.PlatformStatusOverviewService;
 
 import javax.annotation.Resource;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
 /**
  * 平台运行状态总览服务实现类
@@ -45,10 +45,46 @@ public class PlatformStatusOverviewServiceImpl implements PlatformStatusOverview
     @Override
     public Map<String, Object> getCourseVisitTrend(Long courseId) {
         Map<String, Object> result = new HashMap<>();
-        // 获取近7天访问量趋势
-        List<Map<String, Object>> visitTrend = platformStatusOverviewMapper.getCourseVisitTrend(courseId);
-        result.put("visitTrend", visitTrend);
-
+        Map param = new HashMap();
+        List<Map<String, Object>> visitTrendList = new ArrayList<>();
+//        // 获取近7天访问量趋势
+//        List<Map<String, Object>> visitTrend = platformStatusOverviewMapper.getCourseVisitTrend(courseId);
+//        result.put("visitTrend", visitTrend);
+        //获取最近七天的日期
+        List<String> days = getLastSevenDays();
+        for (String day : days)
+        {
+            param.put("day",day);
+            param.put("courseId",courseId);
+            String visitNum=platformStatusOverviewMapper.getOnedayCourseVisitTrendNum(param);
+            Map visitTrendMap=new HashMap();
+            visitTrendMap.put("visitDate",day);
+            if(StringUtils.isEmpty(visitNum))visitNum="0";
+            visitTrendMap.put("visitCount",visitNum);
+            visitTrendList.add(visitTrendMap);
+        }
+        result.put("visitTrend", visitTrendList);
         return result;
     }
+
+    /**
+     *  获取往前七天
+     */
+    public static List<String> getLastSevenDays() {
+        List<String> days = new ArrayList<>();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        Calendar calendar = Calendar.getInstance();
+        String calculateToday=sdf.format(calendar.getTime());
+        days.add(calculateToday);
+        // 往前推7天(共7天)
+        for (int i = 1; i <= 6; i++) {
+            Calendar temp = (Calendar) calendar.clone();
+            temp.add(Calendar.DATE, -i); // 往前减i个月
+            String calculate=sdf.format(temp.getTime());
+            days.add(calculate);
+        }
+
+
+        return days;
+    }
 }

+ 4 - 1
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/service/impl/ResourceFootprintServiceImpl.java

@@ -59,8 +59,11 @@ public class ResourceFootprintServiceImpl extends ServiceImpl<ResourceFootprintM
             queryWrapper.orderBy(true, resourceFootprintPageParam.getSortOrder().equals(CommonSortOrderEnum.ASC.getValue()),
                     StrUtil.toUnderlineCase(resourceFootprintPageParam.getSortField()));
         } else {
-            queryWrapper.lambda().orderByAsc(ResourceFootprint::getId);
+            queryWrapper.lambda().orderByDesc(ResourceFootprint::getCreateTime);
         }
+        //清除错误数据
+        queryWrapper.lambda().isNotNull(ResourceFootprint::getFileName);
+        queryWrapper.lambda().isNotNull(ResourceFootprint::getFilePath);
         return this.page(CommonPageRequest.defaultPage(), queryWrapper);
     }
 

+ 286 - 12
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/service/impl/TeachingActivityServiceImpl.java

@@ -1,14 +1,20 @@
 package vip.xiaonuo.disk.service.impl;
 
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
+import vip.xiaonuo.common.page.CommonPageRequest;
 import vip.xiaonuo.disk.mapper.TeachingActivityMapper;
 import vip.xiaonuo.disk.service.TeachingActivityService;
 import vip.xiaonuo.disk.util.AppUseAggregationUtil;
 
 import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.stream.Collectors;
 
 @Slf4j
 @Service
@@ -16,27 +22,244 @@ public class TeachingActivityServiceImpl implements TeachingActivityService {
     @Resource
     private TeachingActivityMapper teachingActivityMapper;
     @Override
-    public Map<String, Object> documentStatistic(String courseId,String type) {
-        Map<String, Object>  map=getTime(type);
-        return teachingActivityMapper.documentStatistic(courseId,map);
+    public Map<String, Object> documentStatistic(Map param) {
+//        Map<String, Object>  map=getTime(type);
+        return teachingActivityMapper.documentStatistic(param);
     }
 
     @Override
-    public Map<String, Object> documentJumpStatistic(String courseId, String type) {
-        Map<String, Object>  map=getTime(type);
-        return teachingActivityMapper.documentJumpStatistic(courseId,map);
+    public Map<String, Object> documentJumpStatistic(Map param) {
+//        Map<String, Object>  map=getTime(type);
+        Map<String,Object> result=new HashMap<>();
+        //总跳出次数
+        String jumpOutCount=teachingActivityMapper.getJumpOutCount(param);
+        //跳出率
+        String jumpOutRate=teachingActivityMapper.getJumpOutRate(param);
+        //平均跳出时间
+        String jumpAvgTime=teachingActivityMapper.getJumpAvgTime(param);
+        result.put("allHourCount",jumpOutCount);
+        result.put("finishRate",jumpOutRate);
+        result.put("jumpAvgTime",jumpAvgTime);
+
+        return result;
     }
 
     @Override
-    public List<Map<String, Object>> courseOpenStatistic(String courseId, String type) {
-        Map<String, Object>  map=getTime(type);
-        return teachingActivityMapper.courseOpenStatistic(courseId,map);
+    public List<Map<String, Object>> courseOpenStatistic(Map param) {
+//        Map<String, Object>  map=getTime(type);
+
+        List<Map<String,Object> > resultList=new ArrayList();
+        String courseId=null;
+        if(ObjectUtil.isNotEmpty(param.get("courseId")))courseId=param.get("courseId").toString();
+        //该接口只查询最近一个月,时间固定取值
+        String startTime="";
+//        if(ObjectUtil.isNotEmpty(param.get("startTime")))startTime=param.get("startTime").toString();
+        String endTime="";
+//        if(ObjectUtil.isNotEmpty(param.get("endTime")))endTime=param.get("endTime").toString();
+        List<String> days = getLastThirtyDay(startTime,endTime);
+        Collections.reverse(days);
+        for(String  day:days)
+        {
+            Map dayStatisticParam =new HashMap();
+            dayStatisticParam.put("dayStr",day);
+            dayStatisticParam.put("courseId",courseId);
+            String num=teachingActivityMapper.courseOpenDayStatistic(dayStatisticParam);
+            if(StringUtils.isEmpty(num))num="0";
+            Map result=new HashMap();
+            result.put("TIME",day);
+            result.put("num",num);
+            resultList.add(result);
+        }
+        return resultList;
     }
 
     @Override
-    public List<Map<String, Object>> documentDetailStatistic(String courseId, String type) {
-        Map<String, Object>  map=getTime(type);
-        return teachingActivityMapper.documentDetailStatistic(courseId,map);
+    public List<Map<String, Object>> documentDetailStatistic(Map param) {
+//        Map<String, Object>  map=getTime(type);
+        return teachingActivityMapper.documentDetailStatistic(param);
+    }
+
+    /**
+     * 教学活动分析-讨论互动统计
+     */
+    @Override
+    public Map<String,Object> getDiscussInteractionAnalyse(Map param)
+    {
+        Map<String,Object> result=new HashMap<>();
+        //讨论总数
+        String postCount=teachingActivityMapper.getPostCount(param);
+        //回帖总数
+        String replyCount=teachingActivityMapper.getReplyCount(param);
+        //平均回帖数
+        String avgReplyCount=teachingActivityMapper.getAvgReplyCount(param);
+        result.put("postCount",postCount);
+        result.put("replyCount",replyCount);
+        result.put("avgReplyCount",avgReplyCount);
+
+        return result;
+    }
+
+    /**
+     * 教学活动分析-学员每周发帖统计
+     */
+    @Override
+    public Map<String,Object> getStuWeeklyPostProgress(Map param)
+    {
+        Map<String,Object> result=new HashMap<>();
+        //该接口只查询最近一周,时间固定取值
+        String endTime= DateUtil.format(new Date(), "yyyy-MM-dd");
+        String startTime = AppUseAggregationUtil.offsetDay(endTime, -7, "yyyy-MM-dd");
+        param.put("startTime", startTime);
+        param.put("endTime", endTime);
+
+        //本周发帖数
+        String weekPostCount=teachingActivityMapper.getStuWeekPostCount(param);
+        //本周回帖数
+        String weekReplyCount=teachingActivityMapper.getStuWeekReplyCount(param);
+        //日均发帖数
+        String weekAvgPostCount=teachingActivityMapper.getStuWeekAvgPostCount(param);
+        result.put("weekPostCount",weekPostCount);
+        result.put("weekReplyCount",weekReplyCount);
+        result.put("weekAvgPostCount",weekAvgPostCount);
+
+        return result;
+    }
+
+    /**
+     * 教学活动分析-教员每周发帖统计
+     */
+    @Override
+    public Map<String,Object> getTeachWeeklyPostProgress(Map param)
+    {
+        Map<String,Object> result=new HashMap<>();
+        //该接口只查询最近一周,时间固定取值
+        String endTime= DateUtil.format(new Date(), "yyyy-MM-dd");
+        String startTime = AppUseAggregationUtil.offsetDay(endTime, -7, "yyyy-MM-dd");
+        param.put("startTime", startTime);
+        param.put("endTime", endTime);
+
+        //本周发帖数
+        String weekPostCount=teachingActivityMapper.getTeachWeekPostCount(param);
+        //本周回帖数
+        String weekReplyCount=teachingActivityMapper.getTeachWeekReplyCount(param);
+        //日均发帖数
+        String weekAvgPostCount=teachingActivityMapper.getTeachWeekAvgPostCount(param);
+        result.put("weekPostCount",weekPostCount);
+        result.put("weekReplyCount",weekReplyCount);
+        result.put("weekAvgPostCount",weekAvgPostCount);
+
+        return result;
+    }
+
+    /**
+     *  教学活动分析-课程讨论详情
+     */
+    @Override
+    public Page<Map<String,Object>> courseDiscussDetail(Map param)
+    {
+        return teachingActivityMapper.courseDiscussDetail(param, CommonPageRequest.defaultPage());
+    }
+
+    /**
+     *  教学活动分析-文档观看详细统计
+     */
+    @Override
+    public Page<Map<String,Object>> documentWatchDetailStatistic(Map param)
+    {
+        //为了考虑效率问题,改成不通过大sql一起查回,通过后台组装数据
+        //1.获取讲义相关基准信息,同时带上课程章节课时等信息
+        Page<Map<String,Object>> page=teachingActivityMapper.getHourTeachMaterialList(param, CommonPageRequest.defaultPage());
+        List<Map<String,Object>> hourTeachMaterialList=page.getRecords();
+        //获取课时id集合
+        List<String> hourIdList = hourTeachMaterialList.stream().map(map -> (String) map.get("hourId")).collect(Collectors.toList());
+        param.put("hourIdList",hourIdList);
+        //2.获取观看人数
+        List<Map<String,Object>> watchUserCountList=teachingActivityMapper.getWatchUserCountListDocWatch(param);
+        //3.获取完成人数
+        List<Map<String,Object>> completeUserCountList=teachingActivityMapper.getCompleteUserCountListDocWatch(param);
+        //4.获取完成率
+        List<Map<String,Object>> completeRateList=teachingActivityMapper.getCompleteRateListDocWatch(param);
+        //5.获取平均阅读时长
+        List<Map<String,Object>> readAvgTimeList=teachingActivityMapper.getReadAvgTimeListDocWatch(param);
+        //6.获取跳出率
+        List<Map<String,Object>> jumpOutRateList=teachingActivityMapper.getJumpOutRateListDocWatch(param);
+        //7.获取下载次数
+        List<Map<String,Object>> downloadCountList=teachingActivityMapper.getDownloadCountListDocWatch(param);
+
+        //数据匹配
+        //采取倒叙安全删除方法,提升效率
+        for (Map<String,Object> hourTeachMaterial : hourTeachMaterialList)
+        {
+            //匹配2.获取观看人数
+            for (int i = watchUserCountList.size() - 1; i >= 0; i--){
+                Map<String,Object> watchUserCount = watchUserCountList.get(i);
+                if (watchUserCount == null || watchUserCount.get("hourId") == null) continue;
+
+                if (hourTeachMaterial.get("hourId").equals(watchUserCount.get("hourId")))
+                {
+                    hourTeachMaterial.put("watchUserCount",watchUserCount.get("watchUserCount"));
+                    watchUserCountList.remove(i);          // 从原列表删除(安全操作)
+                }
+            }
+            //匹配3.获取完成人数
+            for (int i = completeUserCountList.size() - 1; i >= 0; i--)
+            {
+                Map<String,Object> completeUserCount = completeUserCountList.get(i);
+                if (completeUserCount == null || completeUserCount.get("hourId") == null) continue;
+                if (hourTeachMaterial.get("hourId").equals(completeUserCount.get("hourId")))
+                {
+                    hourTeachMaterial.put("completeUserCount",completeUserCount.get("completeUserCount"));
+                    completeUserCountList.remove(i);
+                }
+            }
+            //匹配4.获取完成率
+            for (int i = completeRateList.size() - 1; i >= 0; i--)
+            {
+                Map<String,Object> completeRate = completeRateList.get(i);
+                if (completeRate == null || completeRate.get("hourId") == null) continue;
+                if (hourTeachMaterial.get("hourId").equals(completeRate.get("hourId")))
+                {
+                    hourTeachMaterial.put("completeRate",completeRate.get("completeRate"));
+                    completeRateList.remove(i);
+                }
+            }
+            //匹配5.获取平均阅读时长
+            for (int i = readAvgTimeList.size() - 1; i >= 0; i--)
+            {
+                Map<String,Object> readAvgTime = readAvgTimeList.get(i);
+                if (readAvgTime == null || readAvgTime.get("hourId") == null) continue;
+                if (hourTeachMaterial.get("hourId").equals(readAvgTime.get("hourId")))
+                {
+                    hourTeachMaterial.put("readAvgTime",readAvgTime.get("readAvgTime"));
+                    readAvgTimeList.remove(i);
+                }
+            }
+            //匹配6.获取跳出率
+            for (int i = jumpOutRateList.size() - 1; i >= 0; i--)
+            {
+                Map<String,Object> jumpOutRate = jumpOutRateList.get(i);
+                if (jumpOutRate == null || jumpOutRate.get("hourId") == null) continue;
+                if (hourTeachMaterial.get("hourId").equals(jumpOutRate.get("hourId")))
+                {
+                    hourTeachMaterial.put("jumpOutRate",jumpOutRate.get("jumpOutRate"));
+                    jumpOutRateList.remove(i);
+                }
+            }
+            //匹配7.获取下载次数
+            for (int i = downloadCountList.size() - 1; i >= 0; i--)
+            {
+                Map<String,Object> downloadCount = downloadCountList.get(i);
+                if (downloadCount == null || downloadCount.get("hourId") == null) continue;
+                if (hourTeachMaterial.get("hourId").equals(downloadCount.get("hourId")))
+                {
+                    hourTeachMaterial.put("downloadCount",downloadCount.get("downloadCount"));
+                    downloadCountList.remove(i);
+                }
+            }
+
+        }
+
+        return page;
     }
 
 
@@ -70,4 +293,55 @@ public class TeachingActivityServiceImpl implements TeachingActivityService {
         map.put("endTime", endTime);
         return map;
     }
+
+    /**
+     *  获取指定30天
+     *  不传值默认查当前月
+     */
+    public static List<String> getLastThirtyDay(String baseStartDay,String baseEndDay) {
+        List<String> days = new ArrayList<>();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        Calendar calendar = Calendar.getInstance();
+
+        try {
+            String baseStartDayStr = "";
+            String baseEndDayStr = "";
+
+            // 解析起始日期
+            if (StringUtils.isNotEmpty(baseStartDay)) {
+                Date baseStartDayDate = sdf.parse(baseStartDay);
+                Calendar baseStartDayCalendar = Calendar.getInstance();
+                baseStartDayCalendar.setTime(baseStartDayDate);
+                baseStartDayStr = sdf.format(baseStartDayCalendar.getTime());
+            }
+
+            // 设置结束日期(默认为当前日期,如果指定了则使用指定的结束日期)
+            if (StringUtils.isNotEmpty(baseEndDay)) {
+                Date date = sdf.parse(baseEndDay);
+                calendar.setTime(date);
+            }
+            baseEndDayStr = sdf.format(calendar.getTime());
+            days.add(baseEndDayStr);
+
+            // 往前推30天
+            if (!baseEndDayStr.equals(baseStartDayStr)) {
+                for (int i = 1; i <= 30; i++) {
+                    Calendar temp = (Calendar) calendar.clone();
+                    temp.add(Calendar.DAY_OF_MONTH, -i); // 往前减i天
+                    String calculateDay = sdf.format(temp.getTime());
+                    days.add(calculateDay);
+
+                    // 如果设置了起始日期,到达起始日期时停止
+                    if (StringUtils.isNotEmpty(baseStartDay) && baseStartDayStr.equals(calculateDay)) {
+                        break;
+                    }
+                }
+            }
+
+        } catch (Exception e) {
+            throw new IllegalArgumentException("日期格式必须为'YYYY-MM-DD'", e);
+        }
+
+        return days;
+    }
 }

+ 4 - 0
snowy-plugin/snowy-plugin-forum/snowy-plugin-forum-func/src/main/java/vip/xiaonuo/forum/modular/postinfo/entity/ForumPostInfoVo.java

@@ -135,6 +135,10 @@ public class ForumPostInfoVo {
     @ApiModelProperty(value = "定向用户", position = 18)
     private String appointUser;
 
+    /** 定向用户id */
+    @ApiModelProperty(value = "定向用户id", position = 18)
+    private String appointUserId;
+
     /**
      * 回复列表
      */

+ 1 - 0
snowy-plugin/snowy-plugin-forum/snowy-plugin-forum-func/src/main/java/vip/xiaonuo/forum/modular/postinfo/param/ForumPostInfoAddParam.java

@@ -44,6 +44,7 @@ public class ForumPostInfoAddParam {
 
     /** 帖子标题 */
     @ApiModelProperty(value = "帖子标题", position = 4)
+    @NotBlank(message = "帖子标题不能为空")
     private String postTitle;
 
     /** 帖子内容 */

+ 5 - 5
snowy-plugin/snowy-plugin-forum/snowy-plugin-forum-func/src/main/java/vip/xiaonuo/forum/modular/postinfo/service/impl/ForumPostInfoServiceImpl.java

@@ -143,15 +143,14 @@ public class ForumPostInfoServiceImpl extends ServiceImpl<ForumPostInfoMapper, F
         // 排序方式 0最新 1热门 2点赞
         if (forumPostInfoPageParam.getSortOrder() != null) {
             if (forumPostInfoPageParam.getSortOrder() == 0) {
-                queryWrapper.lambda().orderByDesc(ForumPostInfo::getCreateTime);
+                queryWrapper.lambda().orderByDesc(ForumPostInfo::getIsTop).orderByDesc(ForumPostInfo::getCreateTime);
             } else if (forumPostInfoPageParam.getSortOrder() == 1) {
-                queryWrapper.lambda().orderByDesc(ForumPostInfo::getViewCount);
+                queryWrapper.lambda().orderByDesc(ForumPostInfo::getIsTop).orderByDesc(ForumPostInfo::getViewCount);
             } else if (forumPostInfoPageParam.getSortOrder() == 2) {
-                queryWrapper.lambda().orderByDesc(ForumPostInfo::getLikeCount);
+                queryWrapper.lambda().orderByDesc(ForumPostInfo::getIsTop).orderByDesc(ForumPostInfo::getLikeCount);
             }
         }
-        // 置顶的优先
-        queryWrapper.lambda().orderByDesc(ForumPostInfo::getIsTop);
+
         // 帖子状态 0正常
         queryWrapper.lambda().eq(ForumPostInfo::getPostStatus, 0);
         Page<ForumPostInfo> page = this.page(CommonPageRequest.defaultPage(), queryWrapper);
@@ -417,6 +416,7 @@ public class ForumPostInfoServiceImpl extends ServiceImpl<ForumPostInfoMapper, F
                 }
             }
             forumPostInfoVo.setAppointUser(sb.toString());
+            forumPostInfoVo.setAppointUserId(appointUser);
         }
         return forumPostInfoVo;
     }

+ 1 - 0
snowy-plugin/snowy-plugin-forum/snowy-plugin-forum-func/src/main/java/vip/xiaonuo/forum/modular/posttype/param/ForumPostTypeAddParam.java

@@ -33,6 +33,7 @@ public class ForumPostTypeAddParam {
 
     /** 分类名称 */
     @ApiModelProperty(value = "分类名称", position = 2)
+    @NotBlank(message = "分类名称不能为空")
     private String typeName;
 
     /** 分类描述 */

+ 1 - 0
snowy-plugin/snowy-plugin-forum/snowy-plugin-forum-func/src/main/java/vip/xiaonuo/forum/modular/posttype/param/ForumPostTypeEditParam.java

@@ -38,6 +38,7 @@ public class ForumPostTypeEditParam {
 
     /** 分类名称 */
     @ApiModelProperty(value = "分类名称", position = 2)
+    @NotBlank(message = "分类名称不能为空")
     private String typeName;
 
     /** 分类描述 */

+ 1 - 1
snowy-plugin/snowy-plugin-forum/snowy-plugin-forum-func/src/main/java/vip/xiaonuo/forum/modular/reportinfo/service/impl/ForumReportInfoServiceImpl.java

@@ -66,7 +66,7 @@ public class ForumReportInfoServiceImpl extends ServiceImpl<ForumReportInfoMappe
             queryWrapper.orderBy(true, forumReportInfoPageParam.getSortOrder().equals(CommonSortOrderEnum.ASC.getValue()),
                     StrUtil.toUnderlineCase(forumReportInfoPageParam.getSortField()));
         } else {
-            queryWrapper.lambda().orderByAsc(ForumReportInfo::getReportId);
+            queryWrapper.lambda().orderByDesc(ForumReportInfo::getCreateTime);
         }
         Page<ForumReportInfo> page = this.page(CommonPageRequest.defaultPage(), queryWrapper);
         if (page.getRecords().size() > 0) {

+ 2 - 3
snowy-plugin/snowy-plugin-sys/snowy-plugin-sys-func/src/main/java/vip/xiaonuo/sys/modular/user/result/SysUserMessageResult.java

@@ -55,8 +55,7 @@ public class SysUserMessageResult {
 
     /** 创建时间 */
     @ApiModelProperty(value = "创建时间", position = 7)
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private Date createTime;
+    private String createTime;
 
     /** 创建人 */
     @ApiModelProperty(value = "创建人", position = 8)
@@ -64,7 +63,7 @@ public class SysUserMessageResult {
 
     /** 更新时间 */
     @ApiModelProperty(value = "更新时间", position = 9)
-    private Date updateTime;
+    private String updateTime;
 
     /** 更新人 */
     @ApiModelProperty(value = "更新人", position = 10)

+ 35 - 2
snowy-plugin/snowy-plugin-sys/snowy-plugin-sys-func/src/main/java/vip/xiaonuo/sys/modular/user/service/impl/SysUserServiceImpl.java

@@ -114,6 +114,7 @@ import java.io.BufferedOutputStream;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -1837,9 +1838,41 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
 
     @Override
     public Page<SysUserMessageResult> loginMessagePage(SysUserMessagePageParam sysUserMessagePageParam) {
-        Page<SysUserMessageResult> resultPage = new Page<>();
         Page<JSONObject> devMessagePage = devMessageApi.page(CollectionUtil.newArrayList(StpUtil.getLoginIdAsString()), sysUserMessagePageParam.getCategory());
-        BeanUtil.copyProperties(devMessagePage, resultPage);
+
+        // 手动创建结果分页对象
+        Page<SysUserMessageResult> resultPage = new Page<>(devMessagePage.getCurrent(), devMessagePage.getSize(), devMessagePage.getTotal());
+        resultPage.setRecords(new ArrayList<>());
+
+        // 手动转换每条记录
+        for (JSONObject jsonObj : devMessagePage.getRecords()) {
+            SysUserMessageResult result = new SysUserMessageResult();
+
+            // 拷贝其他属性
+            BeanUtil.copyProperties(jsonObj, result);
+
+            // 特殊处理 createTime:确保转换为字符串格式
+            Object createTimeObj = jsonObj.get("createTime");
+            if (createTimeObj != null) {
+                if (createTimeObj instanceof Date) {
+                    // 如果是 Date 类型,格式化为字符串
+                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                    result.setCreateTime(sdf.format((Date) createTimeObj));
+                } else if (createTimeObj instanceof String) {
+                    // 如果已经是字符串,直接设置
+                    result.setCreateTime((String) createTimeObj);
+                } else if (createTimeObj instanceof Long) {
+                    // 如果是时间戳,转换为日期字符串
+                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                    result.setCreateTime(sdf.format(new Date((Long) createTimeObj)));
+                } else {
+                    // 其他情况,调用 toString()
+                    result.setCreateTime(createTimeObj.toString());
+                }
+            }
+
+            resultPage.getRecords().add(result);
+        }
         return resultPage;
     }