he2802 3 anni fa
parent
commit
b50adc3752

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CoursePhotoLogQueryBo.java

@@ -56,4 +56,7 @@ public class CoursePhotoLogQueryBo extends BaseEntity {
 	private Integer status;
 	private Integer goodsId;
 	private Integer gradeId;
+	private Long moduleId;
+	private Long chapterId;
+	private Integer currentStatus;
 }

+ 12 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CoursePhotoLogVo.java

@@ -60,4 +60,16 @@ public class CoursePhotoLogVo {
 	@Excel(name = "班级ID")
 	@ApiModelProperty("班级ID")
 	private Long gradeId;
+	/** 模块ID */
+	@Excel(name = "模块ID")
+	@ApiModelProperty("模块ID")
+	private Long moduleId;
+	/** 章ID */
+	@Excel(name = "章ID")
+	@ApiModelProperty("章ID")
+	private Long chapterId;
+	/** 当前状态 1 当前状态 0过往状态 */
+	@Excel(name = "当前状态 1 当前状态 0过往状态")
+	@ApiModelProperty("当前状态 1 当前状态 0过往状态")
+	private Integer currentStatus;
 }

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java

@@ -118,6 +118,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
         lqw.eq(bo.getSectionId() != null, UserStudyRecord::getSectionId, bo.getSectionId());
         lqw.eq(bo.getGoodsId() != null, UserStudyRecord::getGoodsId, bo.getGoodsId());
         lqw.eq(bo.getModuleId() != null, UserStudyRecord::getModuleId, bo.getModuleId());
+        lqw.eq(bo.getChapterId() != null, UserStudyRecord::getChapterId, bo.getChapterId());
         lqw.eq(bo.getGradeId() != null, UserStudyRecord::getGradeId, bo.getGradeId());
         UserStudyRecord last = this.getOne(lqw.ge(UserStudyRecord::getFirstStartTime,0).last("limit 1"));
         if(Validator.isEmpty(last)){

+ 8 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CoursePhotoLogMapper.xml

@@ -48,6 +48,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           AND goods_id = #{goodsId}
           AND grade_id = #{gradeId}
           AND section_id = #{sectionId}
+            and current_status =1
+        <if test="moduleId != null ">
+            and module_id = #{moduleId}
+        </if>
+
+        <if test="chapterId != null">
+            and chapter_id = #{chapterId}
+        </if>
     </select>
 
 </mapper>

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

@@ -272,7 +272,7 @@
         u.id_card_img2,
         (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.exam_id) FROM user_bank_record ubr LEFT JOIN class_grade_goods cgg on cgg.goods_id
+        (SELECT COUNT(DISTINCT 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.report_status =1 and ubr.user_id=#{userId} and cg.grade_id=cgg.grade_id ) as record_num,
         (SELECT COUNT(up.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.type = 1) as pass,