1
This commit is contained in:
parent
861463a8aa
commit
c02b4143b8
dl-module-jx/src/main
java/cn/iocoder/yudao/module/train/controller/admin
resources/mapper/jx
@ -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);
|
||||
}
|
||||
}
|
@ -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 >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!=null and endTime!=''">
|
||||
AND dst.create_time <= #{endTime}
|
||||
</if>
|
||||
GROUP BY
|
||||
dsc.id
|
||||
</select>
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user