Browse Source

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

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

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

286
         ,(select count(*) from t_class c1 where c1.gradeid=c.gradeid and c1.year=c.year
286
         ,(select count(*) from t_class c1 where c1.gradeid=c.gradeid and c1.year=c.year
287
         and c1.classstate=1 and c1.classtype=c.classtype and c1.schoolid=l.schoolid)classnum
287
         and c1.classstate=1 and c1.classtype=c.classtype and c1.schoolid=l.schoolid)classnum
288
         ,sum((unix_timestamp(concat(ls.sectiondate,' ',ifnull(ls.endtime,ls.planendtime)))
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
         ,from_unixtime(ls.createtime,'%Y-%m-%d')begindate,count(distinct ls.sectionid)fbnum
290
         ,from_unixtime(ls.createtime,'%Y-%m-%d')begindate,count(distinct ls.sectionid)fbnum
291
         from l_course_section ls left join l_course l on l.courseid=ls.courseid
291
         from l_course_section ls left join l_course l on l.courseid=ls.courseid
292
         left join l_course_class cs on l.courseid=cs.courseid
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
     <!--课节报告-->
178
     <!--课节报告-->
179
     <select id="getReport" resultMap="reportResult">
179
     <select id="getReport" resultMap="reportResult">
180
         select cs.sectionid,cs.sectionname,cs.sectiondate,cs.begintime,cs.endtime,cs.sectionstate,cs.stunum
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
         ,c.classid,c1.classname,truncate(cs.stunum*100/c1.classnum,2)cqrate
183
         ,c.classid,c1.classname,truncate(cs.stunum*100/c1.classnum,2)cqrate
183
         ,(select u.username from t_user u where u.userid=cs.teacherid)teachername
184
         ,(select u.username from t_user u where u.userid=cs.teacherid)teachername
184
         ,(select count(*) from l_course_section_chatroom csc where csc.sectionid=cs.sectionid and csc.usertype=2)msgnum
185
         ,(select count(*) from l_course_section_chatroom csc where csc.sectionid=cs.sectionid and csc.usertype=2)msgnum
220
         ,(select count(*) from l_course_section_chatroom c where c.sectionid=css2.sectionid and c.userid=css2.studentid)msgnum
221
         ,(select count(*) from l_course_section_chatroom c where c.sectionid=css2.sectionid and c.userid=css2.studentid)msgnum
221
         ,(select count(*) from l_course_section_playback_see s where s.sectionid=css2.sectionid and s.userid=css2.studentid)seenum
222
         ,(select count(*) from l_course_section_playback_see s where s.sectionid=css2.sectionid and s.userid=css2.studentid)seenum
222
         from(select css.studentid,css.sectionid,css.tostamp,css.outstamp,css.totaltime,css.device
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
         from l_course_section_student css
226
         from l_course_section_student css
225
         left join l_course_section cs on css.sectionid=cs.sectionid
227
         left join l_course_section cs on css.sectionid=cs.sectionid
226
         where css.sectionid=#{section.sectionid})css2 left join t_user u on css2.studentid=u.userid
228
         where css.sectionid=#{section.sectionid})css2 left join t_user u on css2.studentid=u.userid

Loading…
Cancel
Save