2 Commits 21887300ef ... 37f069ac6d

Author SHA1 Message Date
  wuwen 37f069ac6d Merge branch 'master' of http://47.112.200.206:3000/shenhao/sys 3 years ago
  wuwen c76a735ac2 质检重构 3 years ago

+ 74 - 46
src/main/java/com/ssj/dao/kmt/correctsys/impl/CorrectSysQueryDaoImpl.java

@@ -753,29 +753,43 @@ public class CorrectSysQueryDaoImpl implements CorrectSysQueryDao {
   	public Page<Map<String,Object>> pageHomeworkCheckByInspectorIdPageSize(Map<String, Object> params, Pageable pageable) {
       	 StringBuilder sb = new StringBuilder();
       	 List<Object> queryparams = new ArrayList<>();
-           sb.append(" SELECT date(t1.correct_time) date ");
-           sb.append(" FROM ");
-           sb.append(" ( ");
-           sb.append(" 	SELECT hp.homework_id FROM scon_homework_picture hp    ");
-           sb.append("  	LEFT JOIN tb_lib_manager m ON hp.teacher_id=m.user_id ");
-           sb.append(" 		WHERE hp.service_type = 100 AND m.inspector_id =? AND TO_DAYS(hp.correct_time)>=TO_DAYS(?) AND TO_DAYS(hp.correct_time)<=TO_DAYS(?) ");
+//           sb.append(" SELECT date(t1.correct_time) date ");
+//           sb.append(" FROM ");
+//           sb.append(" ( ");
+//           sb.append(" 	SELECT hp.homework_id FROM scon_homework_picture hp    ");
+//           sb.append("  	LEFT JOIN tb_lib_manager m ON hp.teacher_id=m.user_id ");
+//           sb.append(" 		WHERE hp.service_type = 100 AND m.inspector_id =? AND TO_DAYS(hp.correct_time)>=TO_DAYS(?) AND TO_DAYS(hp.correct_time)<=TO_DAYS(?) ");
+//           
+//           queryparams.add(params.get("inspectorId"));
+//           queryparams.add(params.get("beginTime"));
+//           queryparams.add(params.get("endTime"));
+//           
+//           sb.append(" 	GROUP BY ");
+//           sb.append(" 		hp.homework_id ");
+//           sb.append(" 	HAVING");
+//           sb.append(" 		count( IF( hp.is_feedback = 1 OR hp.is_mark IN ( 1, 3 ), 1, 0 )) = sum( IF( hp.is_feedback = 1 OR hp.is_mark IN ( 1, 3 ), 1, 0 )) ");
+//           sb.append(" ) t4");
+//           sb.append(" LEFT JOIN scon_homework_picture t1 ON t4.homework_id = t1.homework_id  AND t1.service_type = 100 ");
+//           sb.append(" LEFT JOIN tb_lib_manager m1 ON t1.teacher_id=m1.user_id ");
+//           sb.append(" LEFT JOIN tb_lib_vip t2 ON t1.vip_id = t2.id ");
+//           sb.append(" LEFT JOIN scon_homework_picture_correct hpc ON t1.id = hpc.homework_picture_id AND hpc.type = 8  ");
+//           sb.append(" WHERE ");
+//           sb.append(" t1.correct_time is not null and m1.inspector_id =?  ");
+//      	 queryparams.add(params.get("inspectorId"));
            
-           queryparams.add(params.get("inspectorId"));
-           queryparams.add(params.get("beginTime"));
-           queryparams.add(params.get("endTime"));
-           
-           sb.append(" 	GROUP BY ");
-           sb.append(" 		hp.homework_id ");
-           sb.append(" 	HAVING");
-           sb.append(" 		count( IF( hp.is_feedback = 1 OR hp.is_mark IN ( 1, 3 ), 1, 0 )) = sum( IF( hp.is_feedback = 1 OR hp.is_mark IN ( 1, 3 ), 1, 0 )) ");
-           sb.append(" ) t4");
-           sb.append(" LEFT JOIN scon_homework_picture t1 ON t4.homework_id = t1.homework_id  AND t1.service_type = 100 ");
-           sb.append(" LEFT JOIN tb_lib_manager m1 ON t1.teacher_id=m1.user_id ");
-           sb.append(" LEFT JOIN tb_lib_vip t2 ON t1.vip_id = t2.id ");
-           sb.append(" LEFT JOIN scon_homework_picture_correct hpc ON t1.id = hpc.homework_picture_id AND hpc.type = 8  ");
-           sb.append(" WHERE ");
-           sb.append(" t1.correct_time is not null and m1.inspector_id =?  ");
-           queryparams.add(params.get("inspectorId"));
+      	   	sb.append(" SELECT date( hpc.end_time ) date ");
+      	   	sb.append(" FROM scon_homework_picture t1  ");
+      	   	sb.append(" 	LEFT JOIN scon_homework_picture_correct hpc ON t1.id = hpc.homework_picture_id AND hpc.type = 8   ");
+      		sb.append(" 	LEFT JOIN tb_lib_manager m1 ON t1.teacher_id=m1.user_id  ");
+      		sb.append(" 	LEFT JOIN tb_lib_vip t2 ON t1.vip_id = t2.id  ");
+      		sb.append(" WHERE t1.service_type = 100  ");
+      		sb.append(" 	AND TO_DAYS(hpc.end_time)>=TO_DAYS(?) AND TO_DAYS(hpc.end_time)<=TO_DAYS(?)  ");
+      		sb.append(" 	AND (t1.is_feedback=1 OR t1.is_mark IN (1,3,10,15) OR (t1.is_mark=2 AND t1.is_feedback=1)) ");
+      		sb.append(" 	AND m1.inspector_id =? ");
+
+      		queryparams.add(params.get("beginTime"));
+      		queryparams.add(params.get("endTime"));
+            queryparams.add(params.get("inspectorId"));
            
            if(params.get("childName")!=null && StringUtils.isNotEmpty(params.get("childName").toString())) {
           	 sb.append(" AND t2.child_name LIKE CONCAT('%',?,'%') ");
@@ -796,30 +810,44 @@ public class CorrectSysQueryDaoImpl implements CorrectSysQueryDao {
 	public List<HomeworkCheckDto> findHomeworkCheckByInspectorIdList(String inspectorId,String childName,String subject,String beginTime, String endTime) {
     	 StringBuilder sb = new StringBuilder();
     	 List<Object> queryparams = new ArrayList<>();
-         sb.append(" SELECT	t2.child_name,	t1.homework_id,t1.teacher_id,	t1.SUBJECT,	t2.grade,	date( t1.create_time ) date,date( t1.correct_time ) correct_date,	sum( hpc.is_check_error ) error,	sum( CASE WHEN hpc.check_date IS NOT NULL THEN 1 ELSE 0 END ) checked,	sum( 1 ) total  ");
-         sb.append(" FROM ");
-         sb.append(" ( ");
-         sb.append(" 	SELECT hp.homework_id FROM scon_homework_picture hp    ");
-         sb.append("  	LEFT JOIN tb_lib_manager m ON hp.teacher_id=m.user_id ");
-         sb.append(" 		WHERE hp.service_type = 100 AND m.inspector_id =? AND TO_DAYS(hp.correct_time)>=TO_DAYS(?) AND TO_DAYS(hp.correct_time)<=TO_DAYS(?) ");
-         
-         queryparams.add(inspectorId);
-         queryparams.add(beginTime);
-         queryparams.add(endTime);
-         
-         sb.append(" 	GROUP BY ");
-         sb.append(" 		hp.homework_id ");
-         sb.append(" 	HAVING");
-         sb.append(" 		count( IF( hp.is_feedback = 1 OR hp.is_mark IN ( 1, 3 ), 1, 0 )) = sum( IF( hp.is_feedback = 1 OR hp.is_mark IN ( 1, 3 ), 1, 0 )) ");
-         sb.append(" ) t4");
-         sb.append(" LEFT JOIN scon_homework_picture t1 ON t4.homework_id = t1.homework_id  AND t1.service_type = 100 ");
-         sb.append(" LEFT JOIN tb_lib_manager m1 ON t1.teacher_id=m1.user_id ");
-         sb.append(" LEFT JOIN tb_lib_vip t2 ON t1.vip_id = t2.id ");
-         sb.append(" LEFT JOIN scon_homework_picture_correct hpc ON t1.id = hpc.homework_picture_id AND hpc.type = 8  ");
-         sb.append(" WHERE ");
-         sb.append(" t1.correct_time is not null and m1.inspector_id =?  ");
-         queryparams.add(inspectorId);
-         
+//         sb.append(" SELECT	t2.child_name,	t1.homework_id,t1.teacher_id,	t1.SUBJECT,	t2.grade,	date( t1.create_time ) date,date( t1.correct_time ) correct_date,	sum( hpc.is_check_error ) error,	sum( CASE WHEN hpc.check_date IS NOT NULL THEN 1 ELSE 0 END ) checked,	sum( 1 ) total  ");
+//         sb.append(" FROM ");
+//         sb.append(" ( ");
+//         sb.append(" 	SELECT hp.homework_id FROM scon_homework_picture hp    ");
+//         sb.append("  	LEFT JOIN tb_lib_manager m ON hp.teacher_id=m.user_id ");
+//         sb.append(" 		WHERE hp.service_type = 100 AND m.inspector_id =? AND TO_DAYS(hp.correct_time)>=TO_DAYS(?) AND TO_DAYS(hp.correct_time)<=TO_DAYS(?) ");
+//         
+//         queryparams.add(inspectorId);
+//         queryparams.add(beginTime);
+//         queryparams.add(endTime);
+//         
+//         sb.append(" 	GROUP BY ");
+//         sb.append(" 		hp.homework_id ");
+//         sb.append(" 	HAVING");
+//         sb.append(" 		count( IF( hp.is_feedback = 1 OR hp.is_mark IN ( 1, 3 ), 1, 0 )) = sum( IF( hp.is_feedback = 1 OR hp.is_mark IN ( 1, 3 ), 1, 0 )) ");
+//         sb.append(" ) t4");
+//         sb.append(" LEFT JOIN scon_homework_picture t1 ON t4.homework_id = t1.homework_id  AND t1.service_type = 100 ");
+//         sb.append(" LEFT JOIN tb_lib_manager m1 ON t1.teacher_id=m1.user_id ");
+//         sb.append(" LEFT JOIN tb_lib_vip t2 ON t1.vip_id = t2.id ");
+//         sb.append(" LEFT JOIN scon_homework_picture_correct hpc ON t1.id = hpc.homework_picture_id AND hpc.type = 8  ");
+//         sb.append(" WHERE ");
+//         sb.append(" t1.correct_time is not null and m1.inspector_id =?  ");
+//         queryparams.add(inspectorId);
+    	 
+    	 sb.append(" SELECT	t2.child_name,	t1.homework_id,t1.teacher_id,	t1.SUBJECT,	t2.grade,	date( t1.create_time ) date,date(  hpc.end_time ) correct_date,	sum( hpc.is_check_error ) error,	sum( CASE WHEN hpc.check_date IS NOT NULL THEN 1 ELSE 0 END ) checked,	sum( 1 ) total  ");
+   	   	 sb.append(" FROM scon_homework_picture t1  ");
+   	   	 sb.append(" 	LEFT JOIN scon_homework_picture_correct hpc ON t1.id = hpc.homework_picture_id AND hpc.type = 8   ");
+   		 sb.append(" 	LEFT JOIN tb_lib_manager m1 ON t1.teacher_id=m1.user_id  ");
+   		 sb.append(" 	LEFT JOIN tb_lib_vip t2 ON t1.vip_id = t2.id  ");
+   		 sb.append(" WHERE t1.service_type = 100  ");
+   		 sb.append(" 	AND TO_DAYS(hpc.end_time)>=TO_DAYS(?) AND TO_DAYS(hpc.end_time)<=TO_DAYS(?)  ");
+   		 sb.append(" 	AND (t1.is_feedback=1 OR t1.is_mark IN (1,3,10,15) OR (t1.is_mark=2 AND t1.is_feedback=1)) ");
+   		 sb.append(" 	AND m1.inspector_id =? ");
+   		
+   		 queryparams.add(beginTime);
+   		 queryparams.add(endTime);
+   		 queryparams.add(inspectorId);
+    	 
          if(StringUtils.isNotEmpty(childName)) {
         	 sb.append(" AND t2.child_name LIKE CONCAT('%',?,'%') ");
         	 queryparams.add(childName);

+ 1 - 1
src/main/java/com/ssj/dao/sys/homework/dao/impl/HomeworkPictureQueryDaoImpl.java

@@ -172,7 +172,7 @@ public class HomeworkPictureQueryDaoImpl  implements  HomeworkPictureQueryDao {
 				.append(" hp.teacher_id, hp.allot_time,  hp.create_time, hp.corrected_picture_url, hpc.check_date, hpc.checker, hpc.is_check_error," )
 				.append(" hpc.error_reason, hp.is_checker_correct is_correct")
 				.append(" FROM scon_homework_picture hp left join scon_homework_picture_correct hpc on hp.id=hpc.homework_picture_id ")
-				.append(" where hp.homework_id=? AND hp.correct_time is NOT NULL and hpc.type = ? and (hp.is_feedback=1 or hp.is_mark in (1,3,4)) order by hp.create_time");
+				.append(" where hp.homework_id=? and hpc.type = ? AND (hp.is_feedback=1 OR hp.is_mark IN (1,3,10,15) OR (hp.is_mark=2 AND hp.is_feedback=1)) order by hp.create_time");
 		param.add(homeworkId);
 		param.add(type);
 		return dao.findList(sb.toString(), param.toArray(), HomeworkPictureDto.class);