This commit is contained in:
Vinjor 2025-02-19 17:28:47 +08:00
parent 861463a8aa
commit c02b4143b8
2 changed files with 26 additions and 5 deletions
dl-module-jx/src/main
java/cn/iocoder/yudao/module/train/controller/admin
resources/mapper/jx

View File

@ -7,6 +7,7 @@ import cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent;
import cn.iocoder.yudao.module.base.mapper.DlDriveSchoolStudentMapper;
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO;
import cn.iocoder.yudao.module.course.service.ProcessService;
import cn.iocoder.yudao.module.jx.domain.DriveSchoolCar;
import cn.iocoder.yudao.module.jx.mapper.DriveSchoolCarMapper;
import cn.iocoder.yudao.module.train.service.TrainService;
import cn.iocoder.yudao.module.train.vo.TrainVO;
@ -116,7 +117,7 @@ public class TrainController {
startTimeStr = DateUtil.formatDate(DateUtil.date())+" 00:00:01";
endTimeStr = DateUtil.formatDate(DateUtil.date())+" 23:59:59";
}
if("car".equals(type)){
if("student".equals(type)){
Page<DlDriveSchoolStudent> page = new Page<>(pageNo,pageSize);
IPage<DlDriveSchoolStudentVO> studentPage = studentMapper.selectTrainStudent(coachId,startTimeStr,endTimeStr,page);
studentPage.getRecords().forEach(item->{
@ -124,9 +125,10 @@ public class TrainController {
item.setProcess(processService.selectByUserId(item.getUserId(),item.getCoachId()));
});
return success(studentPage);
}else if("student".equals(type)){
// return success(trainService.indexGetTrainList(type,timeType,coachId,startTimeStr,endTimeStr));
}else{
//训练车辆
Page<DriveSchoolCar> page = new Page<>(pageNo,pageSize);
return success(carMapper.selectTrainCar(coachId,startTimeStr,endTimeStr,page));
}
return success(null);
}
}

View File

@ -98,7 +98,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where deleted = 0 and car_no = #{carNo}
</select>
<select id="selectTrainCar" resultType="cn.iocoder.yudao.module.jx.domain.DriveSchoolCar">
SELECT
dsc.*
FROM
drive_school_car dsc
LEFT JOIN drive_school_train dst ON dsc.user_id = dst.coach_id
AND dst.deleted = 0
WHERE
dst.id IS NOT NULL
AND dsc.deleted = 0
<if test="coachId != null and coachId != ''">
AND dst.coach_id = #{coachId}
</if>
<if test="startTime!=null and startTime!=''">
AND dst.create_time &gt;= #{startTime}
</if>
<if test="endTime!=null and endTime!=''">
AND dst.create_time &lt;= #{endTime}
</if>
GROUP BY
dsc.id
</select>