# Conflicts:
#	dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/mapper/DlDriveSchoolStudentMapper.java
This commit is contained in:
Vinjor 2025-02-21 10:31:56 +08:00
commit 72c6b2904c
5 changed files with 131 additions and 25 deletions

View File

@ -126,7 +126,7 @@ public class DlDriveSchoolStudentController {
**/
@GetMapping("/indexStuentList")
@Operation(summary = "首页数据统计查询接口")
public CommonResult<List<?>> indexGetTrainList(@RequestParam(value = "type") String type,
public CommonResult<List<?>> indexStuentList(@RequestParam(value = "type") String type,
@RequestParam(value = "timeType") String timeType,
@RequestParam(value = "coachId", required = false) Long coachId,
@RequestParam(value = "startTime", required = false) String startTime,
@ -152,4 +152,46 @@ public class DlDriveSchoolStudentController {
}
return success(schoolStudentService.indexGetTrainList(type,coachId,startTimeStr,endTimeStr));
}
/**
* 查询自来学生列表
* @author PQZ
* @date 11:41 2025/2/20
* @param type 时间查询类型01驾校统招02教练自招03自来客户
* @param timeType 时间查询类型all-全部|day-当日|month-当月|more-自定义
* @param coachId 教练id
* @param startTime 查询时间范围--开始
* @param endTime 查询时间范围--结束
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.util.List<?>>
**/
@GetMapping("/indexGetFormList")
@Operation(summary = "首页数据统计查询接口")
public CommonResult<List<?>> indexGetFormList(@RequestParam(value = "type") String type,
@RequestParam(value = "timeType") String timeType,
@RequestParam(value = "coachId", required = false) Long coachId,
@RequestParam(value = "startTime", required = false) String startTime,
@RequestParam(value = "endTime", required = false) String endTime){
//默认查全部数据
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 success(schoolStudentService.indexGetFormList(type,coachId,startTimeStr,endTimeStr));
}
}

View File

@ -33,6 +33,7 @@ public interface DlDriveSchoolStudentMapper extends BaseMapper<DlDriveSchoolStud
/**
* 获取可以考试的学员列表
*
* @author vinjor-M
* @date 23:19 2025/1/20
**/
@ -41,8 +42,7 @@ public interface DlDriveSchoolStudentMapper extends BaseMapper<DlDriveSchoolStud
/**
* 手机端人员管理查询学员信息
* @author PQZ
* @date 14:48 2025/2/6
*
* @param staffVO {@link DlDriveSchoolStaffVO}
* @param page 分页参数
* @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO>
@ -51,27 +51,30 @@ public interface DlDriveSchoolStudentMapper extends BaseMapper<DlDriveSchoolStud
/**
* 教练查询自己的学生
* @author vinjor-M
* @date 17:23 2025/2/12
*
* @param pageReqVO TODO
* @param page TODO
* @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO>
* @author vinjor-M
* @date 17:23 2025/2/12
**/
IPage<DlDriveSchoolStudentVO> selectByCoachId(@Param("entity") DlDriveSchoolStudentVO pageReqVO, Page<DlDriveSchoolStudentVO> page);
/**
* 查学生列表---驾校层面查询
* @author vinjor-M
* @date 15:13 2025/2/14
*
* @param coachId 教练ID
* @param startTime 开始时间
* @param endTime 结束时间
* @return java.util.List<cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO>
* @author vinjor-M
* @date 15:13 2025/2/14
**/
List<DlDriveSchoolStudentVO> selectStudentList(@Param("coachId") Long coachId, @Param("startTime") String startTime, @Param("endTime") String endTime);
/**
* 教练层面查询自己的学生列表
*
* @author vinjor-M
* @date 15:24 2025/2/17
**/
@ -79,8 +82,7 @@ public interface DlDriveSchoolStudentMapper extends BaseMapper<DlDriveSchoolStud
/**
* app首页查询训练学员---指定条件下
* @author vinjor-M
* @date 15:53 2025/2/19
*
* @param coachId 教练ID
* @param startTime 开始时间
* @param endTime 截止时间
@ -105,4 +107,15 @@ public interface DlDriveSchoolStudentMapper extends BaseMapper<DlDriveSchoolStud
* @date 17:08 2025/2/19
**/
List<StudentCountVO> indexGetTrainList(@Param("type") String type, @Param("coachId") Long coachId, @Param("startTime") String startTime, @Param("endTime") String endTime);
/**
* @param type 时间查询类型01驾校统招02教练自招03自来客户
* @param coachId 教练id
* @param startTime 查询时间范围--开始
* @param endTime 查询时间范围--结束
* @return java.util.List<cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO>
* @author PQZ
* @date 11:54 2025/2/20
**/
List<DlDriveSchoolStaffVO> indexGetFormList(@Param("type") String type, @Param("coachId") Long coachId, @Param("startTime") String startTime, @Param("endTime") String endTime);
}

View File

@ -123,4 +123,16 @@ public interface DlDriveSchoolStudentService extends IService<DlDriveSchoolStude
* @return java.util.List<cn.iocoder.yudao.module.base.vo.StudentCountVO>
**/
List<StudentCountVO> indexGetTrainList(String type, Long coachId, String startTime, String endTime);
/**
*
* @author PQZ
* @date 11:43 2025/2/20
* @param type 时间查询类型01驾校统招02教练自招03自来客户
* @param coachId 教练id
* @param startTimeStr 查询时间范围--开始
* @param endTimeStr 查询时间范围--结束
* @return cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO
**/
List<DlDriveSchoolStaffVO> indexGetFormList(String type, Long coachId, String startTimeStr, String endTimeStr);
}

View File

@ -174,5 +174,19 @@ public class DlDriveSchoolStudentServiceImpl extends ServiceImpl<DlDriveSchoolSt
return dlDriveSchoolStudentMapper.indexGetTrainList(type,coachId,startTime,endTime);
}
/**
* @param type 时间查询类型01驾校统招02教练自招03自来客户
* @param coachId 教练id
* @param startTimeStr 查询时间范围--开始
* @param endTimeStr 查询时间范围--结束
* @return cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO
* @author PQZ
* @date 11:43 2025/2/20
**/
@Override
public List<DlDriveSchoolStaffVO> indexGetFormList(String type, Long coachId, String startTimeStr, String endTimeStr) {
return dlDriveSchoolStudentMapper.indexGetFormList(type,coachId,startTimeStr,endTimeStr);
}
}

View File

@ -233,4 +233,29 @@
ORDER BY
totalNum ASC;
</select>
<select id="indexGetFormList" resultType="cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO">
SELECT
main.id AS id,
main.avatar AS avatar,
main.name AS name,
main.phone AS phone,
dsco.course_type AS courseType
FROM
drive_school_student main
LEFT JOIN drive_school_course_order dsco ON main.user_id = dsco.user_id
WHERE main.deleted = 0
AND dsco.payment_status > 1
<if test="type != null and type != ''">
AND dsco.source = #{type}
</if>
<if test="coachId != null and coachId != ''">
AND dsco.user_id = #{coachId}
</if>
<if test="startTime != null and startTime != ''">
AND dsco.create_time &gt;= #{starTime}
</if>
<if test="endTime != null and endTime != ''">
AND dsco.create_time &lt;= #{endTime}
</if>
</select>
</mapper>