|
@@ -1306,10 +1306,16 @@ public class LibJoinQueryDaoImpl implements ILibJoinQueryDao{
|
|
|
public Page<Map<String, Object>> findTeacherHomeworkList(Map<String, Object> params, Pageable initPage) {
|
|
|
StringBuilder selSQL = new StringBuilder();
|
|
|
List<Object> queryParams = new ArrayList<Object>();
|
|
|
- selSQL.append("select * from tb_lib_manager where type=30 and state= 1 ");
|
|
|
- selSQL.append(" ");
|
|
|
- selSQL.append(" ");
|
|
|
- selSQL.append(" ");
|
|
|
+ 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) as todayCorrectTime, \n");
|
|
|
+ selSQL.append("(select concat(SEC_TO_TIME(floor(sum(a.correction_time)/count(1))),'') from scon_homework_picture a where a.teacher_id = t.user_id and a.is_mark in (0,2) and a.is_feedback=1) as efficiency, \n");
|
|
|
+ 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);
|
|
|
}
|
|
|
|