Parcourir la source

统计异常修改

shenhao il y a 3 ans
Parent
commit
a26eece292

+ 8 - 7
src/main/java/com/ssj/dao/sys/homework/dao/impl/HomeworkQueryDaoImpl.java

@@ -316,20 +316,20 @@ public class HomeworkQueryDaoImpl implements HomeworkQueryDao {
         selSQL.append("else '作业已超时' end state_msg,b.state \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("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(" 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(" 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("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(" 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("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("a.start_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("max(t11.end_time) as end_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("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");
@@ -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 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("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(") a \n");
         selSQL.append( ") b order by b.state asc ");

+ 5 - 4
src/main/java/com/ssj/statistics/dao/impl/StatisticsQueryImpl.java

@@ -183,7 +183,7 @@ public class StatisticsQueryImpl implements IStatisticsQueryDao {
         sql.append("FLOOR(a.sum_perk/a.perk_nums) as perk_efficiency,Floor(100*(a.correct_nums-a.error_nums)/a.correct_nums) as accuracy,\n");
         sql.append("case when a.perk_nums-a.perk_overtime_nums<134 and a.perk_nums-a.perk_overtime_nums>0  and floor(a.sum_perk/a.perk_nums)<120 then 20 \n");
         sql.append("     when a.perk_nums = a.perk_overtime_nums then (a.perk_overtime_nums-a.error_overtime_nums)*0.075 \n");
-        sql.append("sql.append(sql.append( else (a.perk_nums-a.perk_overtime_nums-a.error_overtime_nums)*0.15+(a.perk_overtime_nums-a.error_overtime_nums)*0.075 end as perk_salary,\n");
+        sql.append(" else (a.perk_nums-a.perk_overtime_nums-a.error_overtime_nums)*0.15+(a.perk_overtime_nums-a.error_overtime_nums)*0.075 end as perk_salary,\n");
         sql.append("case when a.correct_nums-a.perk_nums-a.overtime_nums+a.perk_overtime_nums=0 then (a.correct_nums-a.perk_nums)*0.075 \n");
         sql.append("     else (a.correct_nums-a.perk_nums-a.overtime_nums+a.perk_overtime_nums)*0.15+(a.overtime_nums-a.perk_overtime_nums)*0.075 end as other_salary\n");
         sql.append("from (\n");
@@ -221,10 +221,11 @@ public class StatisticsQueryImpl implements IStatisticsQueryDao {
         sql.append("  and (concat(DATE_FORMAT(t.login_datetime,'%Y-%m-%d'),' 20:00:00') <DATE_FORMAT(t.logout_datetime,'%Y-%m-%d %H:%i:%s') or logout_time=0)\n");
         sql.append(" and t.login_datetime like concat(?,'%')");
         queryParams.add(month);
-        sql.append("sql.append(GROUP BY t.user_id,to_days(t.login_datetime)\n");
+        sql.append("GROUP BY t.user_id,to_days(t.login_datetime)\n");
         sql.append(") a \n");
-        sql.append("sql.append(left join scon_homework_picture b on a.user_id = b.teacher_id and a.work_date = DATE_FORMAT(b.allot_time,'%Y-%m-%d') and DATE_FORMAT(b.allot_time,'%H:%i')>='18:00' and DATE_FORMAT(b.allot_time,'%H:%i')<='20:00'\n");
-        sql.append("sql.append(where b.id is null");
+        sql.append(" join tb_lib_manager t on a.user_id = t.user_id and t.type = 30\n");
+        sql.append("left join scon_homework_picture b on a.user_id = b.teacher_id and a.work_date = DATE_FORMAT(b.allot_time,'%Y-%m-%d') and DATE_FORMAT(b.allot_time,'%H:%i')>='18:00' and DATE_FORMAT(b.allot_time,'%H:%i')<='20:00'\n");
+        sql.append("where b.id is null");
         return dao.findList(sql.toString(),queryParams.toArray(),TeacherSalarysVO.class);
     }