Commit a830b155 by 涂亚平

合并前

1 parent 8b5bc638
......@@ -102,7 +102,7 @@ public class AdministerController {
@PostMapping("exportClassDetail")
@ApiOperation("班级管理--班级成员--导出 id 班级id userName")
@LoginRequired
// @LoginRequired
public void exportClassDetail(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{
classDetailDTO.setFlag(true);
administerService.exportClassDetail(classDetailDTO);
......@@ -225,7 +225,7 @@ public class AdministerController {
@PostMapping("imageCheckDetail")
@ApiOperation("实名制验证详情 id 班级id userName pageSize pageNum")
@LoginRequired
// @LoginRequired
public ResponseVO imageCheckDetail(@RequestBody ClassDetailDTO classDetailDTO){
return ResponseData.generateCreatedResponse(0,administerService.imageCheckDetail(classDetailDTO));
}
......
......@@ -53,7 +53,7 @@ public class ClassDictController {
}
@PostMapping("addClass")
@ApiOperation("添加班级 userId:登录人id companyId courseId classTypeId className startDate endDate testRule 是否视频看完再做测试 isOrder 是否按照顺序播放 isFastPlay 是否快进 memberIds [] 班级学员 classNoticeDOS[noticeType noticeTime]")
@ApiOperation("添加班级 userId:登录人id companyId courseId classTypeId(证书课程的话传0) className startDate endDate testRule 是否视频看完再做测试 isOrder 是否按照顺序播放 isFastPlay 是否快进 memberIds [] 班级学员 classNoticeDOS[noticeType noticeTime]")
@LoginRequired
public ResponseVO addClass(@RequestBody AddClassDTO addClassDTO){
return ResponseData.generateCreatedResponse(0,classDictService.addClass(addClassDTO));
......@@ -84,7 +84,7 @@ public class ClassDictController {
}
@PostMapping("getSpareMembers")
@ApiOperation("获取不在某班级的某企业里所有成员 companyId 企业id classId 班级id")
@ApiOperation("获取不在某班级的某企业里所有成员 companyId 企业id classId 班级id userName名称")
@LoginRequired
public ResponseVO getSpareMembers(@RequestBody GetSpareMembersDTO getSpareMembersDTO){
return ResponseData.generateCreatedResponse(0,classDictService.getSpareMembers(getSpareMembersDTO));
......@@ -118,4 +118,13 @@ public class ClassDictController {
return ResponseData.generateCreatedResponse(0,classDictService.email(classMemberMappingDO));
}
@PostMapping("getAllCertClasses")
@ApiOperation("获取证书课程下的所有班级 className 班级名称 openStatus 开放状态 startDate 开始时间 endDate 结束时间")
@LoginRequired
public ResponseVO getAllCertClasses(@RequestBody ClassDictDO classDictDO)throws Exception{
return ResponseData.generateCreatedResponse(0,classDictService.getAllCertClasses(classDictDO));
}
}
......@@ -110,13 +110,21 @@ public class MemberController {
}
@PostMapping("myCourses")
@ApiOperation("手机端:我的学习--课程 memberId 学员id status 状态 0:全部 1:进行中 2:待开始 3:已完成 ")
@ApiOperation("手机端:我的学习--补贴培训课程 memberId 学员id status 状态 0:全部 1:进行中 2:待开始 3:已完成 ")
// @LoginRequired
@TimeRequired
public ResponseVO myCourses(@RequestBody MyCoursesDTO myCoursesDTO){
return ResponseData.generateCreatedResponse(0,memberService.myCourses(myCoursesDTO));
}
@PostMapping("myCertCourses")
@ApiOperation("手机端:我的学习--证书课程 memberId 学员id status 状态 0:全部 1:进行中 2:待开始 3:已完成 ")
// @LoginRequired
@TimeRequired
public ResponseVO myCertCourses(@RequestBody MyCoursesDTO myCoursesDTO){
return ResponseData.generateCreatedResponse(0,memberService.myCertCourses(myCoursesDTO));
}
@PostMapping("contentVod")
@ApiOperation("手机端:目录+视频 classId 班级id courseId 课程 memberId 学员id")
@LoginRequired
......
......@@ -10,4 +10,6 @@ public class GetSpareMembersDTO {
private Long classId;
private String userName;
}
......@@ -61,4 +61,9 @@ public interface ClassDictMapper extends BaseMapper<ClassDictDO> {
* 通过班级id查看公司配置
*/
SystemSettings getCompanySettings(Long classId);
/**
* 获取证书的全部班级
*/
List<GetAllClassesVO> getAllCertClasses(ClassDictDO classDictDO);
}
......@@ -37,11 +37,16 @@ public interface MemberMapper extends BaseMapper<MemberDO> {
List<StudyPageVO> studyPage(MemberDO memberDO);
/**
* 查看学生的课程
* 查看学生的补贴培训课程
*/
List<MyCoursesVO> myCourses(Long memberId,Integer status);
/**
* 查看学生的证书课程
*/
List<MyCoursesVO> myCertCourses(Long memberId,Integer status);
/**
* 查询学生所在部门
*/
List<DepartmentDictDO> getDepartments(Long memberId);
......
......@@ -45,4 +45,7 @@ public interface ClassDictService extends IService<ClassDictDO> {
GetClassBaseInfoVO getClassBaseInfo(GetClassBaseInfoDTO getClassBaseInfoDTO);
String email(ClassMemberMappingDO classMemberMappingDO);
List<GetAllClassesVO> getAllCertClasses(ClassDictDO classDictDO)throws Exception;
}
......@@ -47,6 +47,8 @@ public interface MemberService extends IService<MemberDO> {
List<MyCoursesVO> myCourses(MyCoursesDTO myCoursesDTO);
List<MyCoursesVO> myCertCourses(MyCoursesDTO myCoursesDTO);
ContentVodNewVO contentVod(ContentMemberDTO contentVodDTO);
List<ContentFilesVO> contentFiles(ContentMemberDTO contentMemberDTO);
......
......@@ -608,8 +608,12 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
if (classDetailDTO.getFlag()) {
// CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId());
String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate();
if (null ==companyDictDO){
ExcelUtil.writeMemberExcel(null, studyDate, classDictDO.getClassName(), "授课记录汇总表", classDetailVOS, ExcelFormatUtils.memberList);
}else {
ExcelUtil.writeMemberExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "授课记录汇总表", classDetailVOS, ExcelFormatUtils.memberList);
}
}
return classDetailVOS;
}
......@@ -699,9 +703,15 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId());
// CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId());
String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate();
if (null == companyDictDO){
ExcelUtil.writeSignExcel(null, studyDate, classDictDO.getClassName(), "注册签到表", classSignVOS, ExcelFormatUtils.signList);
}else {
ExcelUtil.writeSignExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "注册签到表", classSignVOS, ExcelFormatUtils.signList);
}
}
return classSignVOS;
}
......@@ -764,8 +774,13 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
if (classDetailDTO.getFlag()) {
CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId());
String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate();
if (null == companyDictDO.getCompanyName()){
ExcelUtil.writeTestExcel(null, studyDate, classDictDO.getClassName(), "测试成绩表", exerciseTestVOS, ExcelFormatUtils.scoreList);
}else {
ExcelUtil.writeTestExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "测试成绩表", exerciseTestVOS, ExcelFormatUtils.scoreList);
}
}
return exerciseTestVOS;
}
......@@ -791,8 +806,14 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId());
CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId());
String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate();
if (null == companyDictDO){
ExcelUtil.writeAnswerExcel(null, studyDate, classDictDO.getClassName(), "答疑记录表", answerRecordVOS, ExcelFormatUtils.answersList);
}else {
ExcelUtil.writeAnswerExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "答疑记录表", answerRecordVOS, ExcelFormatUtils.answersList);
}
}
return answerRecordVOS;
}
......@@ -1065,7 +1086,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
int studyLength = 0;
for (String tt : title) {
if (!"姓名".equals(tt) && !"完成率".equals(tt) && !"学习时长(小时)".equals(tt) && !"序号".equals(tt) && !"学习时长".equals(tt)) {
if (!"姓名".equals(tt) && !"完成率".equals(tt) && !"学习时长(小时)".equals(tt) && !"序号".equals(tt) && !"学习时长(分钟)".equals(tt)) {
Cell cell1 = r.createCell(a.getAndIncrement());
if (null != hashMap) {
......@@ -1209,7 +1230,6 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId());
CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId());
CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId());
/**
* 班级成员
......@@ -1218,7 +1238,12 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
classDetailDTO.setFlag(false);
List<ClassDetailVO> classDetailVOS = exportClassDetail(classDetailDTO);
String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate();
if (null == companyDictDO){
membersListExcel(null, studyDate, classDictDO.getClassName(), "授课记录汇总表", ExcelFormatUtils.memberList, classDetailVOS, null, 0, baos);
}else {
membersListExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "授课记录汇总表", ExcelFormatUtils.memberList, classDetailVOS, null, 0, baos);
}
compressFileToZipStream(zipOutputStream, baos, "member.xlsx");
/**
......@@ -1227,7 +1252,13 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
ByteArrayOutputStream baos1 = new ByteArrayOutputStream();
classDetailDTO.setFlag(false);
List<ClassSignVO> classSignVOS = exportSignDetail(classDetailDTO);
if (null == companyDictDO.getCompanyName()){
signListExcel(null, studyDate, classDictDO.getClassName(), "注册签到", ExcelFormatUtils.signList, classSignVOS, null, 0, baos1);
}else {
signListExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "注册签到", ExcelFormatUtils.signList, classSignVOS, null, 0, baos1);
}
compressFileToZipStream(zipOutputStream, baos1, "sign.xlsx");
......@@ -1249,7 +1280,11 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
classDetailDTO.setFlag(false);
classDetailDTO.setPaperId(paperDictDOS.get(i).getId());
List<ExerciseTestVO> exerciseTestVOS = exportExerciseTest(classDetailDTO);
if (null ==companyDictDO){
testListExcel(null, studyDate, classDictDO.getClassName(), "测试成绩表", ExcelFormatUtils.scoreList, exerciseTestVOS, null, 0, baos2);
}else {
testListExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "测试成绩表", ExcelFormatUtils.scoreList, exerciseTestVOS, null, 0, baos2);
}
compressFileToZipStream(zipOutputStream, baos2, "test" + i + ".xlsx");
}
......@@ -1258,7 +1293,11 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
*/
ByteArrayOutputStream baos3 = new ByteArrayOutputStream();
List<AnswerRecordVO> answerRecordVOS = exportAnswerRecord(classDetailDTO);
if (null == companyDictDO.getCompanyName()){
askListExcel(null, studyDate, classDictDO.getClassName(), "答疑记录", ExcelFormatUtils.answersList, answerRecordVOS, null, 0, baos3);
}else {
askListExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "答疑记录", ExcelFormatUtils.answersList, answerRecordVOS, null, 0, baos3);
}
compressFileToZipStream(zipOutputStream, baos3, "answer.xlsx");
zipOutputStream.flush();
......
......@@ -287,4 +287,24 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
return ConstantUtils.SUCCESS_UPDATE;
}
public List<GetAllClassesVO> getAllCertClasses(ClassDictDO classDictDO) throws Exception {
DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
List<GetAllClassesVO> getAllClassesVOS = this.baseMapper.getAllCertClasses(classDictDO);
for (GetAllClassesVO getAllClassesVO : getAllClassesVOS) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(fmt.parse(getAllClassesVO.getEndDate()));
calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) + 1);
if (new Date().before(fmt.parse(getAllClassesVO.getStartDate()))) {
getAllClassesVO.setOpenStatus("1"); //待开始
} else if (new Date().after(calendar.getTime())) {
getAllClassesVO.setOpenStatus("2");
} else {
getAllClassesVO.setOpenStatus("0");
}
}
return getAllClassesVOS;
}
}
......@@ -712,6 +712,31 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
return myCoursesVOS;
}
public List<MyCoursesVO> myCertCourses(MyCoursesDTO myCoursesDTO) {
List<MyCoursesVO> myCoursesVOS = this.baseMapper.myCourses(myCoursesDTO.getMemberId(), myCoursesDTO.getStatus());
for (MyCoursesVO myCoursesVO : myCoursesVOS) {
List<FieldDictDO> fieldDictDOS = courseFieldMappingMapper.courseFields(myCoursesVO.getCourseId());
myCoursesVO.setFieldDictDOS(fieldDictDOS);
int count = imageCheckRecordMapper.selectCount(new QueryWrapper<ImageCheckRecordDO>()
.lambda()
.eq(ImageCheckRecordDO::getMemberId, myCoursesDTO.getMemberId())
.eq(ImageCheckRecordDO::getClassId, myCoursesVO.getClassId())
.isNull(ImageCheckRecordDO::getPaperId)
.eq(ImageCheckRecordDO::getCheckPlace, 0)
.eq(ImageCheckRecordDO::getResult, 1));
int checkCnt = imageCheckRecordMapper.checkDailyCount(myCoursesDTO.getMemberId(), myCoursesVO.getClassId(), 1, null);
myCoursesVO.setCheckCnt(checkCnt);
if (count > 0) {
myCoursesVO.setResult(1);
} else {
myCoursesVO.setResult(0);
}
}
return myCoursesVOS;
}
public ContentVodNewVO contentVod(ContentMemberDTO contentVodDTO) {
ContentVodNewVO contentVodNewVO = new ContentVodNewVO();
......
......@@ -631,7 +631,7 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
public HashSet<Long> testPlays(VodPlayHistoryDO vodPlayHistoryDO) {
String classIds = "357,358,359";
String classIds = "";
String[] classIdArr = classIds.split(",");
......
......@@ -12,6 +12,8 @@ public class ClassDailyInfoVO {
private String userName;
private String companyName;
private List<DayInfoItemVO> dayInfoItemVOS;
private Integer total;
......
......@@ -32,4 +32,6 @@ public class ExerciseTestVO {
private String endDate;
private String companyName;
}
......@@ -9,6 +9,8 @@ public class ImageCheckDetailVO {
private String userName;
private String companyName;
private String accountName;
private String telephone;
......
......@@ -24,4 +24,6 @@ public class MemberDetectionRecordVO {
@ExcelColumn(col = 5,value = "检测次数")
private Integer cnt;
private String companyName;
}
......@@ -90,4 +90,9 @@ public class ClassDetailVO{
private List<GetMaxScoreVO> getMaxScoreVOS;
/**
* 公司名称
*/
private String companyName;
}
......@@ -36,6 +36,7 @@ public class ClassSignVO {
*/
private String deviceNo;
private String companyName;
......
......@@ -23,4 +23,7 @@ public class AnswerRecordVO {
@ExcelColumn(col = 5,value = "答疑时间")
private String updateDate;
private String companyName;
}
# 环境配置
spring.profiles.active=prod
spring.profiles.active=dev
#和CPU数
spring.server.acceptorThreadCount=600
spring.server.minSpareThreads=100
......
......@@ -51,10 +51,12 @@
t2.id_card,
t2.account_name,
t2.telephone,
t.email
t.email,
t3.company_name
FROM
class_member_mapping t
LEFT JOIN member t2 ON t.member_id = t2.id
left join company_dict t3 on t2.company_id = t3.id
where t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.class_id = #{classId}
......@@ -70,10 +72,12 @@
t2.user_name,
t2.account_name,
t2.telephone,
t2.id_card
t2.id_card,
t3.company_name
FROM
class_member_mapping t
LEFT JOIN member t2 ON t.member_id = t2.id
left join company_dict t3 on t2.company_id = t3.id
where t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.class_id = #{classId}
......@@ -89,10 +93,12 @@
t2.user_name,
t2.account_name,
t2.telephone,
t2.id_card
t2.id_card,
t3.company_name
FROM
class_member_mapping t
LEFT JOIN member t2 ON t.member_id = t2.id
left join company_dict t3 on t2.company_id = t3.id
where t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.class_id = #{classId}
......@@ -109,10 +115,12 @@
t.answer,
t2.user_name,
t.create_date,
t.update_date
t.update_date,
t3.company_name
FROM
answering_question t
LEFT JOIN member t2 ON t.ask_id = t2.id
left join company_dict t3 on t2.company_id = t3.id
WHERE
t.delete_date IS NULL
AND t.class_id = #{classId}
......@@ -129,12 +137,14 @@
t2.account_name,
t2.telephone,
t2.id_card,
t4.company_name,
count( t3.id ) as cnt
FROM
class_member_mapping t
LEFT JOIN member t2 ON t.member_id = t2.id
LEFT JOIN activity_detection t3 ON t.class_id = t3.class_id
AND t.member_id = t3.member_id
left join company_dict t4 on t2.company_id = t4.id
where t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.class_id = #{classId}
......@@ -152,6 +162,7 @@
t1.user_name,
t1.account_name,
t1.telephone,
t1.company_name,
t1.id_card,
cnt,
recentDate
......@@ -163,12 +174,14 @@
t2.account_name,
t2.telephone,
t2.id_card,
t4.company_name,
count( t3.id ) AS cnt
FROM
class_member_mapping t
LEFT JOIN member t2 ON t.member_id = t2.id
LEFT JOIN image_check_record t3 ON t.class_id = t3.class_id
AND t.member_id = t3.member_id
left join company_dict t4 on t2.company_id = t4.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
......
......@@ -102,6 +102,9 @@
WHERE
t3.delete_date IS NULL
AND t3.class_id = #{classId})
<if test="userName != null and userName !=''">
and t2.user_name like concat('%',#{userName} ,'%')
</if>
</select>
<select id="classMembers" parameterType="long" resultType="com.subsidy.model.MemberDO">
......@@ -213,4 +216,36 @@
AND t.id = #{classId}
</select>
<select id="getAllCertClasses" resultType="com.subsidy.vo.classdict.GetAllClassesVO">
SELECT
t.id,
t2.id as courseId,
t.class_name,
t2.course_name,
t.start_date,
t.end_date,
t4.cnt,
t5.class_type,
t5.id as class_type_id
FROM
class_dict t
left join class_type_dict t5 on t.class_type_id = t5.id
LEFT JOIN course_dict t2 ON t.course_id = t2.id
LEFT JOIN ( SELECT t3.class_id, sum( 1 ) AS cnt FROM class_member_mapping t3 WHERE t3.delete_date IS NULL GROUP
BY t3.class_id ) t4 ON t.id = t4.class_id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
and t5.delete_date is null
and t5.id = 0
<if test="className != null and className !=''">
and t.class_name like concat('%',#{className} ,'%')
</if>
<if test="startDate != null and endDate != null and startDate != '' and endDate != ''">
and t.end_date >= DATE_FORMAT( #{startDate}, '%Y-%m-%d' )
and t.start_date &lt; DATE_FORMAT( #{endDate}, '%Y-%m-%d' )
</if>
order by t.create_date desc
</select>
</mapper>
......@@ -48,10 +48,12 @@
<select id="getClassMembersWithName" resultType="com.subsidy.vo.administer.ClassDailyInfoVO">
SELECT
t2.id,
t2.user_name
t2.user_name,
t3.company_name
FROM
class_member_mapping t
left join member t2 on t.member_id = t2.id
left join company_dict t3 on t2.company_id = t3.id
WHERE
t.delete_date IS NULL
and t2.delete_date is null
......
......@@ -95,6 +95,9 @@
t.delete_date IS NULL
AND t2.delete_date IS NULL
and t.company_id = #{companyId}
<if test="userName != null and userName != ''">
and t.user_name like concat('%',#{userName} ,'%')
</if>
</select>
</mapper>
......@@ -136,6 +136,7 @@
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t3.delete_date IS NULL
and t2.class_type_id != 0
AND t.member_id = #{memberId}
<if test="status ==1">
AND DATE_FORMAT(now(), '%Y-%m-%d') >= DATE_FORMAT(start_date, '%Y-%m-%d')
......@@ -150,6 +151,96 @@
order by t2.create_date desc
</select>
<select id="myCertCourses" parameterType="long" resultType="com.subsidy.vo.member.MyCoursesVO">
SELECT
t3.id AS courseId,
t2.id AS classId,
t2.class_name,
t3.course_name,
t2.start_date,
t2.end_date,
t4.cnt AS totalCnt,
t5.result AS studyCnt,
t6.ttlMember,
t2.is_order,
t2.is_fast_play,
t.email_status,
if(
TIMESTAMPDIFF(
DAY,
DATE_FORMAT( NOW(), '%Y-%m-%d' ),
t2.end_date)>0,TIMESTAMPDIFF(
DAY,
DATE_FORMAT( NOW(), '%Y-%m-%d' ),
t2.end_date),0) AS diffDate
FROM
class_member_mapping t
LEFT JOIN ( SELECT t.class_id, count( 1 ) ttlMember FROM class_member_mapping t WHERE t.delete_date IS NULL
GROUP BY t.class_id ) t6 ON t.class_id = t6.class_id
LEFT JOIN class_dict t2 ON t.class_id = t2.id
LEFT JOIN course_dict t3 ON t2.course_id = t3.id
LEFT JOIN (
SELECT
t.course_id,
count( 1 ) AS cnt
FROM
course_content t
LEFT JOIN content_vod_mapping t2 ON t.id = t2.content_id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
and t2.id is not null
GROUP BY
t.course_id
) t4 ON t3.id = t4.course_id
LEFT JOIN (
SELECT
t1.member_id,
t1.class_id,
sum( result ) AS result
FROM
(
SELECT
t.member_id,
t.vod_id,
t.class_id,
sum( t.play_length ) AS play_length,
t2.vod_length,
IF
( sum( t.play_length )>= t2.vod_length, 1, 0 ) AS result
FROM
vod_play_history t
LEFT JOIN vod_dict t2 ON t.vod_id = t2.id
WHERE
t.member_id = #{memberId}
GROUP BY
t.member_id,
t.vod_id,
t.class_id
) t1
GROUP BY
t1.member_id,
t1.class_id
) t5 ON t.class_id = t5.class_id
AND t.member_id = t5.member_id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t3.delete_date IS NULL
and t2.class_type_id = 0
AND t.member_id = #{memberId}
<if test="status ==1">
AND DATE_FORMAT(now(), '%Y-%m-%d') >= DATE_FORMAT(start_date, '%Y-%m-%d')
AND DATE_FORMAT(now(), '%Y-%m-%d') &lt;= DATE_FORMAT(end_date, '%Y-%m-%d')
</if>
<if test="status ==2">
AND DATE_FORMAT(now(), '%Y-%m-%d') &lt; DATE_FORMAT(start_date, '%Y-%m-%d')
</if>
<if test="status ==3">
AND DATE_FORMAT(now(), '%Y-%m-%d') > DATE_FORMAT(end_date, '%Y-%m-%d')
</if>
order by t2.create_date desc
</select>
<select id="getDepartments" parameterType="long" resultType="com.subsidy.model.DepartmentDictDO">
SELECT
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!