浏览代码

考情监考-大屏报表时间趋势修改

wangliang 2 年之前
父节点
当前提交
b97234a287
共有 1 个文件被更改,包括 8 次插入2 次删除
  1. 8 2
      themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

+ 8 - 2
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -1623,7 +1623,11 @@
     </sql>
 
     <select id="getTimeOnlineData" resultType="com.qmth.themis.business.bean.result.TimeOnlineDataResult">
-        select t.* from
+        select
+            t.hour,
+            sum(t.onlineCount) as onlineCount,
+            sum(t.offlineCount) as offlineCount
+        from
         (
         select
         DATE_FORMAT(FROM_UNIXTIME(teesol.create_time / 1000), '%H:%i') as hour,
@@ -1655,6 +1659,8 @@
         </if>
         and (teesol.create_time <![CDATA[ >= ]]> unix_timestamp(date_sub(#{currentDate}, interval #{scaleSize} minute)) * 1000
         and teesol.create_time <![CDATA[ <= ]]> unix_timestamp(#{currentDate}) * 1000)
-        and teesol.`type` = 'OFF_LINE' group by teesol.create_time) t order by t.hour;
+        and teesol.`type` = 'OFF_LINE' group by teesol.create_time) t
+        group by t.hour
+        order by t.hour
     </select>
 </mapper>