he2802 3 anos atrás
pai
commit
c23a8f42cb

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodUserVo.java

@@ -118,4 +118,9 @@ public class ClassPeriodUserVo {
 
 	@ApiModelProperty("学时状态")
 	private Integer periodStatus;
+
+	@ApiModelProperty("节时长(秒)")
+	private Long studyStartTime;
+	@ApiModelProperty("节时长(秒)")
+	private Long studyEndTime;
 }

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/UserPeriodExportVo.java

@@ -50,4 +50,5 @@ public class UserPeriodExportVo {
 	@ApiModelProperty("测试成绩")
 	private BigDecimal score;
 
+
 }

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

@@ -117,6 +117,8 @@
         <result property="examCheat" column="exam_cheat"/>
         <result property="keyValue" column="key_value"/>
         <result property="periodStatus" column="period_status"/>
+        <result property="studyStartTime" column="study_start_time"/>
+        <result property="studyEndTime" column="study_end_time"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodVo" id="ClassPeriodVo">
@@ -441,6 +443,10 @@
         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,
         (SELECT up.key_value FROM user_profile up where up.goods_id = #{goodsId} and up.user_id =#{userId} and up.current_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,
+            (SELECT MAX(end_time) from user_study_record where user_id = #{userId} and grade_id = #{gradeId}) as study_end_time
+        </if>
         FROM
         class_grade_user cgu
         LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id