瀏覽代碼

fix 学时模块卷

he2802 3 年之前
父節點
當前提交
937a09cfa6

+ 16 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CommonController.java

@@ -8,6 +8,10 @@ import com.zhongzheng.common.core.domain.model.LoginBody;
 import com.zhongzheng.common.utils.file.FileUploadUtils;
 import com.zhongzheng.common.utils.file.FileUtils;
 import com.zhongzheng.framework.config.ServerConfig;
+import com.zhongzheng.modules.course.vo.CourseMenuVo;
+import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
+import com.zhongzheng.modules.goods.service.IGoodsService;
+import com.zhongzheng.modules.goods.vo.GoodsJzsVo;
 import com.zhongzheng.modules.order.bo.OrderAddBo;
 import com.zhongzheng.modules.system.service.ISysUserService;
 import io.swagger.annotations.ApiOperation;
@@ -23,6 +27,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.util.List;
 
 /**
  * 通用请求处理
@@ -37,6 +42,8 @@ public class CommonController
     @Autowired
     private ServerConfig serverConfig;
 
+    @Autowired
+    private IGoodsService iGoodsService;
 
     /**
      * 通用下载请求
@@ -123,4 +130,13 @@ public class CommonController
             log.error("下载文件失败", e);
         }
     }
+
+    @ApiOperation("获取继教二建的商品结构列表")
+    @GetMapping("common/jzs/goodsList")
+    public AjaxResult<List<GoodsJzsVo>> goodsList()
+    {
+        GoodsQueryBo queryBo = new GoodsQueryBo();
+        List<GoodsJzsVo> goodsJzsVoList = iGoodsService.selectRjJzsList(queryBo);
+        return AjaxResult.success(goodsJzsVoList);
+    }
 }

+ 1 - 1
zhongzheng-admin/src/main/resources/application-dev.yml

@@ -6,7 +6,7 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://192.168.1.222:3306/zz_edu_saas?rewriteBatchedStatements=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
+                url: jdbc:mysql://192.168.1.222:3306/zz_edu_saas_pre?rewriteBatchedStatements=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
                 username: root
                 password:  zhongzheng2021
             # 从库数据源

+ 1 - 0
zhongzheng-framework/src/main/java/com/zhongzheng/framework/config/SecurityConfig.java

@@ -123,6 +123,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 .antMatchers("/refreshToken/**").anonymous()
                 .antMatchers("/v1/test/**").anonymous()
                 .antMatchers("/profile/**").anonymous()
+                .antMatchers("/common/jzs/goodsList").anonymous()
                 .antMatchers("/common/download**").anonymous()
                 .antMatchers("/common/download/resource**").anonymous()
                 .antMatchers("/swagger-ui.html").anonymous()

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

@@ -7,6 +7,7 @@ import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
 import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
 import com.zhongzheng.modules.goods.bo.*;
 import com.zhongzheng.modules.goods.domain.Goods;
+import com.zhongzheng.modules.goods.vo.GoodsJzsVo;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
 
 import java.util.Collection;
@@ -81,4 +82,6 @@ public interface IGoodsService extends IService<Goods> {
 	int queryUpGoods();
 
 	List<CourseModuleFreeExamVo> moduleFreeExamList(Long goodsId);
+
+	List<GoodsJzsVo> selectRjJzsList(GoodsQueryBo bo);
 }

+ 74 - 6
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -14,12 +14,9 @@ import com.zhongzheng.modules.course.bo.CourseMenuAddBo;
 import com.zhongzheng.modules.course.bo.CourseMenuListAddBo;
 import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
 import com.zhongzheng.modules.course.bo.CourseQueryBo;
-import com.zhongzheng.modules.course.domain.CourseSectionWatchPer;
+import com.zhongzheng.modules.course.domain.*;
 import com.zhongzheng.modules.course.mapper.CourseMapper;
-import com.zhongzheng.modules.course.service.ICourseChapterSectionService;
-import com.zhongzheng.modules.course.service.ICourseMenuService;
-import com.zhongzheng.modules.course.service.ICourseModuleChapterService;
-import com.zhongzheng.modules.course.service.ICourseSectionWatchPerService;
+import com.zhongzheng.modules.course.service.*;
 import com.zhongzheng.modules.course.vo.*;
 import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
 import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
@@ -90,6 +87,18 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
     @Autowired
     private ICourseSectionWatchPerService iCourseSectionWatchPerService;
 
+    @Autowired
+    private ICourseEducationTypeService iCourseEducationTypeService;
+
+    @Autowired
+    private ICourseProjectTypeService iCourseProjectTypeService;
+
+    @Autowired
+    private ICourseBusinessService iCourseBusinessService;
+
+    @Autowired
+    private  ICourseSubjectService iCourseSubjectService;
+
     @Override
     public GoodsVo queryById(Long goodsId){
         Goods db = this.baseMapper.selectById(goodsId);
@@ -204,7 +213,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         lqw.like(StrUtil.isNotBlank(bo.getGoodsName()), Goods::getGoodsName, bo.getGoodsName());
         lqw.eq(bo.getStandPrice() != null, Goods::getStandPrice, bo.getStandPrice());
         lqw.eq(bo.getLowestPrice() != null, Goods::getLowestPrice, bo.getLowestPrice());
-        lqw.eq(bo.getStatus() != null, Goods::getStatus, bo.getStatus());
+        lqw.in(bo.getStatus() != null, Goods::getStatus, bo.getStatus());
         lqw.eq(bo.getValidityStartTime() != null, Goods::getValidityStartTime, bo.getValidityStartTime());
         lqw.eq(bo.getValidityEndTime() != null, Goods::getValidityEndTime, bo.getValidityEndTime());
         lqw.eq(bo.getStudyStartTime() != null, Goods::getStudyStartTime, bo.getStudyStartTime());
@@ -599,4 +608,63 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         return moduleExamList;
     }
 
+    @Override
+    public List<GoodsJzsVo> selectRjJzsList(GoodsQueryBo bo) {
+        CourseEducationType educationType = iCourseEducationTypeService.getOne(new LambdaQueryWrapper<CourseEducationType>().eq(CourseEducationType::getStatus, 1).eq(CourseEducationType::getEducationName,"继续教育").last("limit 1"));
+        CourseProjectType projectType = iCourseProjectTypeService.getOne(new LambdaQueryWrapper<CourseProjectType>().eq(CourseProjectType::getStatus, 1).eq(CourseProjectType::getEducationId,educationType.getId()).eq(CourseProjectType::getProjectName,"建造师").last("limit 1"));
+        CourseBusiness business = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getStatus, 1).eq(CourseBusiness::getProjectId,projectType.getId()).eq(CourseBusiness::getBusinessName,"二级").last("limit 1"));
+        GoodsQueryBo goodsQueryBo = new GoodsQueryBo();
+        goodsQueryBo.setEducationTypeId(educationType.getId());
+        goodsQueryBo.setBusinessId(business.getId());
+        goodsQueryBo.setGoodsStatus(1);
+        goodsQueryBo.setStatus(new ArrayList<Integer>(Arrays.asList(1)));
+        List<GoodsVo> goodsVoList = queryList(goodsQueryBo);
+        List<GoodsJzsVo> jzsVoList = new ArrayList<>();
+        for(GoodsVo goodsVo : goodsVoList){
+            GoodsJzsVo jzsVo = new GoodsJzsVo();
+            jzsVo.setGoodsId(goodsVo.getGoodsId());
+            jzsVo.setGoodsName(goodsVo.getGoodsName());
+            CourseSubject courseSubject = iCourseSubjectService.getOne(new LambdaQueryWrapper<CourseSubject>().eq(CourseSubject::getId, goodsVo.getSubjectIds()).last("limit 1"));
+            if(Validator.isNotEmpty(courseSubject)){
+                jzsVo.setSubjectName(courseSubject.getSubjectName());
+            }
+            List<GoodsJzsChapterVo> jzsChapterVoList = new ArrayList<>();
+            GoodsCourseQueryBo goodsCourseQueryBo = new GoodsCourseQueryBo();
+            goodsCourseQueryBo.setGoodsId(goodsVo.getGoodsId());
+            List<CourseVo> courseVoList = iGoodsCourseService.selectList(goodsCourseQueryBo);
+            for(CourseVo courseVo : courseVoList){
+                CourseMenuQueryBo menuQueryBo = new CourseMenuQueryBo();
+                menuQueryBo.setCourseId(courseVo.getCourseId());
+                List<CourseMenuVo> courseMenuVoList = iCourseMenuService.selectList(menuQueryBo);
+                courseMenuVoList.forEach(courseMenuVo -> {
+                    if(courseMenuVo.getType()==1){
+                        //获取章信息
+                        List<CourseModuleChapterVo> courseModuleChapterVoList = iCourseModuleChapterService.getListById(courseMenuVo.getMenuId());
+                        courseModuleChapterVoList.forEach(courseModuleChapterVo -> {
+                            //获取节信息
+                            List<CourseChapterSectionVo> courseChapterSectionVoList = iCourseChapterSectionService.getListById(courseModuleChapterVo.getChapterId());
+                            GoodsJzsChapterVo jzsChapterVo = new GoodsJzsChapterVo();
+                            jzsChapterVo.setChapterId(courseModuleChapterVo.getChapterId());
+                            jzsChapterVo.setChapterName(courseModuleChapterVo.getName());
+                            List<GoodsJzsSectionVo> sectionList = new ArrayList<>();
+                            courseChapterSectionVoList.forEach(sectionVo -> {
+                                GoodsJzsSectionVo sectionItem = new GoodsJzsSectionVo();
+                                sectionItem.setSectionId(sectionVo.getSectionId());
+                                sectionItem.setSectionName(sectionVo.getName());
+                                sectionItem.setSectionUrl(sectionVo.getRecordingUrl());
+                                sectionList.add(sectionItem);
+
+                            });
+                            jzsChapterVo.setSectionList(sectionList);
+                            jzsChapterVoList.add(jzsChapterVo);
+                        });
+                    }
+                });
+            }
+            jzsVo.setChapterList(jzsChapterVoList);
+            jzsVoList.add(jzsVo);
+        }
+        return jzsVoList;
+    }
+
 }

+ 29 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsJzsChapterVo.java

@@ -0,0 +1,29 @@
+package com.zhongzheng.modules.goods.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+@ApiModel("建造师商品章视图对象")
+public class GoodsJzsChapterVo {
+
+    private static final long serialVersionUID = 1L;
+
+    /** 章ID */
+    @Excel(name = "章ID")
+    @ApiModelProperty("章ID")
+    private Long chapterId;
+
+    /** 章名称 */
+    @Excel(name = "章名称")
+    @ApiModelProperty("章名称")
+    private String chapterName;
+
+
+    @ApiModelProperty("节列表")
+    private List<GoodsJzsSectionVo> sectionList;
+}

+ 27 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsJzsSectionVo.java

@@ -0,0 +1,27 @@
+package com.zhongzheng.modules.goods.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel("建造师商品节视图对象")
+public class GoodsJzsSectionVo {
+
+    private static final long serialVersionUID = 1L;
+
+
+    @Excel(name = "节id")
+    @ApiModelProperty("节id")
+    private Long sectionId;
+
+    /** 节名称 */
+    @Excel(name = "节名称")
+    @ApiModelProperty("节名称")
+    private String sectionName;
+
+    @Excel(name = "节视频地址")
+    @ApiModelProperty("节视频地址")
+    private String sectionUrl;
+}

+ 30 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsJzsVo.java

@@ -0,0 +1,30 @@
+package com.zhongzheng.modules.goods.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+@ApiModel("商品视图对象")
+public class GoodsJzsVo {
+
+    private static final long serialVersionUID = 1L;
+
+
+    @ApiModelProperty("商品ID")
+    private Long goodsId;
+
+    /** 商品名称 */
+    @Excel(name = "商品名称")
+    @ApiModelProperty("商品名称")
+    private String goodsName;
+
+    @ApiModelProperty("科目名称")
+    private String subjectName;
+
+    @ApiModelProperty("章列表")
+    private List<GoodsJzsChapterVo> chapterList;
+}

+ 7 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserBankRecordServiceImpl.java

@@ -179,7 +179,7 @@ public class UserBankRecordServiceImpl extends ServiceImpl<UserBankRecordMapper,
     private void updateExam(UserBankRecordVo userBankRecordVo,UserBankRecord add) {
         //试卷及格绑定成绩和记录做题,待审,通过不记录
 
-        if(userBankRecordVo.getType()==1){ //章卷才进来
+        if(userBankRecordVo.getType()==1||userBankRecordVo.getType()==3){ //章卷 模块卷才进来
             if (userStudyRecordMapper.selectStudyExamRecord(userBankRecordVo)  < 1 && Validator.isNotEmpty(add.getReportStatus())&& add.getReportStatus().equals(1)){
                 //增加一条审核记录
                 UserPeriod userPeriod = new UserPeriod();
@@ -187,7 +187,12 @@ public class UserBankRecordServiceImpl extends ServiceImpl<UserBankRecordMapper,
                 userPeriod.setCourseId(userBankRecordVo.getCourseId());
                 userPeriod.setExamId(userBankRecordVo.getExamId());
                 userPeriod.setGoodsId(userBankRecordVo.getGoodsId());
-                userPeriod.setType(2);
+                if(userBankRecordVo.getType()==1){
+                    userPeriod.setType(2);
+                }
+                else if(userBankRecordVo.getType()==3){
+                    userPeriod.setType(3);
+                }
                 userPeriod.setCreateTime(DateUtils.getNowTime());
                 userPeriod.setUpdateTime(DateUtils.getNowTime());
                 userPeriod.setModuleId(userBankRecordVo.getModuleId());

+ 2 - 2
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeMapper.xml

@@ -395,8 +395,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         cg.interface_push_id,
         cgu.official_status,
         cgu.learn_status,
-        (SELECT COUNT(m.id) FROM course_menu_exam m LEFT JOIN goods_course c on m.course_id=c.course_id LEFT JOIN class_grade_goods cgg on cgg.goods_id = c.goods_id where cg.grade_id=cgg.grade_id and m.type = 1 ) as exam_num,
-        (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr LEFT JOIN class_grade_goods cgg on cgg.goods_id = ubr.goods_id where ubr.`status`=1 and ubr.user_id = u.user_id and ubr.grade_id = cgu.grade_id and ubr.report_status=1 and ubr.current_status = 1) as record_num,
+        (SELECT COUNT(m.id) FROM course_menu_exam m LEFT JOIN goods_course c on m.course_id=c.course_id LEFT JOIN class_grade_goods cgg on cgg.goods_id = c.goods_id where cg.grade_id=cgg.grade_id and m.type = in (1,3) ) as exam_num,
+        (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr LEFT JOIN class_grade_goods cgg on cgg.goods_id = ubr.goods_id where ubr.`status`=1 and ubr.type = in (1,3) and  ubr.user_id = u.user_id and ubr.grade_id = cgu.grade_id and ubr.report_status=1 and ubr.current_status = 1) as record_num,
         (og.study_count) as study_count,
         og.order_goods_id,
         og.rebuy_order_goods_id,

+ 9 - 9
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -340,7 +340,7 @@
         cgu.period_time as end_time,
         (SELECT og.service_start_time FROM order_goods og  where og.order_goods_id = cgu.order_goods_id ) as service_start_time,
         (SELECT og.service_end_time FROM order_goods og  where og.order_goods_id = cgu.order_goods_id ) as service_end_time,
-        (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr  where ubr.`status`=1 and ubr.`type` in (1) and ubr.report_status=1 and ubr.grade_id = cgu.grade_id and ubr.user_id = cgu.user_id and ubr.current_status = 1) as record_num
+        (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr  where ubr.`status`=1 and ubr.`type` in (1,3) and ubr.report_status=1 and ubr.grade_id = cgu.grade_id and ubr.user_id = cgu.user_id and ubr.current_status = 1) as record_num
         <if test="userPhoto == null">
             ,(select COUNT(up.id) from user_period up LEFT JOIN user_period_status ups on up.id=ups.period_id where up.goods_id = (SELECT cgg.goods_id FROM class_grade_goods cgg where cg.grade_id=cgg.grade_id) and up.grade_id = cgu.grade_id and up.user_id = u.user_id
             and ups.period_status=0 and ups.`status`=0 and (SELECT COUNT(upss.id) from user_period_status upss where upss.id = ups.id and upss.period_status = 1 and upss.`status` = 2) > 0 ) as rebuild_num
@@ -360,7 +360,7 @@
         course_menu_exam m
         LEFT JOIN goods_course c ON m.course_id = c.course_id
         where
-        m.type in (1)
+        m.type in (1,3)
         GROUP BY c.goods_id ) ge on cgg.goods_id = ge.goods_id
         where 1=1
         and cgu.`status` =1
@@ -590,8 +590,8 @@
         u.id_card_img2,
         cgu.period_status,
         (SELECT COUNT(m.id) FROM course_menu_exam m LEFT JOIN goods_course c on m.course_id=c.course_id LEFT JOIN
-        class_grade_goods cgg on cgg.goods_id = c.goods_id where cg.grade_id=cgg.grade_id and m.type = 1 ) as exam_num,
-        (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id, ubr.exam_id) FROM user_bank_record ubr  where ubr.`status` = 1 and ubr.`type` in (1) and ubr.report_status =1 and ubr.user_id=#{userId} and ubr.grade_id=cgu.grade_id and ubr.current_status=1) as record_num,
+        class_grade_goods cgg on cgg.goods_id = c.goods_id where cg.grade_id=cgg.grade_id and m.type in (1,3) ) as exam_num,
+        (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id, ubr.exam_id) FROM user_bank_record ubr  where ubr.`status` = 1 and ubr.`type` in (1,3) and ubr.report_status =1 and ubr.user_id=#{userId} and ubr.grade_id=cgu.grade_id and ubr.current_status=1) as record_num,
         (SELECT COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.section_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where
         ups.`status` =1 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.user_id = #{userId} and up.grade_id = cgu.grade_id and up.type = 1) as pass,
         (SELECT COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.section_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where
@@ -600,13 +600,13 @@
         COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.section_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where ups.`status`
         =0 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and  up.user_id = #{userId} and up.type = 1) as cheat,
         (SELECT COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.section_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where
-        ups.`status` =1 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.user_id = #{userId} and up.grade_id = cg.grade_id and up.type = 2) as exam_pass,
+        ups.`status` =1 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.user_id = #{userId} and up.grade_id = cg.grade_id and up.type in (2,3)) as exam_pass,
         (SELECT
         COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.section_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where ups.`status`
-        =0 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and up.user_id = #{userId} and up.type = 2) as exam_cheat,
+        =0 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and up.user_id = #{userId} and up.type = in (2,3)) as exam_cheat,
         (SELECT
         COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.section_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where ups.`status`
-        =2 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and up.user_id = #{userId} and up.type = 2) as exam_pending,
+        =2 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and up.user_id = #{userId} and up.type = in (2,3)) as exam_pending,
         (SELECT up.key_value FROM user_profile up where up.goods_id = #{goodsId} and up.user_id =#{userId} and up.order_goods_id = cgu.order_goods_id and up.current_status = 1 and up.`status` = 1 and up.type_status =1 LIMIT 1) as key_value
         <if test="userId != null and userId !='' ">
             ,(SELECT MIN(first_start_time) from user_study_record where user_id = #{userId} and grade_id = #{gradeId}) as study_start_time,
@@ -1154,7 +1154,7 @@
                 LEFT JOIN goods_course gc ON gc.course_id = m.course_id
         WHERE
             gc.goods_id = #{goodsId}
-          AND m.type IN ( 1 ) UNION
+          AND m.type =  1  UNION
         SELECT
             cc.chapter_id,
             cc.`name`
@@ -1164,7 +1164,7 @@
                 LEFT JOIN goods_course gc ON gc.course_id = m.course_id
         WHERE
             gc.goods_id = #{goodsId}
-          AND m.type IN ( 2 )
+          AND m.type =  2
     </select>
 
     <select id="selectOfficialInfoCount" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo" resultType="long">

+ 18 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordMapper.xml

@@ -760,6 +760,12 @@
                 AND up.exam_id = 0
             </otherwise>
         </choose>
+        <if test="type != null and type == 1">
+            and up.type = 2
+        </if>
+        <if test="type != null and type == 3">
+            and up.type = 3
+        </if>
         AND up.user_id = #{userId}
     </select>
 
@@ -1052,6 +1058,12 @@
                 AND up.exam_id = 0
             </otherwise>
         </choose>
+        <if test="type != null and type == 1">
+            and up.type = 2
+        </if>
+        <if test="type != null and type == 3">
+            and up.type = 3
+        </if>
         AND up.user_id = #{userId}
     </select>
 
@@ -1120,6 +1132,12 @@
                 AND up.exam_id = 0
             </otherwise>
         </choose>
+        <if test="type != null and type == 1">
+            and up.type = 2
+        </if>
+        <if test="type != null and type == 3">
+            and up.type = 3
+        </if>
         AND up.user_id = #{userId}
         AND ups.period_status = 1
     </select>