|
@@ -1,6 +1,7 @@
|
|
|
package com.ssj.dao.weixin.library.dao.impl;
|
|
|
|
|
|
|
|
|
+import com.ssj.api.domain.vo.homework.HomeworkListVO;
|
|
|
import com.ssj.bean.weixin.libmy.domain.TbLibJoin;
|
|
|
import com.ssj.bean.weixin.libmy.domain.TbLibManager;
|
|
|
import com.ssj.bean.weixin.libmy.domain.TbLibSubscribe;
|
|
@@ -1294,7 +1295,7 @@ public class LibJoinQueryDaoImpl implements ILibJoinQueryDao{
|
|
|
StringBuilder selSQL = new StringBuilder();
|
|
|
List<Object> queryParams = new ArrayList<Object>();
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
- selSQL.append("select count(if(is_online=1,true,null)) AS onlineNums,count(if(is_online=0,true,null)) AS offlineNums from tb_lib_manager where type=30 and state= 1 ");
|
|
|
+ selSQL.append("select count(if(is_online=1,true,null)) AS online_nums,count(if(is_online=0,true,null)) AS offline_nums from tb_lib_manager where type=30 and state= 1 ");
|
|
|
List<Map<String, Object>> mapList= dao.findMap(selSQL.toString(), queryParams.toArray());
|
|
|
if(mapList != null && mapList.size()>0){
|
|
|
map = mapList.get(0);
|
|
@@ -1303,22 +1304,22 @@ public class LibJoinQueryDaoImpl implements ILibJoinQueryDao{
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Page<Map<String, Object>> findTeacherHomeworkList(Map<String, Object> params, Pageable initPage) {
|
|
|
+ public Page<HomeworkListVO> findTeacherHomeworkList(Map<String, Object> params, Pageable initPage) {
|
|
|
StringBuilder selSQL = new StringBuilder();
|
|
|
List<Object> queryParams = new ArrayList<Object>();
|
|
|
selSQL.append("SELECT * from ( SELECT \n");
|
|
|
- selSQL.append("(SELECT count(DISTINCT a.homework_id) from scon_homework_picture a where a.teacher_id = t.user_id and a.is_mark in (0,2) and a.is_feedback = 0) as waitNums, \n");
|
|
|
- selSQL.append("(SELECT concat(SEC_TO_TIME(TIMESTAMPDIFF(SECOND,min(a.allot_time),NOW())),'') from scon_homework_picture a where a.teacher_id = t.user_id and a.is_mark in (0,2) and a.is_feedback = 0) as waitMaxTime, \n");
|
|
|
- selSQL.append("t.user_id as teacherId,t.name as teacherName, \n");
|
|
|
- selSQL.append("(select concat(SEC_TO_TIME(sum(a.correction_time)),'') from scon_homework_picture a where a.teacher_id = t.user_id and a.is_mark in (0,2) and a.is_feedback=1 and t.create_time > ?) as todayCorrectTime, \n");
|
|
|
+ selSQL.append("(SELECT count(DISTINCT a.homework_id) from scon_homework_picture a where a.teacher_id = t.user_id and a.is_mark in (0,2) and a.is_feedback = 0) as wait_nums, \n");
|
|
|
+ selSQL.append("(SELECT ifnull(concat(SEC_TO_TIME(TIMESTAMPDIFF(SECOND,min(a.allot_time),NOW())),''),0) from scon_homework_picture a where a.teacher_id = t.user_id and a.is_mark in (0,2) and a.is_feedback = 0) as wait_max_time, \n");
|
|
|
+ selSQL.append("t.user_id as teacher_id,t.name as teacher_name, \n");
|
|
|
+ selSQL.append("(select ifnull(concat(SEC_TO_TIME(sum(a.correction_time)),''),0) from scon_homework_picture a where a.teacher_id = t.user_id and a.is_mark in (0,2) and a.is_feedback=1 and t.create_time > ?) as today_correct_time, \n");
|
|
|
queryParams.add(params.get("beginTime"));
|
|
|
- selSQL.append("(select concat(SEC_TO_TIME(floor(sum(TIMESTAMPDIFF(SECOND,a.allot_time,b.start_time))/count(1))),'') from scon_homework_picture a join scon_homework_picture_correct b on a.id = b.homework_picture_id and b.type=8 where a.teacher_id = t.user_id and a.is_mark in (0,2) and a.is_feedback=1 and t.create_time > ?) as efficiency, \n");
|
|
|
+ selSQL.append("(select ifnull(concat(SEC_TO_TIME(floor(sum(TIMESTAMPDIFF(SECOND,a.allot_time,b.start_time))/count(1))),''),0) from scon_homework_picture a join scon_homework_picture_correct b on a.id = b.homework_picture_id and b.type=8 where a.teacher_id = t.user_id and a.is_mark in (0,2) and a.is_feedback=1 and t.create_time > ?) as efficiency, \n");
|
|
|
queryParams.add(params.get("beginTime"));
|
|
|
selSQL.append("t.is_online as state \n");
|
|
|
selSQL.append("from tb_lib_manager t \n");
|
|
|
selSQL.append("where t.type=30 \n");
|
|
|
- selSQL.append(") a order by a.state desc,a.waitNums desc \n");
|
|
|
- return dao.findPage(selSQL.toString(), queryParams.toArray(),initPage);
|
|
|
+ selSQL.append(") a order by a.state desc,a.wait_nums desc \n");
|
|
|
+ return dao.findPage(selSQL.toString(), queryParams.toArray(),initPage,HomeworkListVO.class);
|
|
|
}
|
|
|
|
|
|
|