wangliang 4 years ago
parent
commit
16eba03d7a

+ 11 - 0
themis-business/src/main/java/com/qmth/themis/business/dto/response/TEExamDto.java

@@ -39,9 +39,20 @@ public class TEExamDto implements Serializable {
     @ApiModelProperty(name = "真实时间")
     private Integer reallyTime;
 
+    @ApiModelProperty(name = "时间总和")
+    private Integer diffSum;
+
     @ApiModelProperty(name = "考试场次集合")
     private List<TEExamActivityDto> activities;
 
+    public Integer getDiffSum() {
+        return diffSum;
+    }
+
+    public void setDiffSum(Integer diffSum) {
+        this.diffSum = diffSum;
+    }
+
     public List<TEExamActivityDto> getActivities() {
         return activities;
     }

+ 5 - 3
themis-business/src/main/resources/mapper/TEExamMapper.xml

@@ -112,7 +112,9 @@
         (
             select
             distinct tee.id, teea.id as examActivityId,tee.name, tee.mode, tee.pre_notice as preNotice, tee.pre_notice_stay_seconds as
-            preNoticeStaySeconds, tee.post_notice as postNotice, datediff(now(), teea.start_time) as reallyTime
+            preNoticeStaySeconds, tee.post_notice as postNotice,
+            datediff(teea.finish_time,teea.start_time) as diffSum,
+            datediff(teea.finish_time,teea.start_time) - datediff(now(),teea.start_time) as reallyTime
         from
         t_e_exam_student tees
         left join t_e_exam tee on
@@ -137,8 +139,8 @@
         </where>
             ) t
         <where>
-            t.reallyTime <![CDATA[ >= ]]> -15
-            and t.reallyTime <![CDATA[ <= ]]> 0
+            t.reallyTime <![CDATA[ <= ]]> diffSum + 15
+            and t.reallyTime <![CDATA[ >= ]]> 0
         </where>
     </select>