0618
This commit is contained in:
parent
e5ff111e8f
commit
f20e476027
@ -265,4 +265,37 @@ public class DlDriveSchoolStudentController {
|
|||||||
return success(schoolStudentService.updateChannel(student));
|
return success(schoolStudentService.updateChannel(student));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取教练已经毕业的学员列表
|
||||||
|
* @param coachId
|
||||||
|
* @param courseType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getGradStudentByCoachId")
|
||||||
|
public CommonResult<IPage<?>> getGradStudentByCourseType(@RequestParam("coachId") String coachId,
|
||||||
|
@RequestParam(name = "courseType", required = false) String courseType,
|
||||||
|
@RequestParam(name = "name", required = false) String name,
|
||||||
|
@RequestParam(name = "sort", required = false) String sort,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||||
|
Page<DlDriveSchoolStudent> page = new Page<>(pageNo, pageSize);
|
||||||
|
return success(schoolStudentService.getGradStudentByCourseType(coachId, courseType, name, sort, page));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取教练未毕业的学员列表
|
||||||
|
* @param coachId
|
||||||
|
* @param courseType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getNoGradStudentByCoachId")
|
||||||
|
public CommonResult<IPage<?>> getNoGradStudentByCourseType(@RequestParam("coachId") String coachId,
|
||||||
|
@RequestParam(name = "courseType", required = false) String courseType,
|
||||||
|
@RequestParam(name = "name", required = false) String name,
|
||||||
|
@RequestParam(name = "sort", required = false) String sort,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||||
|
Page<DlDriveSchoolStudent> page = new Page<>(pageNo, pageSize);
|
||||||
|
return success(schoolStudentService.getNoGradStudentByCourseType(coachId, courseType, name, sort, page));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -152,4 +152,13 @@ public interface DlDriveSchoolStudentMapper extends BaseMapper<DlDriveSchoolStud
|
|||||||
List<StudentCountVO> indexCusStudentList(String startTime, String endTime);
|
List<StudentCountVO> indexCusStudentList(String startTime, String endTime);
|
||||||
|
|
||||||
List<DriveSchoolStudentExportVo> getAll(@Param("entity") DlDriveSchoolStudent query);
|
List<DriveSchoolStudentExportVo> getAll(@Param("entity") DlDriveSchoolStudent query);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取教练已经毕业的学员列表
|
||||||
|
*/
|
||||||
|
IPage<DlDriveSchoolStudent> getGradStudentByCourseType(@Param("coachId") String coachId, @Param("courseType") String courseType, @Param("name") String name, @Param("sort") String sort,Page<DlDriveSchoolStudent> page);
|
||||||
|
/**
|
||||||
|
* 获取教练已经毕业的学员列表
|
||||||
|
*/
|
||||||
|
IPage<DlDriveSchoolStudent> getNoGradStudentByCourseType(@Param("coachId") String coachId, @Param("courseType") String courseType, @Param("name") String name, @Param("sort") String sort,Page<DlDriveSchoolStudent> page);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -194,4 +194,14 @@ public interface DlDriveSchoolStudentService extends IService<DlDriveSchoolStude
|
|||||||
public boolean updateChannel(DlDriveSchoolStudent student);
|
public boolean updateChannel(DlDriveSchoolStudent student);
|
||||||
|
|
||||||
DlDriveSchoolStudent getStudentByIdNo(String idNo);
|
DlDriveSchoolStudent getStudentByIdNo(String idNo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取教练已经毕业的学员列表
|
||||||
|
*/
|
||||||
|
IPage<DlDriveSchoolStudent> getGradStudentByCourseType(String coachId, String courseType, String name, String sort, Page<DlDriveSchoolStudent> page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取教练未毕业的学员列表
|
||||||
|
*/
|
||||||
|
IPage<DlDriveSchoolStudent> getNoGradStudentByCourseType(String coachId, String courseType, String name, String sort, Page<DlDriveSchoolStudent> page);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -250,8 +250,7 @@ public class DataViewServiceImpl implements DataViewService {
|
|||||||
studentInfoMap.put("schoolRate", 0 != schoolRate ? (Double.parseDouble(df.format(schoolRate)) * 100) : 0);
|
studentInfoMap.put("schoolRate", 0 != schoolRate ? (Double.parseDouble(df.format(schoolRate)) * 100) : 0);
|
||||||
studentInfoMap.put("businessNum", businessNum);
|
studentInfoMap.put("businessNum", businessNum);
|
||||||
studentInfoMap.put("businessAmount", businessAmount);
|
studentInfoMap.put("businessAmount", businessAmount);
|
||||||
// studentInfoMap.put("businessRate", 0 != businessRate ? (Double.parseDouble(df.format(businessRate)) * 100) : 0);
|
studentInfoMap.put("businessRate", 0 != businessRate ? (Double.parseDouble(df.format(businessRate)) * 100) : 0);
|
||||||
studentInfoMap.put("businessRate", businessRate != 0 ? formatRate(businessRate) : 0);
|
|
||||||
rtnObj.setStudentInfo(studentInfoMap);
|
rtnObj.setStudentInfo(studentInfoMap);
|
||||||
/*4.财务情况--*/
|
/*4.财务情况--*/
|
||||||
//应收
|
//应收
|
||||||
@ -538,6 +537,7 @@ public class DataViewServiceImpl implements DataViewService {
|
|||||||
courseTypeGraduatedCount.forEach((key, count) -> rtnMap.put(key, count));
|
courseTypeGraduatedCount.forEach((key, count) -> rtnMap.put(key, count));
|
||||||
|
|
||||||
return rtnMap;
|
return rtnMap;
|
||||||
|
//TODO 需要修改为查询订单表的grad_time 和 pass_time
|
||||||
}
|
}
|
||||||
/*public Map<String, Object> getStudentCount() {
|
/*public Map<String, Object> getStudentCount() {
|
||||||
List<DlDriveSchoolStaffVO> list = studentMapper.selectStudentListCount();
|
List<DlDriveSchoolStaffVO> list = studentMapper.selectStudentListCount();
|
||||||
|
|||||||
@ -21,6 +21,8 @@ import cn.iocoder.yudao.module.base.vo.*;
|
|||||||
import cn.iocoder.yudao.module.constant.InspectionConstants;
|
import cn.iocoder.yudao.module.constant.InspectionConstants;
|
||||||
import cn.iocoder.yudao.module.course.entity.SchoolCommission;
|
import cn.iocoder.yudao.module.course.entity.SchoolCommission;
|
||||||
import cn.iocoder.yudao.module.course.mapper.SchoolCommissionMapper;
|
import cn.iocoder.yudao.module.course.mapper.SchoolCommissionMapper;
|
||||||
|
import cn.iocoder.yudao.module.course.service.ProcessService;
|
||||||
|
import cn.iocoder.yudao.module.course.vo.ProcessVO;
|
||||||
import cn.iocoder.yudao.module.exam.mapper.ExamBatchItemMapper;
|
import cn.iocoder.yudao.module.exam.mapper.ExamBatchItemMapper;
|
||||||
import cn.iocoder.yudao.module.exam.vo.ExamBatchItemVO;
|
import cn.iocoder.yudao.module.exam.vo.ExamBatchItemVO;
|
||||||
import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO;
|
import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO;
|
||||||
@ -112,6 +114,9 @@ public class DlDriveSchoolCoachServiceImpl extends ServiceImpl<DlDriveSchoolCoac
|
|||||||
@Autowired
|
@Autowired
|
||||||
private RoleService roleService;
|
private RoleService roleService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProcessService processService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 驾校教练、普通员工列表
|
* 驾校教练、普通员工列表
|
||||||
@ -522,11 +527,14 @@ public class DlDriveSchoolCoachServiceImpl extends ServiceImpl<DlDriveSchoolCoac
|
|||||||
/*3.统计教练的学生基本信息*/
|
/*3.统计教练的学生基本信息*/
|
||||||
//毕业情况
|
//毕业情况
|
||||||
List<DlDriveSchoolStudentVO> studentVOList = studentMapper.selectStudentListCoach(coach.getUserId(),startTimeStr,endTimeStr);
|
List<DlDriveSchoolStudentVO> studentVOList = studentMapper.selectStudentListCoach(coach.getUserId(),startTimeStr,endTimeStr);
|
||||||
int overNum = (int) studentVOList.stream().filter(item -> null != item.getGradTime()).count();
|
int overNum = (int) studentVOList.stream().filter(item -> null != item.getOrderGradTime()).count();
|
||||||
int noOverNum = studentVOList.size()-overNum;
|
int noOverNum = studentVOList.size()-overNum;
|
||||||
Map<String,Object> studentInfoMap = new HashMap<>();
|
Map<String,Object> studentInfoMap = new HashMap<>();
|
||||||
studentInfoMap.put("overNum",overNum);
|
studentInfoMap.put("overNum",overNum);
|
||||||
studentInfoMap.put("noOverNum",noOverNum);
|
studentInfoMap.put("noOverNum",noOverNum);
|
||||||
|
List<ProcessVO> subject2Over = processService.getPassStudentList(coach.getUserId(), 2, startTimeStr, endTimeStr);
|
||||||
|
List<ProcessVO> subject3Over = processService.getPassStudentList(coach.getUserId(), 3, startTimeStr, endTimeStr);
|
||||||
|
|
||||||
//考试情况
|
//考试情况
|
||||||
List<ExamBatchItemVO> examBatchItemVOList = examBatchItemMapper.selectByCoachId(coach.getUserId(),startTimeStr,endTimeStr);
|
List<ExamBatchItemVO> examBatchItemVOList = examBatchItemMapper.selectByCoachId(coach.getUserId(),startTimeStr,endTimeStr);
|
||||||
Double subject2Num = 0.0;
|
Double subject2Num = 0.0;
|
||||||
@ -562,6 +570,8 @@ public class DlDriveSchoolCoachServiceImpl extends ServiceImpl<DlDriveSchoolCoac
|
|||||||
studentInfoMap.put("subject3All",subject3Num);
|
studentInfoMap.put("subject3All",subject3Num);
|
||||||
studentInfoMap.put("subject3Pass",subject3PassNum);
|
studentInfoMap.put("subject3Pass",subject3PassNum);
|
||||||
studentInfoMap.put("subject3Rate",0!=subject3Rate?(Double.parseDouble(df.format(subject3Rate))*100):0);
|
studentInfoMap.put("subject3Rate",0!=subject3Rate?(Double.parseDouble(df.format(subject3Rate))*100):0);
|
||||||
|
studentInfoMap.put("subject2Over",subject2Over.size());
|
||||||
|
studentInfoMap.put("subject3Over",subject3Over.size());
|
||||||
//招生情况
|
//招生情况
|
||||||
List<DlDriveSchoolStudentVO> studentList = studentMapper.selectStudentList(coach.getUserId(), startTimeStr, endTimeStr);
|
List<DlDriveSchoolStudentVO> studentList = studentMapper.selectStudentList(coach.getUserId(), startTimeStr, endTimeStr);
|
||||||
int coachNum=0;
|
int coachNum=0;
|
||||||
|
|||||||
@ -697,4 +697,20 @@ public class DlDriveSchoolStudentServiceImpl extends ServiceImpl<DlDriveSchoolSt
|
|||||||
.one();
|
.one();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取教练已经毕业的学员列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public IPage<DlDriveSchoolStudent> getGradStudentByCourseType(String coachId, String courseType, String name, String sort, Page<DlDriveSchoolStudent> page) {
|
||||||
|
return dlDriveSchoolStudentMapper.getGradStudentByCourseType(coachId, courseType, name, sort, page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取教练未毕业的学员列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public IPage<DlDriveSchoolStudent> getNoGradStudentByCourseType(String coachId, String courseType, String name, String sort, Page<DlDriveSchoolStudent> page) {
|
||||||
|
return dlDriveSchoolStudentMapper.getNoGradStudentByCourseType(coachId, courseType, name, sort, page);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,6 +31,7 @@ import javax.validation.Valid;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
@ -198,4 +199,35 @@ public class ProcessController {
|
|||||||
public CommonResult<Boolean> updateCoachForScoreInput(String id, Long coachId, String coachName){
|
public CommonResult<Boolean> updateCoachForScoreInput(String id, Long coachId, String coachName){
|
||||||
return success(processService.updateCoachForScoreInput(id, coachId, coachName));
|
return success(processService.updateCoachForScoreInput(id, coachId, coachName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已毕业学员统计
|
||||||
|
*/
|
||||||
|
@GetMapping("/getGraduateStudent")
|
||||||
|
public CommonResult<?> getGraduateStudent(String courseType){
|
||||||
|
return success(processService.getGraduateStudent(courseType));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未毕业学员统计
|
||||||
|
*/
|
||||||
|
@GetMapping("/getNoGraduateStudent")
|
||||||
|
public CommonResult<?> getNoGraduateStudent(String courseType){
|
||||||
|
return success(processService.getNoGraduateStudent(courseType));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取 科目二/三 通过学员
|
||||||
|
*/
|
||||||
|
@GetMapping("/getPassStudent")
|
||||||
|
public CommonResult<IPage<?>> getPassStudent(@RequestParam("subject") int subject,
|
||||||
|
@RequestParam("coachId") Long coachId,
|
||||||
|
@RequestParam(name = "courseType", required = false) String courseType,
|
||||||
|
@RequestParam(name = "name", required = false) String name,
|
||||||
|
@RequestParam(name = "sort", required = false) String sort,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize){
|
||||||
|
Page<ProcessVO> page = new Page<>(pageNo, pageSize);
|
||||||
|
return success(processService.getPassStudent(coachId, subject, courseType, name, sort, page));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -97,6 +97,10 @@ public class SchoolCourseOrder extends TenantBaseDO {
|
|||||||
* 是否已面签 0:否 1: 是
|
* 是否已面签 0:否 1: 是
|
||||||
*/
|
*/
|
||||||
private Integer isSign;
|
private Integer isSign;
|
||||||
|
/**
|
||||||
|
* 面签时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime signTime;
|
||||||
/**
|
/**
|
||||||
* 尾款
|
* 尾款
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.course.mapper;
|
package cn.iocoder.yudao.module.course.mapper;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent;
|
||||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolCoachPageReqVO;
|
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolCoachPageReqVO;
|
||||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolCoachRespVO;
|
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolCoachRespVO;
|
||||||
import cn.iocoder.yudao.module.course.entity.Process;
|
import cn.iocoder.yudao.module.course.entity.Process;
|
||||||
@ -92,4 +93,17 @@ public interface ProcessMapper extends BaseMapper<Process> {
|
|||||||
ExamBatch getBatchForProcess(@Param("entity") Process entity);
|
ExamBatch getBatchForProcess(@Param("entity") Process entity);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已毕业学员统计
|
||||||
|
*/
|
||||||
|
List<Process> getGraduateStudent(String courseType);
|
||||||
|
List<Process> getNoGraduateStudent(String courseType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
IPage<ProcessVO> getPassStudent(@Param("coachId")Long coachId, @Param("subject")int subject, @Param("courseType") String courseType, @Param("name") String name, @Param("sort") String sort,Page<ProcessVO> page);
|
||||||
|
List<ProcessVO> getPassStudentList(@Param("coachId")Long coachId, @Param("subject")int subject, @Param("startTime") String startTime, @Param("endTime")String endTime);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.course.service;
|
package cn.iocoder.yudao.module.course.service;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent;
|
||||||
import cn.iocoder.yudao.module.course.entity.Process;
|
import cn.iocoder.yudao.module.course.entity.Process;
|
||||||
import cn.iocoder.yudao.module.course.vo.ProcessAndExamBatchVO;
|
import cn.iocoder.yudao.module.course.vo.ProcessAndExamBatchVO;
|
||||||
import cn.iocoder.yudao.module.course.vo.ProcessNewVO;
|
import cn.iocoder.yudao.module.course.vo.ProcessNewVO;
|
||||||
@ -153,4 +154,20 @@ public interface ProcessService extends IService<Process> {
|
|||||||
* 在录入成绩出修改教练
|
* 在录入成绩出修改教练
|
||||||
*/
|
*/
|
||||||
Boolean updateCoachForScoreInput(String id, Long coachId, String coachName);
|
Boolean updateCoachForScoreInput(String id, Long coachId, String coachName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已毕业学员统计
|
||||||
|
*/
|
||||||
|
List<Map<String, Object>> getGraduateStudent(String courseType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未毕业学员统计
|
||||||
|
*/
|
||||||
|
List<Map<String, Object>> getNoGraduateStudent(String courseType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取 科目二/三 通过学员
|
||||||
|
*/
|
||||||
|
IPage<ProcessVO> getPassStudent(Long coachId, int subject, String courseType, String name, String sort, Page<ProcessVO> page);
|
||||||
|
List<ProcessVO> getPassStudentList(Long coachId, int subject, String startTime, String endTime);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -858,6 +858,114 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已毕业学员统计
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> getGraduateStudent(String courseType) {
|
||||||
|
List<Process> rawList = processMapper.getGraduateStudent(courseType);
|
||||||
|
|
||||||
|
Map<Long, Map<String, Object>> resultMap = new HashMap<>();
|
||||||
|
|
||||||
|
for (Process row : rawList) {
|
||||||
|
Long coachId = row.getCoachId();
|
||||||
|
String coachName = row.getCoachName();
|
||||||
|
String courseTypeVal = row.getCourseType();
|
||||||
|
String images = row.getImages();
|
||||||
|
Long userId = row.getUserId();
|
||||||
|
|
||||||
|
// 先确保教练一定加入 map
|
||||||
|
Map<String, Object> coachMap = resultMap.computeIfAbsent(coachId, k -> {
|
||||||
|
Map<String, Object> m = new HashMap<>();
|
||||||
|
m.put("coachId", coachId);
|
||||||
|
m.put("coachName", coachName);
|
||||||
|
m.put("studentCount", 0);
|
||||||
|
m.put("images", images);
|
||||||
|
return m;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 有学员才进行统计
|
||||||
|
if (userId != null) {
|
||||||
|
// 统计总数
|
||||||
|
int count = (int) coachMap.get("studentCount");
|
||||||
|
coachMap.put("studentCount", count + 1);
|
||||||
|
|
||||||
|
// 统计各课程类型数量
|
||||||
|
if (courseTypeVal != null) {
|
||||||
|
String key = courseTypeVal + "Num";
|
||||||
|
int typeCount = (int) coachMap.getOrDefault(key, 0);
|
||||||
|
coachMap.put(key, typeCount + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 按照总数倒序排序
|
||||||
|
return resultMap.values().stream()
|
||||||
|
.sorted((a, b) -> ((Integer) b.get("studentCount")).compareTo((Integer) a.get("studentCount")))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未毕业学员统计
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> getNoGraduateStudent(String courseType) {
|
||||||
|
List<Process> rawList = processMapper.getNoGraduateStudent(courseType);
|
||||||
|
|
||||||
|
Map<Long, Map<String, Object>> resultMap = new HashMap<>();
|
||||||
|
|
||||||
|
for (Process row : rawList) {
|
||||||
|
Long coachId = row.getCoachId();
|
||||||
|
String coachName = row.getCoachName();
|
||||||
|
String courseTypeVal = row.getCourseType();
|
||||||
|
String images = row.getImages();
|
||||||
|
Long userId = row.getUserId();
|
||||||
|
|
||||||
|
// 先确保教练一定加入 map
|
||||||
|
Map<String, Object> coachMap = resultMap.computeIfAbsent(coachId, k -> {
|
||||||
|
Map<String, Object> m = new HashMap<>();
|
||||||
|
m.put("coachId", coachId);
|
||||||
|
m.put("coachName", coachName);
|
||||||
|
m.put("studentCount", 0);
|
||||||
|
m.put("images", images);
|
||||||
|
return m;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 有学员才进行统计
|
||||||
|
if (userId != null) {
|
||||||
|
// 统计总数
|
||||||
|
int count = (int) coachMap.get("studentCount");
|
||||||
|
coachMap.put("studentCount", count + 1);
|
||||||
|
|
||||||
|
// 统计各课程类型数量
|
||||||
|
if (courseTypeVal != null) {
|
||||||
|
String key = courseTypeVal + "Num";
|
||||||
|
int typeCount = (int) coachMap.getOrDefault(key, 0);
|
||||||
|
coachMap.put(key, typeCount + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 按照总数倒序排序
|
||||||
|
return resultMap.values().stream()
|
||||||
|
.sorted((a, b) -> ((Integer) b.get("studentCount")).compareTo((Integer) a.get("studentCount")))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取 科目二/三 通过学员
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public IPage<ProcessVO> getPassStudent(Long coachId, int subject, String courseType, String name, String sort, Page<ProcessVO> page) {
|
||||||
|
return processMapper.getPassStudent(coachId, subject, courseType, name, sort, page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ProcessVO> getPassStudentList(Long coachId, int subject, String startTime, String endTime) {
|
||||||
|
return processMapper.getPassStudentList(coachId, subject, startTime, endTime);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成32位uuid
|
* 生成32位uuid
|
||||||
*/
|
*/
|
||||||
@ -866,4 +974,6 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
|||||||
return uuid.toString().replace("-", "");
|
return uuid.toString().replace("-", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -88,6 +88,7 @@ public class SchoolCourseOrderServiceImpl extends ServiceImpl<SchoolCourseOrderM
|
|||||||
SchoolCourseOrder updateObj = BeanUtils.toBean(updateReqVO, SchoolCourseOrder.class);
|
SchoolCourseOrder updateObj = BeanUtils.toBean(updateReqVO, SchoolCourseOrder.class);
|
||||||
if(updateReqVO.getIsSign() != null){
|
if(updateReqVO.getIsSign() != null){
|
||||||
this.sendMessage(updateReqVO);
|
this.sendMessage(updateReqVO);
|
||||||
|
this.updateSignTime(updateReqVO);
|
||||||
}
|
}
|
||||||
schoolCourseOrderMapper.updateById(updateObj);
|
schoolCourseOrderMapper.updateById(updateObj);
|
||||||
}
|
}
|
||||||
@ -119,6 +120,23 @@ public class SchoolCourseOrderServiceImpl extends ServiceImpl<SchoolCourseOrderM
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新面签时间
|
||||||
|
* @param updateReqVO
|
||||||
|
*/
|
||||||
|
public void updateSignTime(SchoolCourseOrderVO updateReqVO){
|
||||||
|
SchoolCourseOrder schoolCourseOrder = schoolCourseOrderMapper.selectById(updateReqVO.getId());
|
||||||
|
if(updateReqVO.getIsSign() == 1 && schoolCourseOrder != null && schoolCourseOrder.getIsSign() == 0){
|
||||||
|
schoolCourseOrder.setSignTime(LocalDateTime.now());
|
||||||
|
schoolCourseOrderMapper.updateById(schoolCourseOrder);
|
||||||
|
}
|
||||||
|
if(updateReqVO.getIsSign() == 0 && schoolCourseOrder != null && schoolCourseOrder.getIsSign() == 1){
|
||||||
|
schoolCourseOrder.setSignTime(null);
|
||||||
|
schoolCourseOrderMapper.updateById(schoolCourseOrder);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteSchoolCourseOrder(String id) {
|
public void deleteSchoolCourseOrder(String id) {
|
||||||
// 删除
|
// 删除
|
||||||
|
|||||||
@ -28,4 +28,9 @@ public class ProcessVO extends Process {
|
|||||||
|
|
||||||
/** 学生尾款*/
|
/** 学生尾款*/
|
||||||
private BigDecimal studentRemainingPay;
|
private BigDecimal studentRemainingPay;
|
||||||
|
|
||||||
|
/** 学员姓名 */
|
||||||
|
private String name;
|
||||||
|
/** 学员头像 */
|
||||||
|
private String avatar;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.exam.controller.admin;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.module.exam.service.ExamBatchService;
|
import cn.iocoder.yudao.module.exam.service.ExamBatchService;
|
||||||
|
import cn.iocoder.yudao.module.exam.vo.ExamBatchNewVO;
|
||||||
import cn.iocoder.yudao.module.exam.vo.ExamBatchVO;
|
import cn.iocoder.yudao.module.exam.vo.ExamBatchVO;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@ -46,4 +47,22 @@ public class ExamBatchController {
|
|||||||
return success(examBatchService.selectOneById(id));
|
return success(examBatchService.selectOneById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 某一教练学员通过和未通过列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/getStudentByCoachId")
|
||||||
|
public CommonResult<?> getStudentByCoachId(@RequestParam("subject") int subject,
|
||||||
|
@RequestParam(name ="coachId", required = false) Long coachId,
|
||||||
|
@RequestParam(name = "ifPass", required = false) String ifPass,
|
||||||
|
@RequestParam(name = "name", required = false) String name,
|
||||||
|
@RequestParam(name = "sort", required = false) String sort,
|
||||||
|
@RequestParam(name = "timeType", required = false) String timeType,
|
||||||
|
@RequestParam(name = "startTime", required = false) String startTime,
|
||||||
|
@RequestParam(name = "endTime", required = false) String endTime,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||||
|
Page<ExamBatchNewVO> page = new Page<>(pageNo,pageSize);
|
||||||
|
return success(examBatchService.getStudentByCoachId(subject, coachId, ifPass, name, sort, timeType, startTime, endTime, page));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.exam.mapper;
|
package cn.iocoder.yudao.module.exam.mapper;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.exam.entity.ExamBatch;
|
import cn.iocoder.yudao.module.exam.entity.ExamBatch;
|
||||||
|
import cn.iocoder.yudao.module.exam.vo.ExamBatchNewVO;
|
||||||
import cn.iocoder.yudao.module.exam.vo.ExamBatchVO;
|
import cn.iocoder.yudao.module.exam.vo.ExamBatchVO;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@ -18,4 +19,6 @@ public interface ExamBatchMapper extends BaseMapper<ExamBatch> {
|
|||||||
|
|
||||||
IPage<ExamBatchVO> queryListPage(@Param("entity") ExamBatchVO entity, Page<ExamBatchVO> page);
|
IPage<ExamBatchVO> queryListPage(@Param("entity") ExamBatchVO entity, Page<ExamBatchVO> page);
|
||||||
|
|
||||||
}
|
IPage<ExamBatchNewVO> getStudentByCoachId(@Param("subject") int subject, @Param("coachId")Long coachId, @Param("ifPass")String ifPass, @Param("name")String name, @Param("sort")String sort, @Param("startTime") String startTime, @Param("endTime") String endTime, Page<ExamBatchNewVO> page);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.exam.service;
|
package cn.iocoder.yudao.module.exam.service;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.exam.entity.ExamBatch;
|
import cn.iocoder.yudao.module.exam.entity.ExamBatch;
|
||||||
|
import cn.iocoder.yudao.module.exam.vo.ExamBatchNewVO;
|
||||||
import cn.iocoder.yudao.module.exam.vo.ExamBatchVO;
|
import cn.iocoder.yudao.module.exam.vo.ExamBatchVO;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@ -38,4 +39,9 @@ public interface ExamBatchService extends IService<ExamBatch> {
|
|||||||
* @return cn.iocoder.yudao.module.exam.vo.ExamBatchVO
|
* @return cn.iocoder.yudao.module.exam.vo.ExamBatchVO
|
||||||
**/
|
**/
|
||||||
ExamBatchVO selectOneById(String id);
|
ExamBatchVO selectOneById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 某一教练学员通过和未通过列表
|
||||||
|
*/
|
||||||
|
IPage<ExamBatchNewVO> getStudentByCoachId(int subject, Long coachId, String ifPass, String name, String sort, String timeType, String startTime, String endTime, Page<ExamBatchNewVO> page);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import cn.iocoder.yudao.module.exam.mapper.ExamBatchMapper;
|
|||||||
import cn.iocoder.yudao.module.exam.service.ExamBatchItemService;
|
import cn.iocoder.yudao.module.exam.service.ExamBatchItemService;
|
||||||
import cn.iocoder.yudao.module.exam.service.ExamBatchService;
|
import cn.iocoder.yudao.module.exam.service.ExamBatchService;
|
||||||
import cn.iocoder.yudao.module.exam.vo.ExamBatchItemVO;
|
import cn.iocoder.yudao.module.exam.vo.ExamBatchItemVO;
|
||||||
|
import cn.iocoder.yudao.module.exam.vo.ExamBatchNewVO;
|
||||||
import cn.iocoder.yudao.module.exam.vo.ExamBatchVO;
|
import cn.iocoder.yudao.module.exam.vo.ExamBatchVO;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@ -146,4 +147,30 @@ public class ExamBatchServiceImpl extends ServiceImpl<ExamBatchMapper, ExamBatch
|
|||||||
return examBatchVO;
|
return examBatchVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
/**
|
||||||
|
* 某一教练学员通过和未通过列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public IPage<ExamBatchNewVO> getStudentByCoachId(int subject, Long coachId, String ifPass, String name, String sort, String timeType, String startTime, String endTime, Page<ExamBatchNewVO> page) {
|
||||||
|
String startTimeStr = "";
|
||||||
|
String endTimeStr = "";
|
||||||
|
if("more".equals(timeType)){
|
||||||
|
if(StringUtils.isNotEmpty(startTime)){
|
||||||
|
startTimeStr = startTime+" 00:00:01";
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotEmpty(endTime)) {
|
||||||
|
endTimeStr = endTime + " 23:59:59";
|
||||||
|
}
|
||||||
|
}else if("month".equals(timeType)){
|
||||||
|
//当月
|
||||||
|
startTimeStr = DateUtil.format(DateUtil.beginOfMonth(DateUtil.date()),"yyyy-MM-dd")+" 00:00:01";
|
||||||
|
endTimeStr = DateUtil.format(DateUtil.endOfMonth(DateUtil.date()),"yyyy-MM-dd")+" 23:59:59";
|
||||||
|
}else if("day".equals(timeType)){
|
||||||
|
//当天
|
||||||
|
startTimeStr = DateUtil.formatDate(DateUtil.date())+" 00:00:01";
|
||||||
|
endTimeStr = DateUtil.formatDate(DateUtil.date())+" 23:59:59";
|
||||||
|
}
|
||||||
|
return examBatchMapper.getStudentByCoachId(subject,coachId,ifPass,name,sort,startTimeStr,endTimeStr,page);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@ -0,0 +1,34 @@
|
|||||||
|
package cn.iocoder.yudao.module.exam.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.exam.entity.ExamBatch;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ExamBatchNewVO extends ExamBatch {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学员姓名
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学员头像
|
||||||
|
*/
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学员id
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* 学员手机号
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考试时间
|
||||||
|
*/
|
||||||
|
private Date startTime;
|
||||||
|
}
|
||||||
@ -38,4 +38,11 @@ public class ExamBatchVO extends ExamBatch {
|
|||||||
*/
|
*/
|
||||||
private Integer studentCount;
|
private Integer studentCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 教练头像
|
||||||
|
*/
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -529,6 +529,7 @@
|
|||||||
AND dsco.create_time <= #{endTime}
|
AND dsco.create_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectStudentListCount" resultType="cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO">
|
<select id="selectStudentListCount" resultType="cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO">
|
||||||
SELECT
|
SELECT
|
||||||
main.id AS id,
|
main.id AS id,
|
||||||
@ -588,4 +589,66 @@
|
|||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 获取教练已经毕业的学员列表-->
|
||||||
|
<select id="getGradStudentByCourseType" resultType="cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent">
|
||||||
|
SELECT
|
||||||
|
dss.*
|
||||||
|
FROM drive_school_process dsp
|
||||||
|
INNER JOIN drive_school_coach dsc ON dsc.user_id = dsp.coach_id AND dsc.deleted = 0
|
||||||
|
INNER JOIN drive_school_student dss ON dsp.user_id = dss.user_id AND dss.deleted = 0
|
||||||
|
WHERE
|
||||||
|
dsp.subject = 3
|
||||||
|
AND dsp.exam_status = '1'
|
||||||
|
AND dsp.deleted = 0
|
||||||
|
AND dsc.user_id = #{coachId}
|
||||||
|
<if test="courseType != null and courseType != ''">
|
||||||
|
AND dsp.course_type = #{courseType}
|
||||||
|
</if>
|
||||||
|
<if test="name != null and name != ''">
|
||||||
|
AND dss.name LIKE CONCAT('%', #{name}, '%')
|
||||||
|
</if>
|
||||||
|
<choose>
|
||||||
|
<when test="sort=='asc'">
|
||||||
|
ORDER BY
|
||||||
|
dss.create_time ASC
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
ORDER BY
|
||||||
|
dss.create_time DESC
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 获取教练已经毕业的学员列表-->
|
||||||
|
<select id="getNoGradStudentByCourseType" resultType="cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent">
|
||||||
|
SELECT
|
||||||
|
dss.*
|
||||||
|
FROM drive_school_process dsp
|
||||||
|
INNER JOIN drive_school_coach dsc ON dsc.user_id = dsp.coach_id AND dsc.deleted = 0
|
||||||
|
INNER JOIN drive_school_student dss ON dsp.user_id = dss.user_id AND dss.deleted = 0
|
||||||
|
WHERE
|
||||||
|
dsp.subject = 3
|
||||||
|
AND (dsp.exam_status != '1' OR dsp.exam_status IS NULL)
|
||||||
|
AND dsp.deleted = 0
|
||||||
|
AND dsc.user_id = #{coachId}
|
||||||
|
<if test="courseType != null and courseType != ''">
|
||||||
|
AND dsp.course_type = #{courseType}
|
||||||
|
</if>
|
||||||
|
<if test="name != null and name != ''">
|
||||||
|
AND dss.name LIKE CONCAT('%', #{name}, '%')
|
||||||
|
</if>
|
||||||
|
<choose>
|
||||||
|
<when test="sort=='asc'">
|
||||||
|
ORDER BY
|
||||||
|
dss.create_time ASC
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
ORDER BY
|
||||||
|
dss.create_time DESC
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -200,4 +200,96 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getGraduateStudent" resultType="cn.iocoder.yudao.module.course.entity.Process">
|
||||||
|
SELECT
|
||||||
|
dsc.user_id AS coach_id,
|
||||||
|
dsc.name AS coach_name,
|
||||||
|
dsp.course_type,
|
||||||
|
dsp.user_id,
|
||||||
|
dsc.image AS images
|
||||||
|
FROM drive_school_coach dsc
|
||||||
|
LEFT JOIN drive_school_process dsp
|
||||||
|
ON dsc.user_id = dsp.coach_id
|
||||||
|
AND dsp.deleted = 0
|
||||||
|
AND dsp.exam_status = 1
|
||||||
|
AND dsp.subject = 3
|
||||||
|
<if test="courseType != null and courseType != ''">
|
||||||
|
AND dsp.course_type = #{courseType}
|
||||||
|
</if>
|
||||||
|
<where>
|
||||||
|
dsc.deleted = 0
|
||||||
|
AND dsc.type = 'jl'
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getNoGraduateStudent" resultType="cn.iocoder.yudao.module.course.entity.Process">
|
||||||
|
SELECT
|
||||||
|
dsc.user_id AS coach_id,
|
||||||
|
dsc.name AS coach_name,
|
||||||
|
dsp.course_type,
|
||||||
|
dsp.user_id,
|
||||||
|
dsc.image AS images
|
||||||
|
FROM drive_school_coach dsc
|
||||||
|
LEFT JOIN drive_school_process dsp
|
||||||
|
ON dsc.user_id = dsp.coach_id
|
||||||
|
AND dsp.deleted = 0
|
||||||
|
AND (dsp.exam_status != '1' OR dsp.exam_status IS NULL)
|
||||||
|
AND dsp.subject = 3
|
||||||
|
<if test="courseType != null and courseType != ''">
|
||||||
|
AND dsp.course_type = #{courseType}
|
||||||
|
</if>
|
||||||
|
<where>
|
||||||
|
dsc.deleted = 0
|
||||||
|
AND dsc.type = 'jl'
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getPassStudent" resultType="cn.iocoder.yudao.module.course.vo.ProcessVO">
|
||||||
|
SELECT
|
||||||
|
dss.user_id,
|
||||||
|
dss.name,
|
||||||
|
dss.avatar
|
||||||
|
FROM drive_school_process dsp
|
||||||
|
LEFT JOIN drive_school_student dss ON dsp.user_id = dss.user_id AND dss.deleted = 0
|
||||||
|
WHERE dsp.subject = #{subject}
|
||||||
|
AND dsp.coach_id = #{coachId}
|
||||||
|
AND dsp.deleted = 0
|
||||||
|
AND dsp.exam_status = 1
|
||||||
|
<if test="courseType != null and courseType != ''">
|
||||||
|
AND dsp.course_type = #{courseType}
|
||||||
|
</if>
|
||||||
|
<if test="name != null and name != ''">
|
||||||
|
AND dss.name LIKE CONCAT('%', #{name}, '%')
|
||||||
|
</if>
|
||||||
|
<choose>
|
||||||
|
<when test="sort=='asc'">
|
||||||
|
ORDER BY
|
||||||
|
dss.create_time ASC
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
ORDER BY
|
||||||
|
dss.create_time DESC
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getPassStudentList" resultType="cn.iocoder.yudao.module.course.vo.ProcessVO">
|
||||||
|
SELECT
|
||||||
|
dss.user_id,
|
||||||
|
dss.name,
|
||||||
|
dss.avatar
|
||||||
|
FROM drive_school_process dsp
|
||||||
|
LEFT JOIN drive_school_student dss ON dsp.user_id = dss.user_id AND dss.deleted = 0
|
||||||
|
WHERE dsp.subject = #{subject}
|
||||||
|
AND dsp.coach_id = #{coachId}
|
||||||
|
AND dsp.deleted = 0
|
||||||
|
AND dsp.exam_status = 1
|
||||||
|
<if test="startTime!=null and startTime!=''">
|
||||||
|
AND dsp.exam_time >= #{startTime}
|
||||||
|
</if>
|
||||||
|
<if test="endTime!=null and endTime!=''">
|
||||||
|
AND dsp.exam_time <= #{endTime}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -28,6 +28,7 @@
|
|||||||
<if test="entity.userId != null and entity.userId != ''"> and main.user_id = #{entity.userId}</if>
|
<if test="entity.userId != null and entity.userId != ''"> and main.user_id = #{entity.userId}</if>
|
||||||
<if test="entity.paymentStatus != null and entity.paymentStatus != ''"> and main.payment_status = #{entity.paymentStatus}</if>
|
<if test="entity.paymentStatus != null and entity.paymentStatus != ''"> and main.payment_status = #{entity.paymentStatus}</if>
|
||||||
<if test="entity.ifEnd != null and entity.ifEnd != ''"> and main.if_end = #{entity.ifEnd}</if>
|
<if test="entity.ifEnd != null and entity.ifEnd != ''"> and main.if_end = #{entity.ifEnd}</if>
|
||||||
|
<if test="entity.coachUserName != null and entity.coachUserName != ''"> and main.coach_user_name = #{entity.coachUserName}</if>
|
||||||
</where>
|
</where>
|
||||||
order by main.create_time desc
|
order by main.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@ -163,6 +163,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
c.user_id AS coach_id,
|
c.user_id AS coach_id,
|
||||||
c.name AS coach_name,
|
c.name AS coach_name,
|
||||||
|
c.image,
|
||||||
COUNT(i.id) AS student_count,
|
COUNT(i.id) AS student_count,
|
||||||
SUM(CASE WHEN i.if_pass = 1 THEN 1 ELSE 0 END) AS pass_count,
|
SUM(CASE WHEN i.if_pass = 1 THEN 1 ELSE 0 END) AS pass_count,
|
||||||
ROUND(
|
ROUND(
|
||||||
@ -179,15 +180,15 @@
|
|||||||
LEFT JOIN drive_school_exam_batch_item i
|
LEFT JOIN drive_school_exam_batch_item i
|
||||||
ON i.batch_id = b.id AND i.deleted = 0
|
ON i.batch_id = b.id AND i.deleted = 0
|
||||||
<if test="entity.startTimeSearch != null and entity.startTimeSearch != '' ">
|
<if test="entity.startTimeSearch != null and entity.startTimeSearch != '' ">
|
||||||
AND i.create_time >= #{entity.startTimeSearch}
|
AND b.start_time >= #{entity.startTimeSearch}
|
||||||
</if>
|
</if>
|
||||||
<if test="entity.endTimeSearch != null and entity.endTimeSearch != '' ">
|
<if test="entity.endTimeSearch != null and entity.endTimeSearch != '' ">
|
||||||
AND i.create_time <= #{entity.endTimeSearch}
|
AND b.start_time <= #{entity.endTimeSearch}
|
||||||
</if>
|
</if>
|
||||||
WHERE
|
WHERE
|
||||||
c.deleted = 0
|
c.deleted = 0
|
||||||
<if test="entity.coachId != null">
|
<if test="entity.coachId != null">
|
||||||
AND c.id = #{entity.coachId}
|
AND c.user_id = #{entity.coachId}
|
||||||
</if>
|
</if>
|
||||||
GROUP BY
|
GROUP BY
|
||||||
c.id, c.name
|
c.id, c.name
|
||||||
|
|||||||
@ -27,4 +27,50 @@
|
|||||||
</if>
|
</if>
|
||||||
ORDER BY dseb.create_time DESC
|
ORDER BY dseb.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getStudentByCoachId" resultType="cn.iocoder.yudao.module.exam.vo.ExamBatchNewVO">
|
||||||
|
SELECT
|
||||||
|
dss.name,
|
||||||
|
dss.user_id,
|
||||||
|
dss.avatar,
|
||||||
|
dss.phone,
|
||||||
|
dseb.start_time
|
||||||
|
FROM
|
||||||
|
drive_school_coach dsc
|
||||||
|
INNER JOIN
|
||||||
|
drive_school_exam_batch dseb
|
||||||
|
ON dseb.coach_id = dsc.user_id
|
||||||
|
AND dseb.deleted = 0
|
||||||
|
AND dseb.subject = #{subject}
|
||||||
|
INNER JOIN
|
||||||
|
drive_school_exam_batch_item dsebi
|
||||||
|
ON dsebi.batch_id = dseb.id
|
||||||
|
AND dsebi.deleted = 0
|
||||||
|
AND dsebi.if_pass = #{ifPass}
|
||||||
|
INNER JOIN
|
||||||
|
drive_school_student dss
|
||||||
|
ON dsebi.user_id = dss.user_id
|
||||||
|
WHERE
|
||||||
|
<if test="coachId != null">
|
||||||
|
dsc.user_id = #{coachId}
|
||||||
|
</if>
|
||||||
|
<if test="startTime != null and startTime != '' ">
|
||||||
|
AND dseb.start_time >= #{startTime}
|
||||||
|
</if>
|
||||||
|
<if test="endTime != null and endTime != '' ">
|
||||||
|
AND dseb.start_time <= #{endTime}
|
||||||
|
</if>
|
||||||
|
<if test="name != null and name != ''">
|
||||||
|
AND dss.name LIKE CONCAT('%', #{name}, '%')
|
||||||
|
</if>
|
||||||
|
ORDER BY
|
||||||
|
<choose>
|
||||||
|
<when test="sort == 'asc'">
|
||||||
|
dseb.start_time ASC
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
dseb.start_time DESC
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user