This commit is contained in:
Vinjor 2025-02-27 17:34:02 +08:00
parent af10e91e51
commit c62b724b90
6 changed files with 50 additions and 28 deletions

View File

@ -157,18 +157,14 @@ public class DlDriveSchoolStudentController {
* 查询自来学生列表
* @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,
public CommonResult<List<?>> indexGetFormList(@RequestParam(value = "timeType") String timeType,
@RequestParam(value = "startTime", required = false) String startTime,
@RequestParam(value = "endTime", required = false) String endTime){
//默认查全部数据
@ -190,7 +186,7 @@ public class DlDriveSchoolStudentController {
startTimeStr = DateUtil.formatDate(DateUtil.date())+" 00:00:01";
endTimeStr = DateUtil.formatDate(DateUtil.date())+" 23:59:59";
}
return success(schoolStudentService.indexGetFormList(type,coachId,startTimeStr,endTimeStr));
return success(schoolStudentService.indexGetFormList(startTimeStr,endTimeStr));
}

View File

@ -116,13 +116,22 @@ public interface DlDriveSchoolStudentMapper extends BaseMapper<DlDriveSchoolStud
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);
List<DlDriveSchoolStaffVO> indexGetFormList( @Param("startTime") String startTime, @Param("endTime") String endTime);
/**
* 首页查询自来的学生
* @author vinjor-M
* @date 15:55 2025/2/26
* @param startTime TODO
* @param endTime TODO
* @return java.util.List<cn.iocoder.yudao.module.base.vo.StudentCountVO>
**/
List<StudentCountVO> indexCusStudentList(String startTime, String endTime);
}

View File

@ -125,14 +125,12 @@ public interface DlDriveSchoolStudentService extends IService<DlDriveSchoolStude
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);
List<DlDriveSchoolStaffVO> indexGetFormList( String startTimeStr, String endTimeStr);
}

View File

@ -170,12 +170,16 @@ public class DlDriveSchoolStudentServiceImpl extends ServiceImpl<DlDriveSchoolSt
**/
@Override
public List<StudentCountVO> indexGetTrainList(String type, Long coachId, String startTime, String endTime) {
return dlDriveSchoolStudentMapper.indexGetTrainList(type,coachId,startTime,endTime);
if("03".equals(type)){
//自来的学生
return dlDriveSchoolStudentMapper.indexCusStudentList(startTime,endTime);
}else{
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
@ -183,8 +187,8 @@ public class DlDriveSchoolStudentServiceImpl extends ServiceImpl<DlDriveSchoolSt
* @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);
public List<DlDriveSchoolStaffVO> indexGetFormList(String startTimeStr, String endTimeStr) {
return dlDriveSchoolStudentMapper.indexGetFormList(startTimeStr,endTimeStr);
}

View File

@ -43,6 +43,8 @@ public class DlDriveSchoolStaffVO {
private String sort;
/**教练ID*/
private Long coachId;
/**招生的教练ID*/
private Long sourceCoachId;
/**查询时间范围--开始*/
private String startTime;
/**查询时间范围--结束*/

View File

@ -67,6 +67,9 @@
<if test="entity.coachId != null and entity.coachId != ''">
AND dsp.coach_id = #{entity.coachId}
</if>
<if test="entity.sourceCoachId != null and entity.sourceCoachId != ''">
AND main.source_user_id = #{entity.sourceCoachId}
</if>
<if test="entity.name!=null and entity.name!=''">
AND main.name LIKE CONCAT('%',#{entity.name},'%')
</if>
@ -204,6 +207,7 @@
</select>
<select id="indexGetTrainList" resultType="cn.iocoder.yudao.module.base.vo.StudentCountVO">
SELECT
c.id,
c.image AS image,
c.NAME AS coachName,
c.car_id AS carId,
@ -218,7 +222,7 @@
</if>
LEFT JOIN drive_school_course_order o ON s.user_id = o.user_id AND o.payment_status > 1
<if test="startTime != null and startTime != ''">
AND o.create_time &gt;= #{starTime}
AND o.create_time &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND o.create_time &lt;= #{endTime}
@ -228,10 +232,20 @@
<if test="coachId != null and coachId != ''">
AND c.user_id = #{coachId}
</if>
<if test="type != null and type != ''">
<choose>
<when test="type=='01'">
AND c.type='yg'
</when>
<when test="type=='02'">
AND c.type='jl'
</when>
</choose>
</if>
GROUP BY
c.image, c.NAME, c.car_id
c.id
ORDER BY
totalNum ASC;
totalNum DESC
</select>
<select id="indexGetFormList" resultType="cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO">
SELECT
@ -239,20 +253,16 @@
main.avatar AS avatar,
main.name AS name,
main.phone AS phone,
main.user_id AS userId,
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>
AND main.source='03'
<if test="startTime != null and startTime != ''">
AND dsco.create_time &gt;= #{starTime}
AND dsco.create_time &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND dsco.create_time &lt;= #{endTime}
@ -276,4 +286,7 @@
GROUP BY
main.id
</select>
<select id="indexCusStudentList" resultType="cn.iocoder.yudao.module.base.vo.StudentCountVO">
</select>
</mapper>