Commit b9001907 by 涂亚平

补贴培训第3次上课熬夜改数据

1 parent 9c71b838
...@@ -80,8 +80,8 @@ public class VodPlayHistoryController { ...@@ -80,8 +80,8 @@ public class VodPlayHistoryController {
@GetMapping("testPlays") @GetMapping("testPlays")
@ApiOperation("解决有交叉时间的数据 classId") @ApiOperation("解决有交叉时间的数据 classId")
public ResponseVO testPlays(@RequestParam("classId") Long classId ){ public ResponseVO testPlays(){
return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.testPlays(classId)); return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.testPlays());
} }
@PostMapping("warning") @PostMapping("warning")
......
...@@ -10,13 +10,14 @@ import com.subsidy.vo.vod.VodPlayStateVO; ...@@ -10,13 +10,14 @@ import com.subsidy.vo.vod.VodPlayStateVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
//@Component @Component
public class WarningJob { public class WarningJob {
/** /**
...@@ -67,11 +68,6 @@ public class WarningJob { ...@@ -67,11 +68,6 @@ public class WarningJob {
} }
} }
// List<String> telephones = Arrays.asList(new String[]{"15201936167", "18201963812", "18217669021"});
// telephones.stream().forEach(x -> {
// smsUtils.sendVerifySMS("SMS_460945631", x, result.toString());
// });
if (result.size()>0){ if (result.size()>0){
List<String> telephones = Arrays.asList(new String[]{"15201936167", "18201963812", "18217669021"}); List<String> telephones = Arrays.asList(new String[]{"15201936167", "18201963812", "18217669021"});
for (String telephone : telephones){ for (String telephone : telephones){
......
...@@ -37,7 +37,7 @@ public interface RenSheJuMapper { ...@@ -37,7 +37,7 @@ public interface RenSheJuMapper {
/** /**
* 前一天新增视频学习数据 * 前一天新增视频学习数据
*/ */
List<DailyStudyInfoVO> dailyStudyInfo(String classType); List<DailyStudyInfoVO> dailyStudyInfo(String classId);
/** /**
* 前一天活跃度检测列表 * 前一天活跃度检测列表
......
...@@ -8,6 +8,7 @@ import com.subsidy.model.VodPlayHistoryDO; ...@@ -8,6 +8,7 @@ import com.subsidy.model.VodPlayHistoryDO;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.vo.vod.VodPlayStateVO; import com.subsidy.vo.vod.VodPlayStateVO;
import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
...@@ -33,7 +34,7 @@ public interface VodPlayHistoryService extends IService<VodPlayHistoryDO> { ...@@ -33,7 +34,7 @@ public interface VodPlayHistoryService extends IService<VodPlayHistoryDO> {
void playLengthFix(RemainSecondsDTO remainSecondsDTO); void playLengthFix(RemainSecondsDTO remainSecondsDTO);
HashSet<Long> testPlays(Long classId); HashMap<Long, HashSet<Long>> testPlays();
void warning(); void warning();
......
...@@ -30,6 +30,12 @@ public class DudaoServiceImpl implements DudaoService { ...@@ -30,6 +30,12 @@ public class DudaoServiceImpl implements DudaoService {
*/ */
public static final String PREFIX_URL = "http://180.167.195.117:18015/ddproject"; public static final String PREFIX_URL = "http://180.167.195.117:18015/ddproject";
/**
* 正式环境
*/
public static final String PROD_URL = "http://180.167.195.117:18025/ddproject";
@Autowired @Autowired
private RenSheJuMapper renSheJuMapper; private RenSheJuMapper renSheJuMapper;
......
...@@ -102,27 +102,27 @@ public class RenSheJuServiceImpl implements RenSheJuService { ...@@ -102,27 +102,27 @@ public class RenSheJuServiceImpl implements RenSheJuService {
System.out.println(JSONObject.fromObject(classBaseInfoDTO).toString()); System.out.println(JSONObject.fromObject(classBaseInfoDTO).toString());
// RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(classBaseInfoDTO).toString()); RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(classBaseInfoDTO).toString());
// Request request = new Request.Builder() Request request = new Request.Builder()
// .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClass") .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClass")
// .method("POST", body) .method("POST", body)
// .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)")
// .addHeader("Content-Type", "application/json") .addHeader("Content-Type", "application/json")
// .build(); .build();
// Response response = client.newCall(request).execute(); Response response = client.newCall(request).execute();
//
// RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class); RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class);
// RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
// renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_2); renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_2);
// renshejuHistoryDO.setInputParam(JSONObject.fromObject(classBaseInfoDTO).toString()); renshejuHistoryDO.setInputParam(JSONObject.fromObject(classBaseInfoDTO).toString());
// if (200 == response.code()) { if (200 == response.code()) {
// renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString());
// } else { } else {
// renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR);
// } }
// renshejuHistoryMapper.insert(renshejuHistoryDO); renshejuHistoryMapper.insert(renshejuHistoryDO);
// return rensheResponseVO; return rensheResponseVO;
return null; // return null;
} else { } else {
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_2); renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_2);
...@@ -155,88 +155,89 @@ public class RenSheJuServiceImpl implements RenSheJuService { ...@@ -155,88 +155,89 @@ public class RenSheJuServiceImpl implements RenSheJuService {
List<ClassHourBasic> classHourBasics = new ArrayList<>(); List<ClassHourBasic> classHourBasics = new ArrayList<>();
try { try {
//前一天新增视频学习数据的班级 //看视频的班级
List<DailyStudyInfoVO> dailyStudyInfoVOS = renSheJuMapper.dailyStudyInfo("0"); List<DailyStudyInfoVO> dailyStudyInfoVOS = renSheJuMapper.dailyStudyInfo("0");
for (DailyStudyInfoVO dailyStudyInfoVO : dailyStudyInfoVOS) { for (DailyStudyInfoVO dailyStudyInfoVO : dailyStudyInfoVOS) {
ClassHourBasic classHourBasic = new ClassHourBasic(); ClassHourBasic classHourBasic = new ClassHourBasic();
BeanUtils.copyProperties(dailyStudyInfoVO, classHourBasic); BeanUtils.copyProperties(dailyStudyInfoVO, classHourBasic);
classHourBasic.setDownCode(dailyStudyInfoVO.getDownCode()); classHourBasic.setDownCode(dailyStudyInfoVO.getDownCode());
//上线时间列表 //上线时间列表
//找到当天每次上线下线时间 //找到当天每次上线下线时间
//上线时间 //上线时间
List<OprMemDictDO> loginRecords = renSheJuMapper.loginRecords(dailyStudyInfoVO.getMemberId()); List<OprMemDictDO> loginRecords = renSheJuMapper.loginRecords(dailyStudyInfoVO.getMemberId());
//下线时间 //下线时间
List<OprMemDictDO> loginOutRecords = renSheJuMapper.loginOutRecords(dailyStudyInfoVO.getMemberId()); List<OprMemDictDO> loginOutRecords = renSheJuMapper.loginOutRecords(dailyStudyInfoVO.getMemberId());
List<LoginList> loginLists = new ArrayList<>(); List<LoginList> loginLists = new ArrayList<>();
for (int i = 0; i < loginRecords.size(); i++) { for (int i = 0; i < loginRecords.size(); i++) {
LoginList loginList = new LoginList(); LoginList loginList = new LoginList();
loginList.setIp(loginRecords.get(i).getIpAddress()); loginList.setIp(loginRecords.get(i).getIpAddress());
loginList.setStartTime(Timestamp.valueOf(loginRecords.get(i).getCreateDate()).getTime()); loginList.setStartTime(Timestamp.valueOf(loginRecords.get(i).getCreateDate()).getTime());
loginList.setEndTime(Timestamp.valueOf(loginOutRecords.get(i).getCreateDate()).getTime()); loginList.setEndTime(Timestamp.valueOf(loginOutRecords.get(i).getCreateDate()).getTime());
//查看这个人该时间段的学习记录 //查看这个人该时间段的学习记录
List<ChapterList3> chapterList3s = renSheJuMapper.dailyStudyRecords(dailyStudyInfoVO.getMemberId(), dailyStudyInfoVO.getDownCode(), loginRecords.get(i).getCreateDate().toString().replace("T", " "), loginOutRecords.get(i).getCreateDate().toString().replace("T", " ")); List<ChapterList3> chapterList3s = renSheJuMapper.dailyStudyRecords(dailyStudyInfoVO.getMemberId(), dailyStudyInfoVO.getDownCode(), loginRecords.get(i).getCreateDate().toString().replace("T", " "), loginOutRecords.get(i).getCreateDate().toString().replace("T", " "));
if (chapterList3s.size() > 0) { if (chapterList3s.size() > 0) {
loginList.setChapterList(chapterList3s); loginList.setChapterList(chapterList3s);
loginLists.add(loginList); loginLists.add(loginList);
}
} }
} classHourBasic.setLoginList(loginLists);
classHourBasic.setLoginList(loginLists);
//活跃度列表 //活跃度列表
List<ActivityList> activityLists = new ArrayList<>(); List<ActivityList> activityLists = new ArrayList<>();
List<DailyActivitiesVO> activityDetectionDOS = renSheJuMapper.dailyActivities(dailyStudyInfoVO.getDownCode(), dailyStudyInfoVO.getMemberId()); List<DailyActivitiesVO> activityDetectionDOS = renSheJuMapper.dailyActivities(dailyStudyInfoVO.getDownCode(), dailyStudyInfoVO.getMemberId());
for (DailyActivitiesVO dailyActivitiesVO : activityDetectionDOS) { for (DailyActivitiesVO dailyActivitiesVO : activityDetectionDOS) {
ActivityList activityList = new ActivityList(); ActivityList activityList = new ActivityList();
if (null == dailyActivitiesVO.getAccess() || 0 == dailyActivitiesVO.getAccess()) { if (null == dailyActivitiesVO.getAccess() || 0 == dailyActivitiesVO.getAccess()) {
activityList.setAccess(1); activityList.setAccess(1);
activityList.setErrorInfo(2); activityList.setErrorInfo(2);
} else { } else {
activityList.setAccess(0); activityList.setAccess(0);
} }
if (0 == dailyActivitiesVO.getCheckType()) { if (0 == dailyActivitiesVO.getCheckType()) {
activityList.setActivityDetection(2); activityList.setActivityDetection(2);
} else if (1 == dailyActivitiesVO.getCheckType()) { } else if (1 == dailyActivitiesVO.getCheckType()) {
activityList.setActivityDetection(1); activityList.setActivityDetection(1);
} }
activityList.setActivityTime(dailyActivitiesVO.getActivityTime()); activityList.setActivityTime(dailyActivitiesVO.getActivityTime());
activityLists.add(activityList); activityLists.add(activityList);
}
classHourBasic.setActivityList(activityLists);
classHourBasics.add(classHourBasic);
} }
classHourBasic.setActivityList(activityLists);
classHourBasics.add(classHourBasic);
}
classHourBehaviorDTO.setClassHourBasic(classHourBasics); classHourBehaviorDTO.setClassHourBasic(classHourBasics);
System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(classHourBehaviorDTO)); System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(classHourBehaviorDTO));
if (classHourBasics.size()>0){ if (classHourBasics.size()>0){
// RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(classHourBehaviorDTO).toString()); RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(classHourBehaviorDTO).toString());
//
// Request request = new Request.Builder() Request request = new Request.Builder()
// .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClassHourBehavior") .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClassHourBehavior")
// .method("POST", body) .method("POST", body)
// .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)")
// .addHeader("Content-Type", "application/json") .addHeader("Content-Type", "application/json")
// .build(); .build();
// Response response = client.newCall(request).execute(); Response response = client.newCall(request).execute();
//
// RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class); RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class);
// RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
// renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3); renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3);
// renshejuHistoryDO.setInputParam(JSONObject.fromObject(classHourBehaviorDTO).toString()); renshejuHistoryDO.setInputParam(JSONObject.fromObject(classHourBehaviorDTO).toString());
// if (200 == response.code()) { if (200 == response.code()) {
// renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString());
// } else { } else {
// renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR);
// } }
// renshejuHistoryMapper.insert(renshejuHistoryDO); renshejuHistoryMapper.insert(renshejuHistoryDO);
// return rensheResponseVO; return rensheResponseVO;
}else { }else {
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3); renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3);
......
...@@ -635,23 +635,27 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper, ...@@ -635,23 +635,27 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
// } // }
} }
public HashSet<Long> testPlays(Long classId) { public HashMap<Long, HashSet<Long>> testPlays() {
// String[] classIdArr = classIds.split(","); //查看当天产生视频学习的班级
HashSet<Long> result = new HashSet<>(); List<Long> classIds = vodPlayHistoryMapper.dailyVodRecord();
// for (String classId : classIdArr) {
List<ClassMemberMappingDO> classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper<ClassMemberMappingDO>() HashMap<Long, HashSet<Long>> hashMap = new HashMap();
.lambda()
.eq(ClassMemberMappingDO::getClassId, classId)); for (Long classId : classIds) {
for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { List<ClassMemberMappingDO> classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper<ClassMemberMappingDO>()
List<VodPlayStateVO> vodPlayStateVOS = vodDictMapper.testPlays(classMemberMappingDO.getMemberId(), Long.valueOf(classId)); .lambda()
for (int i = 0; i < vodPlayStateVOS.size() - 1; i++) { .eq(ClassMemberMappingDO::getClassId, classId));
VodPlayStateVO vodPlayStateVO = vodPlayStateVOS.get(i + 1); //后面 HashSet<Long> result = new HashSet<>();
VodPlayStateVO vodPlayStateVO1 = vodPlayStateVOS.get(i); //前面 for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) {
if (vodPlayStateVO1.getEndDate().getTime() > vodPlayStateVO.getStartDate().getTime()) { List<VodPlayStateVO> vodPlayStateVOS = vodDictMapper.testPlays(classMemberMappingDO.getMemberId(), Long.valueOf(classId));
//这一条数据有问题 for (int i = 0; i < vodPlayStateVOS.size() - 1; i++) {
System.out.println("111111111111111111111" + vodPlayStateVO); VodPlayStateVO vodPlayStateVO = vodPlayStateVOS.get(i + 1); //后面
//查看这个人 这个课程 当天的全部数据 按照createDate升序排序 VodPlayStateVO vodPlayStateVO1 = vodPlayStateVOS.get(i); //前面
if (vodPlayStateVO1.getEndDate().getTime() > vodPlayStateVO.getStartDate().getTime()) {
//这一条数据有问题
// System.out.println("111111111111111111111" + vodPlayStateVO);
//查看这个人 这个课程 当天的全部数据 按照createDate升序排序
// List<VodPlayHistoryDO> vodPlayHistoryDOS = this.baseMapper.getVodPlayDay(Long.valueOf(classId), classMemberMappingDO.getMemberId(), vodPlayStateVO.getStartDate()); // List<VodPlayHistoryDO> vodPlayHistoryDOS = this.baseMapper.getVodPlayDay(Long.valueOf(classId), classMemberMappingDO.getMemberId(), vodPlayStateVO.getStartDate());
// //从第一条开始看,顺延减去第二条的playlength得到第二条的create_date 以此类推 // //从第一条开始看,顺延减去第二条的playlength得到第二条的create_date 以此类推
// for (int l = 0; l < vodPlayHistoryDOS.size() - 1; l++) { // for (int l = 0; l < vodPlayHistoryDOS.size() - 1; l++) {
...@@ -664,13 +668,14 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper, ...@@ -664,13 +668,14 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
// vph2.setPlayDate(dateTmp); // vph2.setPlayDate(dateTmp);
// this.baseMapper.updateById(vph2); // this.baseMapper.updateById(vph2);
// } // }
result.add(vodPlayStateVO.getId()); result.add(vodPlayStateVO.getId());
// break; // break;
}
} }
} }
hashMap.put(classId,result);
} }
// } return hashMap;
return result;
} }
public void warning() { public void warning() {
...@@ -691,7 +696,7 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper, ...@@ -691,7 +696,7 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
VodPlayStateVO vodPlayStateVO = vodPlayStateVOS.get(i + 1); //后面 VodPlayStateVO vodPlayStateVO = vodPlayStateVOS.get(i + 1); //后面
VodPlayStateVO vodPlayStateVO1 = vodPlayStateVOS.get(i); //前面 VodPlayStateVO vodPlayStateVO1 = vodPlayStateVOS.get(i); //前面
if (vodPlayStateVO1.getEndDate().getTime() > vodPlayStateVO.getStartDate().getTime()) { if (vodPlayStateVO1.getEndDate().getTime() > vodPlayStateVO.getStartDate().getTime()) {
if (!result.contains(vodPlayStateVO1.getClassId())){ if (!result.contains(vodPlayStateVO1.getClassId())) {
result.add(vodPlayStateVO.getClassId()); result.add(vodPlayStateVO.getClassId());
} }
} }
...@@ -699,12 +704,13 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper, ...@@ -699,12 +704,13 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
} }
} }
if (result.size()>0){ System.out.println(result.toString());
List<String> telephones = Arrays.asList(new String[]{"15201936167", "18201963812", "18217669021"}); // if (result.size()>0){
for (String telephone : telephones){ // List<String> telephones = Arrays.asList(new String[]{"15201936167", "18201963812", "18217669021"});
smsUtils.sendWarning("SMS_460945631", telephone, result.toString()); // for (String telephone : telephones){
} // smsUtils.sendWarning("SMS_460945631", telephone, result.toString());
} // }
// }
} }
//19为基数的话,3次签到6.5到8,4次签到4.8-6, //19为基数的话,3次签到6.5到8,4次签到4.8-6,
......
...@@ -105,70 +105,77 @@ ...@@ -105,70 +105,77 @@
<select id="dailyStudyInfo" resultType="com.subsidy.vo.renshe.DailyStudyInfoVO"> <select id="dailyStudyInfo" resultType="com.subsidy.vo.renshe.DailyStudyInfoVO">
SELECT SELECT
t2.class_id AS downCode, DISTINCT
t2.member_id, IFNULL(t2.class_id,t7.class_id) AS downCode,
t4.user_name AS studentName, t6.member_id,
t4.telephone AS phone, t4.user_name AS studentName,
t4.id_card AS identity, t4.telephone AS phone,
t2.learnTime, t4.id_card AS identity,
t2.playTime, IFNULL(t2.learnTime,0),
t5.loginTime IFNULL(t2.playTime,0),
t5.loginTime
FROM FROM
( class_member_mapping t6
LEFT JOIN member t4 ON t4.id = t6.member_id
LEFT JOIN (
SELECT SELECT
t3.user_id, t3.user_id,
login - logout AS loginTime login - logout AS loginTime ,
t3.create_date
FROM FROM
( (
SELECT SELECT
user_id, user_id,
sum( sum(
unix_timestamp( t1.create_date )) AS login unix_timestamp( t1.create_date )) AS login ,
create_date
FROM FROM
opr_mem_dict t1 opr_mem_dict t1
WHERE WHERE
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 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.delete_date IS NULL
AND opr_type = "登出" AND opr_type = "登出"
AND result = 1 AND result = 1
GROUP BY GROUP BY
user_id user_id
) t3 ) t3
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
user_id, user_id,
sum( sum(
unix_timestamp( t1.create_date )) AS logout unix_timestamp( t1.create_date )) AS logout ,
create_date
FROM FROM
opr_mem_dict t1 opr_mem_dict t1
WHERE WHERE
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 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.delete_date IS NULL
AND opr_type = "登录" AND opr_type = "登录"
AND result = 1 AND result = 1
GROUP BY GROUP BY
user_id user_id
) t2 ON t3.user_id = t2.user_id ) t2 ON t3.user_id = t2.user_id
) t5 ) t5 on t5.user_id = t4.id
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
t1.class_id, t1.class_id,
t1.member_id, t1.member_id,
sum( t1.play_length ) AS learnTime, sum( t1.play_length ) AS learnTime,
sum( t1.play_length + t1.suspend_length ) AS playTime sum( t1.play_length + t1.suspend_length ) AS playTime
FROM FROM
vod_play_history t1 vod_play_history t1
WHERE WHERE
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 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.delete_date IS NULL
GROUP BY GROUP BY
t1.class_id, t1.class_id,
t1.member_id t1.member_id
) t2 ON t5.user_id = t2.member_id ) t2 ON t5.user_id = t2.member_id
LEFT JOIN class_dict t3 ON t2.class_id = t3.id LEFT JOIN class_dict t3 ON t2.class_id = t3.id and t6.class_id = t3.id
LEFT JOIN member t4 ON t2.member_id = t4.id LEFT JOIN image_check_record t7 on t5.user_id = t7.member_id and DATE_FORMAT(t5.create_date,'%Y-%m-%d') = DATE_FORMAT(t7.create_date,'%Y-%m-%d') and t7.result = 1
where t6.delete_date is null and t5.loginTime is not null and IFNULL(t2.class_id,t7.class_id) is not null
<if test="classType != null and classType != ''"> <if test="classType != null and classType != ''">
where t3.class_type = #{classType} and t3.class_type = #{classType}
</if> </if>
</select> </select>
...@@ -254,8 +261,7 @@ ...@@ -254,8 +261,7 @@
</select> </select>
<select id="loginOutRecords" parameterType="long" resultType="com.subsidy.model.OprMemDictDO"> <select id="loginOutRecords" parameterType="long" resultType="com.subsidy.model.OprMemDictDO">
SELECT select distinct *
distinct *
FROM FROM
opr_mem_dict t opr_mem_dict t
WHERE WHERE
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!