Browse Source

直播结束时间异常数据导致处理出错

tags/正式版本
雍文秀 2 years ago
parent
commit
bc8f9eb272

+ 1
- 1
sapi/src/main/resources/mapper/classreport/ClassReportMapper.xml View File

@@ -286,7 +286,7 @@
286 286
         ,(select count(*) from t_class c1 where c1.gradeid=c.gradeid and c1.year=c.year
287 287
         and c1.classstate=1 and c1.classtype=c.classtype and c1.schoolid=l.schoolid)classnum
288 288
         ,sum((unix_timestamp(concat(ls.sectiondate,' ',ifnull(ls.endtime,ls.planendtime)))
289
-        -unix_timestamp(concat(ls.sectiondate,' ',ls.begintime))))/60 minutenum
289
+        -unix_timestamp(concat(ls.sectiondate,' ',ifnull(ls.begintime,ls.planbegintime)))))/60 minutenum
290 290
         ,from_unixtime(ls.createtime,'%Y-%m-%d')begindate,count(distinct ls.sectionid)fbnum
291 291
         from l_course_section ls left join l_course l on l.courseid=ls.courseid
292 292
         left join l_course_class cs on l.courseid=cs.courseid

+ 4
- 2
slive/src/main/resources/mapper/liveplay/CourseSectionMapper.xml View File

@@ -178,7 +178,8 @@
178 178
     <!--课节报告-->
179 179
     <select id="getReport" resultMap="reportResult">
180 180
         select cs.sectionid,cs.sectionname,cs.sectiondate,cs.begintime,cs.endtime,cs.sectionstate,cs.stunum
181
-        ,(UNIX_TIMESTAMP(CONCAT(cs.sectiondate,' ',cs.planendtime))-UNIX_TIMESTAMP(CONCAT(cs.sectiondate,' ',cs.begintime)))totaltime
181
+        ,(UNIX_TIMESTAMP(CONCAT(cs.sectiondate,' ',cs.planendtime))-
182
+          UNIX_TIMESTAMP(CONCAT(cs.sectiondate,' ',ifnull(cs.begintime,cs.planbegintime))))totaltime
182 183
         ,c.classid,c1.classname,truncate(cs.stunum*100/c1.classnum,2)cqrate
183 184
         ,(select u.username from t_user u where u.userid=cs.teacherid)teachername
184 185
         ,(select count(*) from l_course_section_chatroom csc where csc.sectionid=cs.sectionid and csc.usertype=2)msgnum
@@ -220,7 +221,8 @@
220 221
         ,(select count(*) from l_course_section_chatroom c where c.sectionid=css2.sectionid and c.userid=css2.studentid)msgnum
221 222
         ,(select count(*) from l_course_section_playback_see s where s.sectionid=css2.sectionid and s.userid=css2.studentid)seenum
222 223
         from(select css.studentid,css.sectionid,css.tostamp,css.outstamp,css.totaltime,css.device
223
-        ,(UNIX_TIMESTAMP(CONCAT(cs.sectiondate,' ',cs.planendtime))-UNIX_TIMESTAMP(CONCAT(cs.sectiondate,' ',cs.begintime)))totaltime2
224
+        ,(UNIX_TIMESTAMP(CONCAT(cs.sectiondate,' ',cs.planendtime))-
225
+          UNIX_TIMESTAMP(CONCAT(cs.sectiondate,' ',ifnull(cs.begintime,cs.planbegintime))))totaltime2
224 226
         from l_course_section_student css
225 227
         left join l_course_section cs on css.sectionid=cs.sectionid
226 228
         where css.sectionid=#{section.sectionid})css2 left join t_user u on css2.studentid=u.userid

Loading…
Cancel
Save