diff --git a/src/main/java/com/subsidy/jobs/RenSheJuJob.java b/src/main/java/com/subsidy/jobs/RenSheJuJob.java index 2a0bda9..446d3af 100644 --- a/src/main/java/com/subsidy/jobs/RenSheJuJob.java +++ b/src/main/java/com/subsidy/jobs/RenSheJuJob.java @@ -26,7 +26,7 @@ import java.util.concurrent.ConcurrentHashMap; /** * 企业职工线上培训 */ -@Component +//@Component public class RenSheJuJob { @@ -118,7 +118,7 @@ public class RenSheJuJob { // renSheJuService.getErrorClass(); // } - @Scheduled(cron = "00 50 23 * * ?") + @Scheduled(cron = "0 50 23 * * ?") @Transactional(rollbackFor = Exception.class) public void logout(){ //让当前用户下线 @@ -140,7 +140,7 @@ public class RenSheJuJob { } - @Scheduled(cron = "00 55 23 * * ?") + @Scheduled(cron = "0 55 23 * * ?") @Transactional(rollbackFor = Exception.class) public void cancelLogin() { diff --git a/src/main/java/com/subsidy/jobs/WarningJob.java b/src/main/java/com/subsidy/jobs/WarningJob.java index b8f7efd..ef1aa0d 100644 --- a/src/main/java/com/subsidy/jobs/WarningJob.java +++ b/src/main/java/com/subsidy/jobs/WarningJob.java @@ -10,15 +10,13 @@ import com.subsidy.vo.vod.VodPlayStateVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashSet; import java.util.List; -@Component +//@Component public class WarningJob { /** @@ -61,8 +59,9 @@ public class WarningJob { VodPlayStateVO vodPlayStateVO = vodPlayStateVOS.get(i + 1); //后面 VodPlayStateVO vodPlayStateVO1 = vodPlayStateVOS.get(i); //前面 if (vodPlayStateVO1.getEndDate().getTime() > vodPlayStateVO.getStartDate().getTime()) { - result.add(vodPlayStateVO.getClassId()); - break; + if (!result.contains(vodPlayStateVO1.getClassId())){ + result.add(vodPlayStateVO.getClassId()); + } } } } diff --git a/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java b/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java index 8e6320f..176f16d 100644 --- a/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java @@ -216,27 +216,27 @@ public class RenSheJuServiceImpl implements RenSheJuService { System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(classHourBehaviorDTO)); if (classHourBasics.size()>0){ - RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(classHourBehaviorDTO).toString()); - - Request request = new Request.Builder() - .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClassHourBehavior") - .method("POST", body) - .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") - .addHeader("Content-Type", "application/json") - .build(); - Response response = client.newCall(request).execute(); - - RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class); - RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); - renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3); - renshejuHistoryDO.setInputParam(JSONObject.fromObject(classHourBehaviorDTO).toString()); - if (200 == response.code()) { - renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); - } else { - renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); - } - renshejuHistoryMapper.insert(renshejuHistoryDO); - return rensheResponseVO; +// RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(classHourBehaviorDTO).toString()); +// +// Request request = new Request.Builder() +// .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClassHourBehavior") +// .method("POST", body) +// .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") +// .addHeader("Content-Type", "application/json") +// .build(); +// Response response = client.newCall(request).execute(); +// +// RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class); +// RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); +// renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3); +// renshejuHistoryDO.setInputParam(JSONObject.fromObject(classHourBehaviorDTO).toString()); +// if (200 == response.code()) { +// renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); +// } else { +// renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); +// } +// renshejuHistoryMapper.insert(renshejuHistoryDO); +// return rensheResponseVO; }else { RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3); diff --git a/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java b/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java index cd7f585..4eb7892 100644 --- a/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java @@ -695,18 +695,9 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl0){ List telephones = Arrays.asList(new String[]{"15201936167", "18201963812", "18217669021"}); diff --git a/src/main/resources/mapper/ClassDictMapper.xml b/src/main/resources/mapper/ClassDictMapper.xml index ec0bc71..610ac7d 100644 --- a/src/main/resources/mapper/ClassDictMapper.xml +++ b/src/main/resources/mapper/ClassDictMapper.xml @@ -256,7 +256,7 @@ FROM vod_play_history t1 WHERE - DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND t1.delete_date IS NULL diff --git a/src/main/resources/mapper/CourseContentMapper.xml b/src/main/resources/mapper/CourseContentMapper.xml index e0ee625..6c56433 100644 --- a/src/main/resources/mapper/CourseContentMapper.xml +++ b/src/main/resources/mapper/CourseContentMapper.xml @@ -93,7 +93,7 @@ SELECT t.member_id, t.vod_id, - max( t.create_date ) AS create_date + max( t.id ) AS id FROM vod_play_history t WHERE @@ -105,9 +105,7 @@ t.vod_id, t.class_id ) t - LEFT JOIN vod_play_history t2 ON t.vod_id = t2.vod_id - AND t.member_id = t2.member_id - AND t.create_date = t2.create_date + LEFT JOIN vod_play_history t2 ON t.id = t2.id ) t4 ON t2.vod_id = t4.vod_id WHERE t.delete_date IS NULL diff --git a/src/main/resources/mapper/DudaoMapper.xml b/src/main/resources/mapper/DudaoMapper.xml index 2ea1aa2..7125819 100644 --- a/src/main/resources/mapper/DudaoMapper.xml +++ b/src/main/resources/mapper/DudaoMapper.xml @@ -22,7 +22,7 @@ FROM vod_play_history t WHERE - DATE_FORMAT( DATE_ADD( t.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + DATE_FORMAT( DATE_ADD( t.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND t.delete_date IS NULL ) t2 ON t.id = t2.class_id LEFT JOIN company_dict t3 ON t.company_id = t3.id @@ -43,7 +43,7 @@ FROM exercise_done_result t WHERE - DATE_FORMAT( DATE_ADD( t.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + DATE_FORMAT( DATE_ADD( t.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND t.delete_date IS NULL ) t2 ON t.id = t2.class_id LEFT JOIN company_dict t3 ON t.company_id = t3.id @@ -64,7 +64,7 @@ FROM answering_question t WHERE - DATE_FORMAT( DATE_ADD( t.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + DATE_FORMAT( DATE_ADD( t.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND t.delete_date IS NULL ) t2 ON t.id = t2.class_id LEFT JOIN company_dict t3 ON t.company_id = t3.id @@ -85,7 +85,7 @@ FROM image_check_record t WHERE - DATE_FORMAT( DATE_ADD( t.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + DATE_FORMAT( DATE_ADD( t.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND t.delete_date IS NULL AND t.result = 1 ) t2 ON t.id = t2.class_id @@ -117,7 +117,7 @@ FROM vod_play_history t1 WHERE - DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND t1.delete_date IS NULL GROUP BY @@ -140,7 +140,7 @@ FROM opr_mem_dict t1 WHERE - DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND t1.delete_date IS NULL AND opr_type = "登出" @@ -155,7 +155,7 @@ FROM opr_mem_dict t1 WHERE - DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND t1.delete_date IS NULL AND opr_type = "登录" @@ -179,7 +179,7 @@ WHERE t1.delete_date IS NULL AND t2.class_type = #{classType} - AND DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( + AND DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) @@ -200,7 +200,7 @@ LEFT JOIN member t3 ON t1.ask_id = t3.id LEFT JOIN company_dict t4 ON t2.company_id = t4.id WHERE - DATE_FORMAT( DATE_ADD( t1.update_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + DATE_FORMAT( DATE_ADD( t1.update_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND t1.delete_date IS NULL AND t2.delete_date IS NULL @@ -216,7 +216,7 @@ class_dict t1 LEFT JOIN company_dict t3 ON t1.company_id = t3.id WHERE - DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND t1.delete_date IS NULL and t1.class_code is not NULL diff --git a/src/main/resources/mapper/OprAdmDictMapper.xml b/src/main/resources/mapper/OprAdmDictMapper.xml index eae979a..4c8bc7b 100644 --- a/src/main/resources/mapper/OprAdmDictMapper.xml +++ b/src/main/resources/mapper/OprAdmDictMapper.xml @@ -70,7 +70,7 @@ FROM opr_adm_dict WHERE - create_date < (NOW() -interval 0 day) + create_date < (NOW() -interval 1 day) diff --git a/src/main/resources/mapper/OprMemDictMapper.xml b/src/main/resources/mapper/OprMemDictMapper.xml index 6db07b8..79b089f 100644 --- a/src/main/resources/mapper/OprMemDictMapper.xml +++ b/src/main/resources/mapper/OprMemDictMapper.xml @@ -52,7 +52,7 @@ FROM opr_mem_dict WHERE - create_date < (NOW() -interval 0 day) + create_date < (NOW() -interval 1 day) SELECT - t2.class_id as downCode, + t2.class_id AS downCode, t2.member_id, - t4.user_name as studentName, - t4.telephone as phone, - t4.id_card as identity, + t4.user_name AS studentName, + t4.telephone AS phone, + t4.id_card AS identity, t2.learnTime, t2.playTime, t5.loginTime FROM - ( - SELECT - t1.class_id, - t1.member_id, - sum( t1.play_length ) AS learnTime, - sum( t1.play_length + t1.suspend_length ) AS playTime - FROM - vod_play_history t1 - WHERE - DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) - AND t1.delete_date IS NULL - GROUP BY - t1.class_id, - t1.member_id - ) t2 - LEFT JOIN class_dict t3 ON t2.class_id = t3.id - LEFT JOIN member t4 ON t2.member_id = t4.id - LEFT JOIN ( - SELECT - t3.user_id, - login - logout AS loginTime - FROM - ( - SELECT - user_id, - sum( - unix_timestamp( t1.create_date )) AS login - FROM - opr_mem_dict t1 - WHERE - DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) - AND t1.delete_date IS NULL - AND opr_type = "登出" - AND result = 1 - GROUP BY user_id - ) t3 - LEFT JOIN ( - SELECT - user_id, - sum( - unix_timestamp( t1.create_date )) AS logout - FROM - opr_mem_dict t1 - WHERE - DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) - AND t1.delete_date IS NULL - AND opr_type = "登录" - AND result = 1 - GROUP BY user_id - ) t2 ON t3.user_id = t2.user_id - ) t5 ON t4.id = t5.user_id + ( + SELECT + t3.user_id, + login - logout AS loginTime + FROM + ( + SELECT + user_id, + sum( + unix_timestamp( t1.create_date )) AS login + FROM + opr_mem_dict t1 + WHERE + DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + AND t1.delete_date IS NULL + AND opr_type = "登出" + AND result = 1 + GROUP BY + user_id + ) t3 + LEFT JOIN ( + SELECT + user_id, + sum( + unix_timestamp( t1.create_date )) AS logout + FROM + opr_mem_dict t1 + WHERE + DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + AND t1.delete_date IS NULL + AND opr_type = "登录" + AND result = 1 + GROUP BY + user_id + ) t2 ON t3.user_id = t2.user_id + ) t5 + LEFT JOIN ( + SELECT + t1.class_id, + t1.member_id, + sum( t1.play_length ) AS learnTime, + sum( t1.play_length + t1.suspend_length ) AS playTime + FROM + vod_play_history t1 + WHERE + DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + AND t1.delete_date IS NULL + GROUP BY + t1.class_id, + t1.member_id + ) t2 ON t5.user_id = t2.member_id + LEFT JOIN class_dict t3 ON t2.class_id = t3.id + LEFT JOIN member t4 ON t2.member_id = t4.id where t3.class_type = #{classType} @@ -179,7 +181,7 @@ FROM activity_detection t1 WHERE - DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND t1.delete_date IS NULL AND t1.member_id = #{memberId} @@ -194,7 +196,7 @@ image_check_record t1 WHERE class_id =#{classId} - AND DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + AND DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND t1.paper_id IS NOT NULL and t1.result =1 AND t1.member_id=#{memberId} @@ -212,7 +214,7 @@ FROM opr_mem_dict t1 WHERE - DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND t1.delete_date IS NULL AND t1.user_id = #{memberId} AND opr_type = "登出" @@ -226,7 +228,7 @@ FROM opr_mem_dict t1 WHERE - DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND t1.delete_date IS NULL AND t1.user_id = #{memberId} AND opr_type = "登录" @@ -244,7 +246,7 @@ AND t.result = 1 AND t.delete_date IS NULL AND opr_type = "登录" - AND DATE_FORMAT( DATE_ADD( create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( + AND DATE_FORMAT( DATE_ADD( create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) @@ -261,7 +263,7 @@ AND t.result = 1 AND t.delete_date IS NULL AND opr_type = "登出" - AND DATE_FORMAT( DATE_ADD( create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( + AND DATE_FORMAT( DATE_ADD( create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) @@ -295,7 +297,7 @@ WHERE t1.delete_date IS NULL AND t2.class_type = #{classType} - AND DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( + AND DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) @@ -312,7 +314,7 @@ LEFT JOIN member t2 ON t1.member_id = t2.id WHERE t1.delete_date IS NULL - AND DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + AND DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) and class_id = #{classId} @@ -346,7 +348,7 @@ exercise_done_result t1 WHERE t1.delete_date IS NULL - AND DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + AND DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND class_id = #{classId} AND member_id = #{memberId} @@ -377,7 +379,7 @@ LEFT JOIN class_dict t2 ON t1.class_id = t2.id LEFT JOIN member t3 ON t1.ask_id = t3.id WHERE - DATE_FORMAT( DATE_ADD( t1.update_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + DATE_FORMAT( DATE_ADD( t1.update_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND t1.delete_date IS NULL AND t2.delete_date IS NULL AND t3.delete_date IS NULL @@ -392,7 +394,7 @@ left join class_dict t2 on t.class_id = t2.id WHERE t.delete_date IS NULL - AND DATE_FORMAT( DATE_ADD( t.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( + AND DATE_FORMAT( DATE_ADD( t.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) @@ -418,7 +420,7 @@ class_id = #{classId} AND t1.delete_date IS NULL and t2.delete_date is null - AND DATE_FORMAT( DATE_ADD( t1.update_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( + AND DATE_FORMAT( DATE_ADD( t1.update_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) @@ -437,7 +439,7 @@ LEFT JOIN member t2 ON t1.member_id = t2.id WHERE class_id = #{classId} - AND DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + AND DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND t1.paper_id IS NOT NULL AND t1.result = 1 @@ -457,7 +459,7 @@ WHERE t1.delete_date is null and class_id = #{classId} - AND DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + AND DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND t1.paper_id IS NULL AND t1.result = 1 and t1.member_id @@ -480,7 +482,7 @@ LEFT JOIN member t2 ON t1.member_id = t2.id WHERE t1.delete_date is null - AND DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + AND DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) and class_id = #{classId} AND t1.paper_id IS not NULL AND t1.result = 1 @@ -500,7 +502,7 @@ FROM vod_play_history t WHERE - DATE_FORMAT( DATE_ADD( t.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + DATE_FORMAT( DATE_ADD( t.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND t.delete_date IS NULL ) t2 ON t.id = t2.class_id WHERE @@ -519,7 +521,7 @@ FROM exercise_done_result t WHERE - DATE_FORMAT( DATE_ADD( t.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + DATE_FORMAT( DATE_ADD( t.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND t.delete_date IS NULL ) t2 ON t.id = t2.class_id WHERE @@ -538,7 +540,7 @@ FROM answering_question t WHERE - DATE_FORMAT( DATE_ADD( t.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + DATE_FORMAT( DATE_ADD( t.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND t.delete_date IS NULL ) t2 ON t.id = t2.class_id WHERE @@ -557,7 +559,7 @@ FROM image_check_record t WHERE - DATE_FORMAT( DATE_ADD( t.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + DATE_FORMAT( DATE_ADD( t.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND t.delete_date IS NULL AND t.result = 1 ) t2 ON t.id = t2.class_id diff --git a/src/main/resources/mapper/SignInRecordMapper.xml b/src/main/resources/mapper/SignInRecordMapper.xml index 38951e0..99f6940 100644 --- a/src/main/resources/mapper/SignInRecordMapper.xml +++ b/src/main/resources/mapper/SignInRecordMapper.xml @@ -55,7 +55,7 @@ delete_date IS NULL AND date(sign_in_date) = date_sub( curdate(), - interval 0 day) + interval 1 day)