Bladeren bron

批注接口提交

shenhao 3 jaren geleden
bovenliggende
commit
62ae1eb237
1 gewijzigde bestanden met toevoegingen van 3 en 1 verwijderingen
  1. 3 1
      src/main/java/com/ssj/statistics/dao/impl/StatisticsQueryImpl.java

+ 3 - 1
src/main/java/com/ssj/statistics/dao/impl/StatisticsQueryImpl.java

@@ -185,9 +185,11 @@ public class StatisticsQueryImpl implements IStatisticsQueryDao {
         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,'%i:%s')>='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("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" );