parent
916ec7e066
commit
41f0ed1ee3
|
|
@ -0,0 +1,43 @@
|
|||
package com.zcloud.edu.app.study;
|
||||
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.edu.api.study.ClassServiceI;
|
||||
import com.zcloud.edu.dto.clientobject.study.ClassCO;
|
||||
import com.zcloud.edu.dto.data.study.ClassQuestionDTO;
|
||||
import com.zcloud.edu.dto.study.ClassAddCmd;
|
||||
import com.zcloud.edu.dto.study.ClassPageQry;
|
||||
import com.zcloud.edu.dto.study.ClassPostponeCmd;
|
||||
import com.zcloud.edu.dto.study.ClassUpdateCmd;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* web-adapter
|
||||
*
|
||||
* @Author zhangyue
|
||||
* @Date 2026-01-13 14:18:11
|
||||
*/
|
||||
@Api(tags = "班级信息")
|
||||
@RequestMapping("/${application.gateway}/app/class")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class AppClassController {
|
||||
private final ClassServiceI classService;
|
||||
|
||||
@ApiOperation("分页")
|
||||
@PostMapping("/list")
|
||||
public PageResponse<ClassCO> page(@RequestBody ClassPageQry qry) {
|
||||
return classService.appListPage(qry);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -10,6 +10,7 @@ import com.zcloud.edu.dto.clientobject.study.ClassCO;
|
|||
import com.zcloud.edu.dto.data.study.ClassQuestionDTO;
|
||||
import com.zcloud.edu.dto.study.ClassAddCmd;
|
||||
import com.zcloud.edu.dto.study.ClassPageQry;
|
||||
import com.zcloud.edu.dto.study.ClassPostponeCmd;
|
||||
import com.zcloud.edu.dto.study.ClassUpdateCmd;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
|
@ -44,7 +45,6 @@ public class ClassController {
|
|||
return classService.countQuestionByClassId(id);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("分页")
|
||||
@PostMapping("/list")
|
||||
public PageResponse<ClassCO> page(@RequestBody ClassPageQry qry) {
|
||||
|
|
@ -56,15 +56,20 @@ public class ClassController {
|
|||
public MultiResponse<ClassCO> listAll() {
|
||||
return MultiResponse.of(new ArrayList<ClassCO>());
|
||||
}
|
||||
@ApiOperation("统计班级人数")
|
||||
@GetMapping("/countClassStudent")
|
||||
public MultiResponse<ClassCO> countClassStudent() {
|
||||
return MultiResponse.of(new ArrayList<ClassCO>());
|
||||
}
|
||||
|
||||
@ApiOperation("详情")
|
||||
@GetMapping("/{id}")
|
||||
public SingleResponse<ClassCO> getInfoById(@PathVariable("id") Long id) {
|
||||
return SingleResponse.of(new ClassCO());
|
||||
return classService.getInfoById(id);
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
@DeleteMapping("/{id}")
|
||||
@PostMapping("/{id}")
|
||||
public Response remove(@PathVariable("id") Long id) {
|
||||
classService.remove(id);
|
||||
return SingleResponse.buildSuccess();
|
||||
|
|
@ -83,5 +88,12 @@ public class ClassController {
|
|||
classService.edit(classUpdateCmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("延期")
|
||||
@PutMapping("/postpone")
|
||||
public SingleResponse postpone(@Validated @RequestBody ClassPostponeCmd classUpdateCmd) {
|
||||
classService.postpone(classUpdateCmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class ClassExamPaperController {
|
|||
@ApiOperation("详情")
|
||||
@GetMapping("/{id}")
|
||||
public SingleResponse<ClassExamPaperCO> getInfoById(@PathVariable("id") Long id) {
|
||||
return SingleResponse.of(new ClassExamPaperCO());
|
||||
return classExamPaperService.getInfoById(id);
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.zcloud.edu.command.query.study;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.edu.command.convertor.study.ClassExamPaperCoConvertor;
|
||||
import com.zcloud.edu.dto.clientobject.study.ClassExamPaperCO;
|
||||
import com.zcloud.edu.dto.study.ClassExamPaperPageQry;
|
||||
|
|
@ -8,6 +9,7 @@ import com.zcloud.edu.persistence.dataobject.study.ClassExamPaperDO;
|
|||
import com.zcloud.edu.persistence.repository.study.ClassExamPaperRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -38,5 +40,17 @@ public class ClassExamPaperQueryExe {
|
|||
List<ClassExamPaperCO> examCenterCOS = classExamPaperCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public SingleResponse<ClassExamPaperCO> executeGetInfoById(Long id) {
|
||||
ClassExamPaperDO classExamPaperDO = classExamPaperRepository.findById(id);
|
||||
ClassExamPaperCO classExamPaperCO = new ClassExamPaperCO();
|
||||
BeanUtils.copyProperties(classExamPaperDO, classExamPaperCO);
|
||||
return SingleResponse.of(classExamPaperCO);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,19 +2,26 @@ package com.zcloud.edu.command.query.study;
|
|||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.edu.command.convertor.study.ClassCoConvertor;
|
||||
import com.zcloud.edu.dto.clientobject.study.ClassCO;
|
||||
import com.zcloud.edu.dto.data.study.ClassQuestionDTO;
|
||||
import com.zcloud.edu.dto.study.ClassPageQry;
|
||||
import com.zcloud.edu.persistence.dataobject.study.ClassDO;
|
||||
import com.zcloud.edu.persistence.mapper.po.study.ClassQuestionPO;
|
||||
import com.zcloud.edu.persistence.mapper.po.study.StudentCountPO;
|
||||
import com.zcloud.edu.persistence.repository.study.ClassRepository;
|
||||
import com.zcloud.edu.persistence.repository.study.StudentRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -28,6 +35,7 @@ import java.util.Map;
|
|||
public class ClassQueryExe {
|
||||
private final ClassRepository classRepository;
|
||||
private final ClassCoConvertor classCoConvertor;
|
||||
private final StudentRepository studentRepository;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
|
|
@ -36,8 +44,37 @@ public class ClassQueryExe {
|
|||
* @return
|
||||
*/
|
||||
public PageResponse<ClassCO> execute(ClassPageQry classPageQry) {
|
||||
// 如果isMyCorp不为空,则查询当前登录人所在企业数据
|
||||
if (!ObjectUtils.isEmpty(classPageQry.getIsMyCorp())){
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
classPageQry.setEqCorpinfoId(ssoUser.getTenantId());
|
||||
}
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(classPageQry);
|
||||
|
||||
PageResponse<ClassDO> pageResponse = classRepository.listPage(params);
|
||||
if (pageResponse.getData() != null && pageResponse.getData().size() > 0){
|
||||
List<String> classIds = pageResponse.getData().stream().map(ClassDO::getClassId).collect(Collectors.toList());
|
||||
List<ClassDO> stuCountList = studentRepository.countStudentByClass(classIds);
|
||||
if (stuCountList != null && stuCountList.size() > 0){
|
||||
Map<String, ClassDO> stuCountMap = stuCountList.stream().collect(Collectors.toMap(ClassDO::getClassId, classDO -> classDO));
|
||||
pageResponse.getData().stream().forEach(classDO -> {
|
||||
if(stuCountMap.containsKey(classDO.getClassId())){
|
||||
classDO.setTotalCount(stuCountMap.get(classDO.getClassId()).getTotalCount());
|
||||
classDO.setSignCount(stuCountMap.get(classDO.getClassId()).getSignCount());
|
||||
classDO.setFinishCount(stuCountMap.get(classDO.getClassId()).getFinishCount());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
List<ClassCO> examCenterCOS = classCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
||||
public PageResponse<ClassCO> executeAppListPage(ClassPageQry classPageQry) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(classPageQry);
|
||||
params.put("phone", ssoUser.getAccount());
|
||||
PageResponse<ClassDO> pageResponse = classRepository.listStuClassPage(params);
|
||||
List<ClassCO> examCenterCOS = classCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
|
@ -63,5 +100,11 @@ public class ClassQueryExe {
|
|||
}
|
||||
return SingleResponse.of(classQuestionDTO);
|
||||
}
|
||||
public SingleResponse<ClassCO> executeGetInfoById(Long id) {
|
||||
ClassDO classDO = classRepository.getInfoById(id);
|
||||
ClassCO classCO = new ClassCO();
|
||||
BeanUtils.copyProperties(classDO, classCO);
|
||||
return SingleResponse.of(classCO);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@ package com.zcloud.edu.command.study;
|
|||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.edu.domain.gateway.study.ClassGateway;
|
||||
import com.zcloud.edu.persistence.dataobject.study.ClassDO;
|
||||
import com.zcloud.edu.persistence.mapper.study.ClassExamPaperMapper;
|
||||
import com.zcloud.edu.persistence.repository.study.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -17,10 +20,26 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@AllArgsConstructor
|
||||
public class ClassRemoveExe {
|
||||
private final ClassGateway classGateway;
|
||||
private final ClassRepository classRepository;
|
||||
private final ClassCurriculumRepository classCurriculumRepository;
|
||||
private final ClassCurriculumChapterRepository classCurriculumChapterRepository;
|
||||
private final ClassExamPaperRepository classExamPaperRepository;
|
||||
private final StudentRepository studentRepository;
|
||||
private final StudentExamRecordRepository studentExamRecordRepository;
|
||||
private final StudentExamRecordItemRepository studentExamRecordItemRepository;
|
||||
private final StudentSignRepository studentSignRepository;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long id) {
|
||||
ClassDO classDO = classRepository.getById(id);
|
||||
boolean res = classGateway.deletedClassById(id);
|
||||
classCurriculumRepository.deleteByClassId(classDO.getClassId());
|
||||
classCurriculumChapterRepository.deleteByClassId(classDO.getClassId());
|
||||
classExamPaperRepository.deleteByClassId(classDO.getClassId());
|
||||
studentRepository.deleteByClassId(classDO.getClassId());
|
||||
studentExamRecordRepository.deleteByClassId(classDO.getClassId());
|
||||
studentExamRecordItemRepository.deleteByClassId(classDO.getClassId());
|
||||
studentSignRepository.deleteByClassId(classDO.getClassId());
|
||||
if (!res) {
|
||||
throw new BizException("删除失败");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.zcloud.edu.command.study;
|
|||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.edu.domain.gateway.study.ClassGateway;
|
||||
import com.zcloud.edu.domain.model.study.ClassE;
|
||||
import com.zcloud.edu.dto.study.ClassPostponeCmd;
|
||||
import com.zcloud.edu.dto.study.ClassUpdateCmd;
|
||||
import com.zcloud.edu.persistence.repository.study.ClassCurriculumRepository;
|
||||
import com.zcloud.edu.persistence.repository.study.ClassExamPaperRepository;
|
||||
|
|
@ -53,5 +54,13 @@ public class ClassUpdateExe {
|
|||
throw new BizException("修改失败");
|
||||
}
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void executePostpone(ClassPostponeCmd classPostponeCmd){
|
||||
ClassE classE = new ClassE();
|
||||
BeanUtils.copyProperties(classPostponeCmd, classE);
|
||||
classE.postpone();
|
||||
classGateway.update(classE);
|
||||
studentRepository.postponeUpdateStudent(classPostponeCmd.getClassId());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,5 +62,10 @@ public class ClassExamPaperServiceImpl implements ClassExamPaperServiceI {
|
|||
public void removeBatch(Long[] ids) {
|
||||
classExamPaperRemoveExe.execute(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse<ClassExamPaperCO> getInfoById(Long id) {
|
||||
return classExamPaperQueryExe.executeGetInfoById(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.zcloud.edu.dto.clientobject.study.ClassCO;
|
|||
import com.zcloud.edu.dto.data.study.ClassQuestionDTO;
|
||||
import com.zcloud.edu.dto.study.ClassAddCmd;
|
||||
import com.zcloud.edu.dto.study.ClassPageQry;
|
||||
import com.zcloud.edu.dto.study.ClassPostponeCmd;
|
||||
import com.zcloud.edu.dto.study.ClassUpdateCmd;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -31,7 +32,6 @@ public class ClassServiceImpl implements ClassServiceI {
|
|||
|
||||
@Override
|
||||
public PageResponse<ClassCO> listPage(ClassPageQry qry) {
|
||||
|
||||
return classQueryExe.execute(qry);
|
||||
}
|
||||
|
||||
|
|
@ -62,5 +62,21 @@ public class ClassServiceImpl implements ClassServiceI {
|
|||
|
||||
return classQueryExe.executeCountQuestionByClassId(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse<ClassCO> getInfoById(Long id) {
|
||||
return classQueryExe.executeGetInfoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postpone(ClassPostponeCmd cmd) {
|
||||
|
||||
classUpdateExe.executePostpone(cmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResponse<ClassCO> appListPage(ClassPageQry qry) {
|
||||
return classQueryExe.executeAppListPage(qry);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,5 +26,7 @@ public interface ClassExamPaperServiceI {
|
|||
void remove(Long id);
|
||||
|
||||
void removeBatch(Long[] ids);
|
||||
|
||||
SingleResponse<ClassExamPaperCO> getInfoById(Long id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.zcloud.edu.dto.clientobject.study.ClassCO;
|
|||
import com.zcloud.edu.dto.data.study.ClassQuestionDTO;
|
||||
import com.zcloud.edu.dto.study.ClassAddCmd;
|
||||
import com.zcloud.edu.dto.study.ClassPageQry;
|
||||
import com.zcloud.edu.dto.study.ClassPostponeCmd;
|
||||
import com.zcloud.edu.dto.study.ClassUpdateCmd;
|
||||
|
||||
/**
|
||||
|
|
@ -26,5 +27,14 @@ public interface ClassServiceI {
|
|||
void removeBatch(Long[] ids);
|
||||
|
||||
SingleResponse<ClassQuestionDTO> countQuestionByClassId(String id);
|
||||
|
||||
SingleResponse<ClassCO> getInfoById(Long id);
|
||||
|
||||
|
||||
|
||||
void postpone(ClassPostponeCmd cmd);
|
||||
|
||||
|
||||
PageResponse<ClassCO> appListPage(ClassPageQry qry);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.zcloud.edu.dto.clientobject.study;
|
||||
|
||||
import com.alibaba.cola.dto.ClientObject;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.models.auth.In;
|
||||
|
|
@ -101,5 +102,12 @@ public class ClassCO extends ClientObject {
|
|||
//环境
|
||||
@ApiModelProperty(value = "环境")
|
||||
private String env;
|
||||
|
||||
@ApiModelProperty(value = "班级学员总数")
|
||||
private Integer totalCount= 0;
|
||||
@ApiModelProperty(value = "班级签到人数")
|
||||
private Integer signCount = 0;
|
||||
@ApiModelProperty(value = "考试通过人数")
|
||||
private Integer finishCount= 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
|
|
@ -34,13 +35,15 @@ public class ClassExamPaperCO extends ClientObject {
|
|||
private String examName;
|
||||
//试卷总分数
|
||||
@ApiModelProperty(value = "试卷总分数")
|
||||
private String examScore;
|
||||
private BigDecimal examScore;
|
||||
//合格分数
|
||||
@ApiModelProperty(value = "合格分数")
|
||||
private String passScore;
|
||||
private BigDecimal passScore;
|
||||
//考试时长(分钟)
|
||||
@ApiModelProperty(value = "考试时长(分钟)")
|
||||
private String examTime;
|
||||
private Integer examTime;
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
private String corpName;
|
||||
//删除标识true false
|
||||
@ApiModelProperty(value = "删除标识true false")
|
||||
private String deleteEnum;
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ public class ClassPageQry extends PageQuery {
|
|||
private String leStartTime;
|
||||
private String geEndTime;
|
||||
private String leEndTime;
|
||||
private String isMyCorp;
|
||||
private Long eqCorpinfoId;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
package com.zcloud.edu.dto.study;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author zhangyue
|
||||
* @Date 2026-01-13 14:18:12
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ClassPostponeCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "主键不能为空", name = "id", required = true)
|
||||
@NotNull(message = "主键不能为空")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "业务主键id", name = "classId", required = true)
|
||||
@NotEmpty(message = "业务主键id不能为空")
|
||||
private String classId;
|
||||
|
||||
@ApiModelProperty(value = "培训日期 结束日期", name = "endTime", required = true)
|
||||
@NotEmpty(message = "培训日期 结束日期不能为空")
|
||||
private String endTime;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -90,5 +90,14 @@ public class ClassE extends BaseE {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void postpone(){
|
||||
if(DateUtil.isBeforeThan(this.endTime)){
|
||||
this.state = 3;
|
||||
} else {
|
||||
this.state = 4;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.zcloud.edu.persistence.dataobject.study;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -41,6 +42,7 @@ public class ClassDO extends BaseDO {
|
|||
private String trainType;
|
||||
//培训行业类型名称
|
||||
@ApiModelProperty(value = "培训行业类型名称")
|
||||
@TableField(exist = false)
|
||||
private String trainTypeName;
|
||||
//培训地点
|
||||
@ApiModelProperty(value = "培训地点")
|
||||
|
|
@ -63,7 +65,15 @@ public class ClassDO extends BaseDO {
|
|||
//考试次数只有考试时候有用
|
||||
@ApiModelProperty(value = "考试次数只有考试时候有用")
|
||||
private Integer numberofexams;
|
||||
|
||||
@ApiModelProperty(value = "班级学员总数")
|
||||
@TableField(exist = false)
|
||||
private Integer totalCount;
|
||||
@ApiModelProperty(value = "班级签到人数")
|
||||
@TableField(exist = false)
|
||||
private Integer signCount;
|
||||
@ApiModelProperty(value = "考试通过人数")
|
||||
@TableField(exist = false)
|
||||
private Integer finishCount;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.zcloud.edu.persistence.dataobject.study;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -45,6 +46,8 @@ public class ClassExamPaperDO extends BaseDO {
|
|||
@ApiModelProperty(value = "考试时长(分钟)")
|
||||
private Integer examTime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
@TableField(exist = false)
|
||||
private String corpName;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,9 @@ public class StudentExamRecordItemDO extends BaseDO {
|
|||
//学员id
|
||||
@ApiModelProperty(value = "学员id")
|
||||
private String studentId;
|
||||
//班级id
|
||||
@ApiModelProperty(value = "班级id")
|
||||
private String classId;
|
||||
//习题ID
|
||||
@ApiModelProperty(value = "习题ID")
|
||||
private String questionId;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
package com.zcloud.edu.persistence.mapper.po.study;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.poi.ss.formula.functions.Count;
|
||||
|
||||
/**
|
||||
* @author zhangyue
|
||||
* @date 2026/1/19 15:38
|
||||
*/
|
||||
@Data
|
||||
public class StudentCountPO {
|
||||
@ApiModelProperty(value = "班级学员总数")
|
||||
private Integer totalCount;
|
||||
@ApiModelProperty(value = "班级签到人数")
|
||||
private Integer signCount;
|
||||
@ApiModelProperty(value = "考试通过人数")
|
||||
private Integer finishCount;
|
||||
@ApiModelProperty(value = "班级id")
|
||||
private Integer classId;
|
||||
}
|
||||
|
|
@ -13,6 +13,6 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
*/
|
||||
@Mapper
|
||||
public interface ClassExamPaperMapper extends BaseMapper<ClassExamPaperDO> {
|
||||
|
||||
ClassExamPaperDO findById(Long id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,16 @@
|
|||
package com.zcloud.edu.persistence.mapper.study;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zcloud.edu.persistence.dataobject.study.ClassDO;
|
||||
import com.zcloud.edu.persistence.mapper.po.study.ClassQuestionPO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import oshi.jna.platform.mac.SystemB;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
|
|
@ -16,6 +20,12 @@ import java.util.List;
|
|||
*/
|
||||
@Mapper
|
||||
public interface ClassMapper extends BaseMapper<ClassDO> {
|
||||
|
||||
IPage<ClassDO> listPage(IPage<ClassDO> page, @Param("ew") QueryWrapper<ClassDO> queryWrapper, String menuPerms);
|
||||
IPage<ClassDO> listStuClassPage(IPage<ClassDO> page, @Param("params") Map<String, Object> params, String menuPerms);
|
||||
|
||||
List<ClassQuestionPO> countQuestionByClassId(String classId);
|
||||
|
||||
ClassDO getInfoById(long id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
package com.zcloud.edu.persistence.mapper.study;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zcloud.edu.persistence.dataobject.study.ClassDO;
|
||||
import com.zcloud.edu.persistence.dataobject.study.StudentDO;
|
||||
import com.zcloud.edu.persistence.mapper.po.study.StudentCountPO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
|
|
@ -12,6 +16,8 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
*/
|
||||
@Mapper
|
||||
public interface StudentMapper extends BaseMapper<StudentDO> {
|
||||
long postponeUpdateStudent(String classId);
|
||||
|
||||
List<ClassDO> countStudentByClass(List<String> classIds);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,5 +52,14 @@ public class ClassCurriculumChapterRepositoryImpl extends BaseRepositoryImpl<Cla
|
|||
updateWrapper.set("delete_enum", "TRUE");
|
||||
return classCurriculumChapterMapper.delete(updateWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer deleteByClassId(String classId) {
|
||||
UpdateWrapper updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("class_id", classId);
|
||||
updateWrapper.eq("delete_enum", "FALSE");
|
||||
updateWrapper.set("delete_enum", "TRUE");
|
||||
return classCurriculumChapterMapper.delete(updateWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.zcloud.edu.persistence.repository.impl.study;
|
|||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
||||
|
|
@ -56,5 +57,14 @@ public class ClassCurriculumRepositoryImpl extends BaseRepositoryImpl<ClassCurri
|
|||
|
||||
return classCurriculumMapper.getInfoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer deleteByClassId(String classId) {
|
||||
UpdateWrapper updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.set("delete_enum", "TRUE");
|
||||
updateWrapper.eq("class_id", classId);
|
||||
updateWrapper.eq("delete_enum", "FALSE");
|
||||
return classCurriculumMapper.delete(updateWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.zcloud.edu.persistence.repository.impl.study;
|
|||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
||||
|
|
@ -51,5 +52,19 @@ public class ClassExamPaperRepositoryImpl extends BaseRepositoryImpl<ClassExamPa
|
|||
queryWrapper.eq("delete_enum", "FALSE");
|
||||
return classExamPaperMapper.selectCount(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassExamPaperDO findById(Long id) {
|
||||
return classExamPaperMapper.findById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer deleteByClassId(String classId) {
|
||||
UpdateWrapper updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.set("delete_enum", "TRUE");
|
||||
updateWrapper.eq("delete_enum", "FALSE");
|
||||
updateWrapper.eq("class_id", classId);
|
||||
return classExamPaperMapper.delete(updateWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,9 +32,17 @@ public class ClassRepositoryImpl extends BaseRepositoryImpl<ClassMapper, ClassDO
|
|||
public PageResponse<ClassDO> listPage(Map<String, Object> params) {
|
||||
IPage<ClassDO> iPage = new Query<ClassDO>().getPage(params);
|
||||
QueryWrapper<ClassDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<ClassDO> result = classMapper.selectPage(iPage, queryWrapper);
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params,"c.");
|
||||
queryWrapper.orderByAsc("c.state").orderByDesc("c.create_time");
|
||||
queryWrapper.eq("c.delete_enum","FALSE");
|
||||
IPage<ClassDO> result = classMapper.listPage(iPage, queryWrapper, null);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResponse<ClassDO> listStuClassPage(Map<String, Object> params) {
|
||||
IPage<ClassDO> iPage = new Query<ClassDO>().getPage(params);
|
||||
IPage<ClassDO> result = classMapper.listStuClassPage(iPage, params, null);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
|
|
@ -49,5 +57,10 @@ public class ClassRepositoryImpl extends BaseRepositoryImpl<ClassMapper, ClassDO
|
|||
public List<ClassQuestionPO> countQuestionByClassId(String classId) {
|
||||
return classMapper.countQuestionByClassId(classId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassDO getInfoById(Long id) {
|
||||
return classMapper.getInfoById(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,5 +45,14 @@ public class StudentExamRecordItemRepositoryImpl extends BaseRepositoryImpl<Stud
|
|||
updateWrapper.set("delete_enum", "TRUE");
|
||||
studentExamRecordItemMapper.update(null, updateWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer deleteByClassId(String classId) {
|
||||
UpdateWrapper updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("class_id", classId);
|
||||
updateWrapper.eq("delete_enum", "FALSE");
|
||||
updateWrapper.set("delete_enum", "TRUE");
|
||||
return studentExamRecordItemMapper.delete(updateWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,5 +45,14 @@ public class StudentExamRecordRepositoryImpl extends BaseRepositoryImpl<StudentE
|
|||
updateWrapper.set("delete_enum", "TRUE");
|
||||
studentExamRecordMapper.update(null, updateWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer deleteByClassId(String classId) {
|
||||
UpdateWrapper updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("class_id", classId);
|
||||
updateWrapper.eq("delete_enum", "FALSE");
|
||||
updateWrapper.set("delete_enum", "TRUE");
|
||||
return studentExamRecordMapper.delete( updateWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,13 @@ package com.zcloud.edu.persistence.repository.impl.study;
|
|||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
||||
import com.zcloud.edu.persistence.dataobject.study.ClassDO;
|
||||
import com.zcloud.edu.persistence.dataobject.study.StudentDO;
|
||||
import com.zcloud.edu.persistence.mapper.po.study.StudentCountPO;
|
||||
import com.zcloud.edu.persistence.mapper.study.StudentMapper;
|
||||
import com.zcloud.edu.persistence.repository.study.StudentRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
|
|
@ -50,5 +53,25 @@ public class StudentRepositoryImpl extends BaseRepositoryImpl<StudentMapper, Stu
|
|||
queryWrapper.eq("delete_enum", "FALSE");
|
||||
return studentMapper.selectCount(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long postponeUpdateStudent(String classId) {
|
||||
|
||||
return studentMapper.postponeUpdateStudent(classId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer deleteByClassId(String classId) {
|
||||
UpdateWrapper updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("class_id", classId);
|
||||
updateWrapper.eq("delete_enum", "FALSE");
|
||||
updateWrapper.set("delete_enum", "TRUE");
|
||||
return studentMapper.delete(updateWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ClassDO> countStudentByClass(List<String> classIds) {
|
||||
return studentMapper.countStudentByClass(classIds);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.zcloud.edu.persistence.repository.impl.study;
|
|||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
||||
|
|
@ -35,5 +36,14 @@ public class StudentSignRepositoryImpl extends BaseRepositoryImpl<StudentSignMap
|
|||
IPage<StudentSignDO> result = studentSignMapper.selectPage(iPage, queryWrapper);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer deleteByClassId(String classId) {
|
||||
UpdateWrapper updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("class_id", classId);
|
||||
updateWrapper.eq("delete_enum", "FALSE");
|
||||
updateWrapper.set("delete_enum", "TRUE");
|
||||
return studentSignMapper.delete(updateWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,5 +19,7 @@ public interface ClassCurriculumChapterRepository extends BaseRepository<ClassCu
|
|||
List<ClassCurriculumChapterDO> listByCurriculumId(String classCurriculumId);
|
||||
|
||||
Integer deleteByCurriculumId(String classCurriculumId);
|
||||
|
||||
Integer deleteByClassId(String classId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,5 +20,7 @@ public interface ClassCurriculumRepository extends BaseRepository<ClassCurriculu
|
|||
Long countByClassId(String classId);
|
||||
|
||||
ClassCurriculumDO getInfoById(long id);
|
||||
|
||||
Integer deleteByClassId(String classId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,5 +18,9 @@ public interface ClassExamPaperRepository extends BaseRepository<ClassExamPaperD
|
|||
Long getCountByExamPaperId(String examPaperId);
|
||||
|
||||
Long countByClassId(String classId);
|
||||
|
||||
ClassExamPaperDO findById(Long id);
|
||||
|
||||
Integer deleteByClassId(String classId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,8 +17,12 @@ import java.util.Map;
|
|||
public interface ClassRepository extends BaseRepository<ClassDO> {
|
||||
PageResponse<ClassDO> listPage(Map<String, Object> params);
|
||||
|
||||
PageResponse<ClassDO> listStuClassPage(Map<String, Object> params);
|
||||
|
||||
ClassDO getByClassId(String classId);
|
||||
|
||||
List<ClassQuestionPO> countQuestionByClassId(String classId);
|
||||
|
||||
ClassDO getInfoById(Long id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.zcloud.edu.persistence.repository.study;
|
|||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.jjb.saas.framework.repository.repo.BaseRepository;
|
||||
import com.zcloud.edu.persistence.dataobject.study.StudentExamRecordItemDO;
|
||||
import io.swagger.models.auth.In;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -16,5 +17,7 @@ public interface StudentExamRecordItemRepository extends BaseRepository<StudentE
|
|||
PageResponse<StudentExamRecordItemDO> listPage(Map<String, Object> params);
|
||||
|
||||
void deleteByStudentId(String studentId);
|
||||
|
||||
Integer deleteByClassId(String classId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,5 +16,7 @@ public interface StudentExamRecordRepository extends BaseRepository<StudentExamR
|
|||
PageResponse<StudentExamRecordDO> listPage(Map<String, Object> params);
|
||||
|
||||
void deleteByStudentId(String studentId);
|
||||
|
||||
Integer deleteByClassId(String classId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ package com.zcloud.edu.persistence.repository.study;
|
|||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.jjb.saas.framework.repository.repo.BaseRepository;
|
||||
import com.zcloud.edu.persistence.dataobject.study.ClassDO;
|
||||
import com.zcloud.edu.persistence.dataobject.study.StudentDO;
|
||||
import com.zcloud.edu.persistence.mapper.po.study.StudentCountPO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -18,5 +20,11 @@ public interface StudentRepository extends BaseRepository<StudentDO> {
|
|||
Boolean addBatch(List<StudentDO> studentDOs);
|
||||
|
||||
Long countByClassId(String classId);
|
||||
|
||||
Long postponeUpdateStudent(String classId);
|
||||
|
||||
Integer deleteByClassId(String classId);
|
||||
|
||||
List<ClassDO> countStudentByClass(List<String> classIds);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,5 +14,7 @@ import java.util.Map;
|
|||
*/
|
||||
public interface StudentSignRepository extends BaseRepository<StudentSignDO> {
|
||||
PageResponse<StudentSignDO> listPage(Map<String, Object> params);
|
||||
|
||||
Integer deleteByClassId(String classId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,23 @@
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.zcloud.edu.persistence.mapper.study.ClassExamPaperMapper">
|
||||
|
||||
<select id="findById" resultType="com.zcloud.edu.persistence.dataobject.study.ClassExamPaperDO">
|
||||
SELECT
|
||||
cep.id,
|
||||
cep.class_exam_paper_id,
|
||||
cep.class_id,
|
||||
cep.exam_paper_id,
|
||||
cep.corpinfo_id,
|
||||
ci.corp_name,
|
||||
cep.exam_name,
|
||||
cep.exam_score,
|
||||
cep.pass_score,
|
||||
cep.exam_time
|
||||
FROM
|
||||
class_exam_paper cep
|
||||
left join corp_info ci on ci.id = cep.corpinfo_id
|
||||
WHERE
|
||||
cep.id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
|
|||
|
|
@ -17,5 +17,92 @@
|
|||
GROUP BY
|
||||
q.question_type
|
||||
</select>
|
||||
|
||||
<select id="getInfoById" resultType="com.zcloud.edu.persistence.dataobject.study.ClassDO">
|
||||
SELECT
|
||||
c.id,
|
||||
c.class_id,
|
||||
c.name,
|
||||
c.start_time,
|
||||
c.end_time,
|
||||
c.teacher_id,
|
||||
c.teacher_name,
|
||||
c.train_type,
|
||||
t.name train_type_name,
|
||||
c.training_location,
|
||||
c.corpinfo_id,
|
||||
c.state,
|
||||
c.valid_start_time,
|
||||
c.valid_end_time,
|
||||
c.examination,
|
||||
c.numberofexams
|
||||
FROM
|
||||
class c
|
||||
left join training_type t on t.training_type_id = c.train_type
|
||||
WHERE
|
||||
c.id = #{id}
|
||||
</select>
|
||||
<select id="listPage" resultType="com.zcloud.edu.persistence.dataobject.study.ClassDO">
|
||||
SELECT
|
||||
c.id,
|
||||
c.class_id,
|
||||
c.name,
|
||||
c.start_time,
|
||||
c.end_time,
|
||||
c.teacher_id,
|
||||
c.teacher_name,
|
||||
c.train_type,
|
||||
t.name train_type_name,
|
||||
c.training_location,
|
||||
c.corpinfo_id,
|
||||
ci.corp_name,
|
||||
c.state,
|
||||
c.valid_start_time,
|
||||
c.valid_end_time,
|
||||
c.examination,
|
||||
c.numberofexams
|
||||
FROM
|
||||
class c
|
||||
left join training_type t on t.training_type_id = c.train_type
|
||||
left join corp_info ci on ci.id = c.corpinfo_id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="listStuClassPage" resultType="com.zcloud.edu.persistence.dataobject.study.ClassDO">
|
||||
SELECT
|
||||
c.id,
|
||||
c.class_id,
|
||||
c.name,
|
||||
c.start_time,
|
||||
c.end_time,
|
||||
c.teacher_id,
|
||||
c.teacher_name,
|
||||
c.train_type,
|
||||
t.name train_type_name,
|
||||
c.training_location,
|
||||
c.corpinfo_id,
|
||||
ci.corp_name,
|
||||
c.state,
|
||||
c.valid_start_time,
|
||||
c.valid_end_time,
|
||||
c.examination,
|
||||
c.numberofexams
|
||||
FROM
|
||||
class c
|
||||
left join training_type t on t.training_type_id = c.train_type
|
||||
left join corp_info ci on ci.id = c.corpinfo_id
|
||||
WHERE
|
||||
c.class_id IN (SELECT s.class_id FROM student s WHERE s.phone = #{params.phone} AND s.delete_enum = 'FALSE')
|
||||
AND c.delete_enum = 'FALSE'
|
||||
<if test="params.likeName != null and params.likeName !='' ">
|
||||
and c.name like concat('%',#{params.likeName},'%')
|
||||
</if>
|
||||
order by
|
||||
c.state,
|
||||
c.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
|
|
|
|||
|
|
@ -4,5 +4,36 @@
|
|||
|
||||
<mapper namespace="com.zcloud.edu.persistence.mapper.study.StudentMapper">
|
||||
|
||||
<update id="postponeUpdateStudent">
|
||||
update
|
||||
student
|
||||
set state =
|
||||
CASE state
|
||||
WHEN 4 THEN 0
|
||||
WHEN 5 THEN 1
|
||||
WHEN 6 THEN 2
|
||||
END
|
||||
where class_id = #{classId} and delete_enum = 'FALSE' and state in (4,5,6)
|
||||
</update>
|
||||
|
||||
<select id="countStudentByClass" resultType="com.zcloud.edu.persistence.dataobject.study.ClassDO">
|
||||
SELECT
|
||||
count(*) total_count,
|
||||
count(CASE WHEN sign_flag = 1 THEN 1 END) sign_count,
|
||||
count(CASE WHEN state = 3 THEN 1 END) finish_count,
|
||||
class_id
|
||||
FROM
|
||||
student
|
||||
<where>
|
||||
and class_id IN
|
||||
<foreach item="item" collection="classIds" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND delete_enum = 'FALSE'
|
||||
</where>
|
||||
GROUP BY
|
||||
class_id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue