|
@@ -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);
|