|
@@ -115,7 +115,7 @@ public class StatisticsQueryImpl implements IStatisticsQueryDao {
|
|
queryParams.add(teacherId);
|
|
queryParams.add(teacherId);
|
|
sql.append(" and to_days(t11.create_time) =to_days(?) ");
|
|
sql.append(" and to_days(t11.create_time) =to_days(?) ");
|
|
queryParams.add(date);
|
|
queryParams.add(date);
|
|
- sql.append("t11.homework_id");
|
|
|
|
|
|
+ sql.append("group by t11.homework_id");
|
|
return dao.findMap(sql.toString(),queryParams.toArray());
|
|
return dao.findMap(sql.toString(),queryParams.toArray());
|
|
}
|
|
}
|
|
|
|
|
|
@@ -156,8 +156,8 @@ public class StatisticsQueryImpl implements IStatisticsQueryDao {
|
|
sql.append("SELECT a.teacher_id,a.teacher_name,a.`subject`,a.all_subject,a.correct_nums,a.overtime_nums,a.not_correct_nums,a.not_comment_nums,a.repeat_nums,a.error_nums,\n");
|
|
sql.append("SELECT a.teacher_id,a.teacher_name,a.`subject`,a.all_subject,a.correct_nums,a.overtime_nums,a.not_correct_nums,a.not_comment_nums,a.repeat_nums,a.error_nums,\n");
|
|
sql.append("floor(100*(a.total- a.error_nums-a.not_correct_nums)/a.total) as accuracy,a.calculate_date,a.total as total_nums\n");
|
|
sql.append("floor(100*(a.total- a.error_nums-a.not_correct_nums)/a.total) as accuracy,a.calculate_date,a.total as total_nums\n");
|
|
sql.append("from (\n");
|
|
sql.append("from (\n");
|
|
- sql.append("SELECT t12.name as teacher_name,t.teacher_id,t.`subject`,t12.course_name as all_subject,count(if(t.is_mark in (0,2) and t.is_feedback=1,true,NULL)) as correct_nums, \n");
|
|
|
|
- sql.append("count(if(t.is_feedback=1 and (DATE_FORMAT(t.create_time,'%H:%i')>='20:30' and DATE_FORMAT(t11.end_time,'%Y-%m-%d %H:%i:%s')>concat(DATE_FORMAT(DATE_ADD(t.create_time,interval 1 day),'%Y-%m-%d'),' 12:00:00'))\n" +
|
|
|
|
|
|
+ sql.append("SELECT t12.name as teacher_name,t.teacher_id,t.`subject`,t12.course_name as all_subject,count(if((t.is_mark in (0,2) and t.is_feedback=1) or t.is_mark in (1,3),true,NULL)) as correct_nums, \n");
|
|
|
|
+ sql.append("count(if((t.is_feedback=1 or t.is_mark in (1,3)) and (DATE_FORMAT(t.create_time,'%H:%i')>='20:30' and DATE_FORMAT(t11.end_time,'%Y-%m-%d %H:%i:%s')>concat(DATE_FORMAT(DATE_ADD(t.create_time,interval 1 day),'%Y-%m-%d'),' 12:00:00'))\n" +
|
|
" or (DATE_FORMAT(t.create_time,'%H:%i')<'20:30' and DATE_FORMAT(t11.end_time,'%Y-%m-%d %H:%i:%s')>concat(DATE_FORMAT(t.create_time,'%Y-%m-%d'),' 23:59:59')),true,null)) as overtime_nums,\n");
|
|
" or (DATE_FORMAT(t.create_time,'%H:%i')<'20:30' and DATE_FORMAT(t11.end_time,'%Y-%m-%d %H:%i:%s')>concat(DATE_FORMAT(t.create_time,'%Y-%m-%d'),' 23:59:59')),true,null)) as overtime_nums,\n");
|
|
sql.append("count(1) as total,\n");
|
|
sql.append("count(1) as total,\n");
|
|
sql.append("DATE_FORMAT(t.create_time,'%Y-%m-%d') as calculate_date,\n");
|
|
sql.append("DATE_FORMAT(t.create_time,'%Y-%m-%d') as calculate_date,\n");
|
|
@@ -179,34 +179,56 @@ public class StatisticsQueryImpl implements IStatisticsQueryDao {
|
|
public List<TeacherSalarysVO> addTeacherSalarysData(String month) {
|
|
public List<TeacherSalarysVO> addTeacherSalarysData(String month) {
|
|
StringBuffer sql = new StringBuffer();
|
|
StringBuffer sql = new StringBuffer();
|
|
List<Object> queryParams = new ArrayList<>();
|
|
List<Object> queryParams = new ArrayList<>();
|
|
- sql.append("SELECT a.correct_nums,a.teacher_id,a.overtime_nums,a.perk_nums,a.error_nums,a.work_date,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<134 and a.sum_perk<120 then 20 else (a.perk_nums-a.error_nums)*0.15 end as perk_salary\n" );
|
|
|
|
- sql.append(",(a.correct_nums-a.perk_nums-a.error_nums)*0.15 as other_salary\n" );
|
|
|
|
- sql.append("from (\n" );
|
|
|
|
- sql.append("SELECT\n" );
|
|
|
|
- sql.append("count(1) as correct_nums,\n" );
|
|
|
|
|
|
+ sql.append("SELECT a.correct_nums,a.teacher_id,a.overtime_nums,a.perk_nums,a.error_nums,a.work_date,\n");
|
|
|
|
+ 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("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");
|
|
|
|
+ sql.append("SELECT\n");
|
|
|
|
+ sql.append("count(1) as correct_nums,\n");
|
|
sql.append("count(if((DATE_FORMAT(t11.create_time,'%H:%i')>='20:30' and DATE_FORMAT(t.end_time,'%Y-%m-%d %H:%i:%s')>concat(DATE_FORMAT(DATE_ADD(t11.create_time,interval 1 day),'%Y-%m-%d'),' 12:00:00'))\n");
|
|
sql.append("count(if((DATE_FORMAT(t11.create_time,'%H:%i')>='20:30' and DATE_FORMAT(t.end_time,'%Y-%m-%d %H:%i:%s')>concat(DATE_FORMAT(DATE_ADD(t11.create_time,interval 1 day),'%Y-%m-%d'),' 12:00:00'))\n");
|
|
sql.append(" or (DATE_FORMAT(t11.create_time,'%H:%i')<'20:30' and DATE_FORMAT(t.end_time,'%Y-%m-%d %H:%i:%s')>concat(DATE_FORMAT(t11.create_time,'%Y-%m-%d'),' 23:59:59')),true,null)) as overtime_nums,\n");
|
|
sql.append(" or (DATE_FORMAT(t11.create_time,'%H:%i')<'20:30' and DATE_FORMAT(t.end_time,'%Y-%m-%d %H:%i:%s')>concat(DATE_FORMAT(t11.create_time,'%Y-%m-%d'),' 23:59:59')),true,null)) as overtime_nums,\n");
|
|
- sql.append("count(IF(DATE_FORMAT(t.end_time,'%H:%i')>='18:00' and DATE_FORMAT(t.end_time,'%H:%i')<='20:00',TRUE,null)) as perk_nums,\n" );
|
|
|
|
- sql.append("count(IF(DATE_FORMAT(t.end_time,'%H:%i')>='18:00' and DATE_FORMAT(t.end_time,'%H:%i')<='20:00' and (DATE_FORMAT(t11.create_time,'%H:%i')>='20:30' and DATE_FORMAT(t.end_time,'%Y-%m-%d %H:%i:%s')>concat(DATE_FORMAT(DATE_ADD(t11.create_time,interval 1 day),'%Y-%m-%d'),' 12:00:00'))\n");
|
|
|
|
- sql.append(" or (DATE_FORMAT(t11.create_time,'%H:%i')<'20:30' and DATE_FORMAT(t.end_time,'%Y-%m-%d %H:%i:%s')>concat(DATE_FORMAT(t11.create_time,'%Y-%m-%d'),' 23:59:59')),TRUE,null)) as perk_overtime_nums,\n" );
|
|
|
|
- sql.append("count(IF(t.is_check_error=1,TRUE,null)) as error_nums,\n" );
|
|
|
|
- sql.append("DATE_FORMAT(t.end_time,'%Y-%m-%d') as work_date,\n" );
|
|
|
|
- sql.append("sum(IF(DATE_FORMAT(t.end_time,'%H:%i')>='18:00' and DATE_FORMAT(t.end_time,'%H:%i')<='20:00',t.correction_time,0)) as sum_perk,\n" );
|
|
|
|
- sql.append("t11.teacher_id,\n" );
|
|
|
|
- sql.append("t.end_time,\n" );
|
|
|
|
- sql.append("t.start_time \n" );
|
|
|
|
- sql.append("from scon_homework_picture_correct t \n" );
|
|
|
|
- sql.append("join scon_homework_picture t11 on t.homework_picture_id = t11.id\n" );
|
|
|
|
- sql.append("where t.type=8 and t11.is_mark in(0,2) and t11.is_feedback=1 \n" );
|
|
|
|
- sql.append("and t.end_time like concat('%',?,'%')\n" );
|
|
|
|
|
|
+ sql.append("count(IF(DATE_FORMAT(t.end_time,'%H:%i')>='18:00' and DATE_FORMAT(t.end_time,'%H:%i')<='20:00',TRUE,null)) as perk_nums,\n");
|
|
|
|
+ sql.append("count(IF(DATE_FORMAT(t.end_time,'%H:%i')>='18:00' and DATE_FORMAT(t.end_time,'%H:%i')<='20:00' and ((DATE_FORMAT(t11.create_time,'%H:%i')>='20:30' and DATE_FORMAT(t.end_time,'%Y-%m-%d %H:%i:%s')>concat(DATE_FORMAT(DATE_ADD(t11.create_time,interval 1 day),'%Y-%m-%d'),' 12:00:00'))\n");
|
|
|
|
+ sql.append(" or (DATE_FORMAT(t11.create_time,'%H:%i')<'20:30' and DATE_FORMAT(t.end_time,'%Y-%m-%d %H:%i:%s')>concat(DATE_FORMAT(t11.create_time,'%Y-%m-%d'),' 23:59:59'))),TRUE,null)) as perk_overtime_nums,\n");
|
|
|
|
+ sql.append("count(IF(t.is_check_error=1,TRUE,null)) as error_nums,\n");
|
|
|
|
+ sql.append("count(IF(t.is_check_error=1 and ((DATE_FORMAT(t11.create_time,'%H:%i')>='20:30' and DATE_FORMAT(t.end_time,'%Y-%m-%d %H:%i:%s')>concat(DATE_FORMAT(DATE_ADD(t11.create_time,interval 1 day),'%Y-%m-%d'),' 12:00:00'))\n");
|
|
|
|
+ sql.append(" or (DATE_FORMAT(t11.create_time,'%H:%i')<'20:30' and DATE_FORMAT(t.end_time,'%Y-%m-%d %H:%i:%s')>concat(DATE_FORMAT(t11.create_time,'%Y-%m-%d'),' 23:59:59'))),TRUE,null)) as error_overtime_nums,\n");
|
|
|
|
+ sql.append("DATE_FORMAT(t.end_time,'%Y-%m-%d') as work_date,\n");
|
|
|
|
+ sql.append("sum(IF(DATE_FORMAT(t.end_time,'%H:%i')>='18:00' and DATE_FORMAT(t.end_time,'%H:%i')<='20:00',t.correction_time,0)) as sum_perk,\n");
|
|
|
|
+ sql.append("t11.teacher_id\n");
|
|
|
|
+ sql.append("from scon_homework_picture_correct t \n");
|
|
|
|
+ sql.append("join scon_homework_picture t11 on t.homework_picture_id = t11.id\n");
|
|
|
|
+ sql.append("where t.type=8 and t11.is_mark in(0,2) and t11.is_feedback=1 \n");
|
|
|
|
+ sql.append("and t.end_time like concat(?,'%') \n");
|
|
queryParams.add(month);
|
|
queryParams.add(month);
|
|
- sql.append("GROUP BY t11.teacher_id\n" );
|
|
|
|
|
|
+ sql.append("GROUP BY t11.teacher_id\n");
|
|
sql.append(") a");
|
|
sql.append(") a");
|
|
return dao.findList(sql.toString(),queryParams.toArray(),TeacherSalarysVO.class);
|
|
return dao.findList(sql.toString(),queryParams.toArray(),TeacherSalarysVO.class);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
+ public List<TeacherSalarysVO> findOnlineList(String month) {
|
|
|
|
+ StringBuffer sql = new StringBuffer();
|
|
|
|
+ List<Object> queryParams = new ArrayList<>();
|
|
|
|
+ sql.append("select a.work_date,a.user_id as teacher_id from (\n");
|
|
|
|
+ sql.append("SELECT DATE_FORMAT(t.login_datetime,'%Y-%m-%d') as work_date,t.user_id \n");
|
|
|
|
+ sql.append(" from tb_user_login t\n");
|
|
|
|
+ sql.append(" where DATE_FORMAT(t.login_datetime,'%H:%i')<='18:00' \n");
|
|
|
|
+ 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(") 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");
|
|
|
|
+ return dao.findList(sql.toString(),queryParams.toArray(),TeacherSalarysVO.class);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
public List<CheckDetailVO> checkDetailList(String homeworkId) {
|
|
public List<CheckDetailVO> checkDetailList(String homeworkId) {
|
|
StringBuffer sql = new StringBuffer();
|
|
StringBuffer sql = new StringBuffer();
|
|
List<Object> queryParams = new ArrayList<>();
|
|
List<Object> queryParams = new ArrayList<>();
|