|
@@ -316,20 +316,20 @@ public class HomeworkQueryDaoImpl implements HomeworkQueryDao {
|
|
selSQL.append("else '作业已超时' end state_msg,b.state \n");
|
|
selSQL.append("else '作业已超时' end state_msg,b.state \n");
|
|
selSQL.append("from (\n");
|
|
selSQL.append("from (\n");
|
|
selSQL.append("SELECT a.homework_id,a.student_name,a.`subject`,a.grade,a.correctNums,a.totalNums, \n");
|
|
selSQL.append("SELECT a.homework_id,a.student_name,a.`subject`,a.grade,a.correctNums,a.totalNums, \n");
|
|
- selSQL.append("case when a.is_feedback = 1 and \n");
|
|
|
|
|
|
+ selSQL.append("case when a.correctNums = a.totalNums and \n");
|
|
selSQL.append("((DATE_FORMAT(a.create_time,'%H:%i')>='20:30' and DATE_FORMAT(a.end_time,'%Y-%m-%d %H%i:%s')>concat(DATE_FORMAT(DATE_ADD(a.create_time,interval 1 day),'%Y-%m-%d'),' 12:00:00')) or (DATE_FORMAT(a.create_time,'%H:%i')<'20:30' and DATE_FORMAT(a.end_time,'%Y-%m-%d %H%i:%s')>concat(DATE_FORMAT(a.create_time,'%Y-%m-%d'),' 23:59:59')))\n");
|
|
selSQL.append("((DATE_FORMAT(a.create_time,'%H:%i')>='20:30' and DATE_FORMAT(a.end_time,'%Y-%m-%d %H%i:%s')>concat(DATE_FORMAT(DATE_ADD(a.create_time,interval 1 day),'%Y-%m-%d'),' 12:00:00')) or (DATE_FORMAT(a.create_time,'%H:%i')<'20:30' and DATE_FORMAT(a.end_time,'%Y-%m-%d %H%i:%s')>concat(DATE_FORMAT(a.create_time,'%Y-%m-%d'),' 23:59:59')))\n");
|
|
selSQL.append(" then 5\n");
|
|
selSQL.append(" then 5\n");
|
|
- selSQL.append("when a.is_feedback = 1 and a.next_1 > 120 then 6 \n");
|
|
|
|
- selSQL.append("when a.is_feedback = 1 then 7\n");
|
|
|
|
- selSQL.append("when a.is_feedback = 0 and a.start_time is not null and \n");
|
|
|
|
|
|
+ selSQL.append("when a.correctNums = a.totalNums and a.next_1 > 120 then 6 \n");
|
|
|
|
+ selSQL.append("when a.correctNums = a.totalNums then 7\n");
|
|
|
|
+ selSQL.append("when a.correctNums < a.totalNums and a.start_time is not null and \n");
|
|
selSQL.append("((DATE_FORMAT(a.create_time,'%H:%i')>='20:30' and DATE_FORMAT(now(),'%Y-%m-%d %H%i:%s')>concat(DATE_FORMAT(DATE_ADD(a.create_time,interval 1 day),'%Y-%m-%d'),' 12:00:00'))\n");
|
|
selSQL.append("((DATE_FORMAT(a.create_time,'%H:%i')>='20:30' and DATE_FORMAT(now(),'%Y-%m-%d %H%i:%s')>concat(DATE_FORMAT(DATE_ADD(a.create_time,interval 1 day),'%Y-%m-%d'),' 12:00:00'))\n");
|
|
selSQL.append(" or (DATE_FORMAT(a.create_time,'%H:%i')<'20:30' and DATE_FORMAT(now(),'%Y-%m-%d %H%i:%s')>concat(DATE_FORMAT(a.create_time,'%Y-%m-%d'),'23:59:59')))\n");
|
|
selSQL.append(" or (DATE_FORMAT(a.create_time,'%H:%i')<'20:30' and DATE_FORMAT(now(),'%Y-%m-%d %H%i:%s')>concat(DATE_FORMAT(a.create_time,'%Y-%m-%d'),'23:59:59')))\n");
|
|
selSQL.append("then 3\n");
|
|
selSQL.append("then 3\n");
|
|
- selSQL.append("when a.is_feedback = 0 and a.start_time is null and \n");
|
|
|
|
|
|
+ selSQL.append("when a.correctNums < a.totalNums and a.start_time is null and \n");
|
|
selSQL.append("((DATE_FORMAT(a.create_time,'%H:%i')>='20:30' and DATE_FORMAT(now(),'%Y-%m-%d %H%i:%s')>concat(DATE_FORMAT(DATE_ADD(a.create_time,interval 1 day),'%Y-%m-%d'),' 12:00:00'))\n");
|
|
selSQL.append("((DATE_FORMAT(a.create_time,'%H:%i')>='20:30' and DATE_FORMAT(now(),'%Y-%m-%d %H%i:%s')>concat(DATE_FORMAT(DATE_ADD(a.create_time,interval 1 day),'%Y-%m-%d'),' 12:00:00'))\n");
|
|
selSQL.append(" or (DATE_FORMAT(a.create_time,'%H:%i')<'20:30' and DATE_FORMAT(now(),'%Y-%m-%d %H%i:%s')>concat(DATE_FORMAT(a.create_time,'%Y-%m-%d'),' 23:59:59')))\n");
|
|
selSQL.append(" or (DATE_FORMAT(a.create_time,'%H:%i')<'20:30' and DATE_FORMAT(now(),'%Y-%m-%d %H%i:%s')>concat(DATE_FORMAT(a.create_time,'%Y-%m-%d'),' 23:59:59')))\n");
|
|
selSQL.append("then 1\n");
|
|
selSQL.append("then 1\n");
|
|
- selSQL.append("when a.is_feedback = 0 and a.start_time is not null then 4\n");
|
|
|
|
|
|
+ selSQL.append("when a.correctNums < a.totalNums and a.start_time is not null then 4\n");
|
|
selSQL.append("else 2 end as state,\n");
|
|
selSQL.append("else 2 end as state,\n");
|
|
selSQL.append("a.start_time,\n");
|
|
selSQL.append("a.start_time,\n");
|
|
selSQL.append("a.allot_time,\n");
|
|
selSQL.append("a.allot_time,\n");
|
|
@@ -342,6 +342,7 @@ public class HomeworkQueryDaoImpl implements HomeworkQueryDao {
|
|
selSQL.append("min(t11.start_time) as start_time,\n");
|
|
selSQL.append("min(t11.start_time) as start_time,\n");
|
|
selSQL.append("max(t11.end_time) as end_time,\n");
|
|
selSQL.append("max(t11.end_time) as end_time,\n");
|
|
selSQL.append("min(t.create_time) as create_time,\n");
|
|
selSQL.append("min(t.create_time) as create_time,\n");
|
|
|
|
+ selSQL.append("min(t.is_mark) as is_mark,\n");
|
|
selSQL.append("sum(t11.correction_time) as correction_time,\n");
|
|
selSQL.append("sum(t11.correction_time) as correction_time,\n");
|
|
selSQL.append("floor(sum(t11.correction_time)/ count(if(t.is_feedback = 1 or t.is_mark in (1,3),true,null))) as next_1,\n");
|
|
selSQL.append("floor(sum(t11.correction_time)/ count(if(t.is_feedback = 1 or t.is_mark in (1,3),true,null))) as next_1,\n");
|
|
selSQL.append("min(t.is_feedback) as is_feedback\n");
|
|
selSQL.append("min(t.is_feedback) as is_feedback\n");
|
|
@@ -350,7 +351,7 @@ public class HomeworkQueryDaoImpl implements HomeworkQueryDao {
|
|
selSQL.append("left join scon_homework_picture_correct t11 on t.id = t11.homework_picture_id and t11.type=8\n");
|
|
selSQL.append("left join scon_homework_picture_correct t11 on t.id = t11.homework_picture_id and t11.type=8\n");
|
|
selSQL.append("left join tb_lib_vip t12 on t.vip_id = t12.id\n");
|
|
selSQL.append("left join tb_lib_vip t12 on t.vip_id = t12.id\n");
|
|
selSQL.append(" where t.teacher_id=? and ((t11.end_time > ? and (t.is_feedback=1 or t.is_mark in (0,2)) ) or t.is_feedback=0)\n");
|
|
selSQL.append(" where t.teacher_id=? and ((t11.end_time > ? and (t.is_feedback=1 or t.is_mark in (0,2)) ) or t.is_feedback=0)\n");
|
|
- //selSQL.append("and t.is_mark in (0,2)\n");
|
|
|
|
|
|
+ selSQL.append("and t.is_mark between 0 and 4\n");
|
|
selSQL.append("group by t.homework_id");
|
|
selSQL.append("group by t.homework_id");
|
|
selSQL.append(") a \n");
|
|
selSQL.append(") a \n");
|
|
selSQL.append( ") b order by b.state asc ");
|
|
selSQL.append( ") b order by b.state asc ");
|