1
This commit is contained in:
parent
f881f603f0
commit
af10e91e51
@ -11,8 +11,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 数据查询统一方法")
|
||||
@ -57,4 +55,15 @@ public class DataViewController {
|
||||
@RequestParam(value = "endTime",required = false) String endTime) {
|
||||
return success(dataViewService.selectIndexInfo(type,timeType,coachId,startTime,endTime));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询学生总数
|
||||
* @author vinjor-M
|
||||
* @date 15:57 2025/2/25
|
||||
**/
|
||||
@GetMapping("/getStudentCount")
|
||||
@Operation(summary = "查询学生总数")
|
||||
public CommonResult<?> getStudentCount() {
|
||||
return success(dataViewService.getStudentCount());
|
||||
}
|
||||
}
|
@ -48,6 +48,13 @@ public interface DlDriveSchoolStudentMapper extends BaseMapper<DlDriveSchoolStud
|
||||
* @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO>
|
||||
**/
|
||||
IPage<DlDriveSchoolStaffVO> pageStaffStudent(@Param("entity") DlDriveSchoolStaffVO staffVO, Page<DlDriveSchoolStaffVO> page);
|
||||
/**
|
||||
* 查所有学生列表
|
||||
* @author vinjor-M
|
||||
* @date 16:11 2025/2/25
|
||||
* @return java.util.List<cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO>
|
||||
**/
|
||||
List<DlDriveSchoolStaffVO> selectStudentListCount();
|
||||
|
||||
/**
|
||||
* 教练查询自己的学生
|
||||
|
@ -3,6 +3,8 @@ package cn.iocoder.yudao.module.base.service;
|
||||
import cn.iocoder.yudao.module.base.vo.IndexDataVO;
|
||||
import cn.iocoder.yudao.module.base.vo.StudentInfoVO;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 数据查询统一方法
|
||||
*
|
||||
@ -28,4 +30,12 @@ public interface DataViewService {
|
||||
* @param endTime 查询时间范围--结束
|
||||
**/
|
||||
IndexDataVO selectIndexInfo(String type, String timeType, Long coachId, String startTime, String endTime);
|
||||
|
||||
/**
|
||||
* 查询学生总数
|
||||
* @author vinjor-M
|
||||
* @date 15:58 2025/2/25
|
||||
* @return java.util.Map<java.lang.String,java.lang.Object>
|
||||
**/
|
||||
Map<String,Object> getStudentCount();
|
||||
}
|
@ -6,10 +6,7 @@ import cn.iocoder.yudao.module.base.mapper.DlDriveSchoolStudentMapper;
|
||||
import cn.iocoder.yudao.module.base.service.DataViewService;
|
||||
import cn.iocoder.yudao.module.base.service.DlDriveSchoolCoachService;
|
||||
import cn.iocoder.yudao.module.base.service.DlDriveSchoolStudentService;
|
||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolCoachRespVO;
|
||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO;
|
||||
import cn.iocoder.yudao.module.base.vo.IndexDataVO;
|
||||
import cn.iocoder.yudao.module.base.vo.StudentInfoVO;
|
||||
import cn.iocoder.yudao.module.base.vo.*;
|
||||
import cn.iocoder.yudao.module.course.entity.Process;
|
||||
import cn.iocoder.yudao.module.course.entity.SchoolCommission;
|
||||
import cn.iocoder.yudao.module.course.mapper.SchoolCommissionMapper;
|
||||
@ -29,6 +26,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
@ -270,4 +268,24 @@ public class DataViewServiceImpl implements DataViewService {
|
||||
rtnObj.setExamInfo(examInfoMap);
|
||||
return rtnObj;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询学生总数
|
||||
*
|
||||
* @return java.util.Map<java.lang.String, java.lang.Object>
|
||||
* @author vinjor-M
|
||||
* @date 15:58 2025/2/25
|
||||
**/
|
||||
@Override
|
||||
public Map<String, Object> getStudentCount() {
|
||||
List<DlDriveSchoolStaffVO> list= studentMapper.selectStudentListCount();
|
||||
Map<String, Object> rtnMap = new HashMap<>();
|
||||
rtnMap.put("all",list.size());
|
||||
//按courseType分组
|
||||
Map<String,List<DlDriveSchoolStaffVO>> map = list.stream().collect(Collectors.groupingBy(DlDriveSchoolStaffVO::getCourseType));
|
||||
for (String key:map.keySet()){
|
||||
rtnMap.put(key,map.get(key).size());
|
||||
}
|
||||
return rtnMap;
|
||||
}
|
||||
}
|
||||
|
@ -258,4 +258,22 @@
|
||||
AND dsco.create_time <= #{endTime}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectStudentListCount" resultType="cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO">
|
||||
SELECT
|
||||
main.id AS id,
|
||||
dsco.course_type
|
||||
FROM
|
||||
drive_school_student main
|
||||
LEFT JOIN drive_school_course_order dsco ON main.user_id = dsco.user_id
|
||||
AND dsco.deleted = 0
|
||||
AND dsco.payment_status IN ( '2', '3', '4', '5' )
|
||||
AND dsco.if_end = 0
|
||||
LEFT JOIN drive_school_process dsp ON main.user_id = dsp.user_id
|
||||
AND dsco.course_id = dsp.course_id
|
||||
AND dsp.`status` = '1'
|
||||
WHERE
|
||||
main.deleted = 0
|
||||
GROUP BY
|
||||
main.id
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user