1
This commit is contained in:
parent
c62b724b90
commit
3dccc64d94
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.base.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
@ -14,6 +15,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@ -151,6 +153,27 @@ public class DlDriveSchoolStudentServiceImpl extends ServiceImpl<DlDriveSchoolSt
|
||||
**/
|
||||
@Override
|
||||
public IPage<DlDriveSchoolStudentVO> queryCoachListPage(DlDriveSchoolStudentVO pageReqVO, Page<DlDriveSchoolStudentVO> page) {
|
||||
//默认查全部数据
|
||||
String startTimeStr = "";
|
||||
String endTimeStr = "";
|
||||
if("more".equals(pageReqVO.getTimeType())){
|
||||
if(StringUtils.isNotEmpty(pageReqVO.getStartTime())){
|
||||
startTimeStr = pageReqVO.getStartTime()+" 00:00:01";
|
||||
}
|
||||
if(StringUtils.isNotEmpty(pageReqVO.getEndTime())) {
|
||||
endTimeStr = pageReqVO.getEndTime() + " 23:59:59";
|
||||
}
|
||||
}else if("month".equals(pageReqVO.getTimeType())){
|
||||
//当月
|
||||
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(pageReqVO.getTimeType())){
|
||||
//当天
|
||||
startTimeStr = DateUtil.formatDate(DateUtil.date())+" 00:00:01";
|
||||
endTimeStr = DateUtil.formatDate(DateUtil.date())+" 23:59:59";
|
||||
}
|
||||
pageReqVO.setStartTime(startTimeStr);
|
||||
pageReqVO.setStartTime(endTimeStr);
|
||||
IPage<DlDriveSchoolStudentVO> pageResult = dlDriveSchoolStudentMapper.selectByCoachId(pageReqVO,page);
|
||||
pageResult.getRecords().forEach(item->{
|
||||
//查每个学生的当前所处的科目
|
||||
|
@ -22,4 +22,11 @@ public class DlDriveSchoolStudentVO extends DlDriveSchoolStudent {
|
||||
private String courseType;
|
||||
/**科目*/
|
||||
private Integer subject;
|
||||
|
||||
/**时间查询类型(all-全部|day-当日|month-当月|more-自定义)*/
|
||||
private String timeType;
|
||||
/**查询时间范围--开始*/
|
||||
private String startTime;
|
||||
/**查询时间范围--结束*/
|
||||
private String endTime;
|
||||
}
|
@ -16,4 +16,6 @@ public class StudentCountVO {
|
||||
private Integer c2Num;
|
||||
/**总人数*/
|
||||
private Integer totalNum;
|
||||
/**userId*/
|
||||
private Long userId;
|
||||
}
|
||||
|
@ -94,6 +94,7 @@ public class TrainController {
|
||||
public CommonResult<IPage<?>> indexGetTrainList(@RequestParam(value = "type") String type,
|
||||
@RequestParam(value = "timeType") String timeType,
|
||||
@RequestParam(value = "coachId",required = false) Long coachId,
|
||||
@RequestParam(value = "sourceCoachId",required = false) Long sourceCoachId,
|
||||
@RequestParam(value = "searchValue",required = false) String searchValue,
|
||||
@RequestParam(value = "courseType",required = false) String courseType,
|
||||
@RequestParam(value = "subject",required = false) Integer subject,
|
||||
|
@ -115,6 +115,12 @@
|
||||
<if test="entity.name != null and entity.name!=''">
|
||||
AND dss.`name` LIKE CONCAT('%',#{entity.name},'%')
|
||||
</if>
|
||||
<if test="entity.startTime!=null and entity.startTime!=''">
|
||||
AND dss.create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="entity.endTime!=null and entity.endTime!=''">
|
||||
AND dss.create_time <= #{endTime}
|
||||
</if>
|
||||
AND dss.id IS NOT NULL
|
||||
ORDER BY
|
||||
dss.create_time DESC
|
||||
@ -211,16 +217,17 @@
|
||||
c.image AS image,
|
||||
c.NAME AS coachName,
|
||||
c.car_id AS carId,
|
||||
c.user_id AS userId,
|
||||
COUNT(DISTINCT s.user_id) AS totalNum,
|
||||
COUNT(DISTINCT CASE WHEN o.course_type = 'C1' THEN o.user_id END) AS c1Num,
|
||||
COUNT(DISTINCT CASE WHEN o.course_type = 'C2' THEN o.user_id END) AS c2Num
|
||||
FROM
|
||||
drive_school_coach c
|
||||
LEFT JOIN drive_school_student s ON c.id = s.source_user_id
|
||||
LEFT JOIN drive_school_student s ON c.user_id = s.source_user_id AND s.deleted=0
|
||||
<if test="type != null and type != ''">
|
||||
AND s.source = #{type}
|
||||
</if>
|
||||
LEFT JOIN drive_school_course_order o ON s.user_id = o.user_id AND o.payment_status > 1
|
||||
LEFT JOIN drive_school_course_order o ON s.user_id = o.user_id AND o.payment_status > 1 AND o.deleted=0
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND o.create_time >= #{startTime}
|
||||
</if>
|
||||
|
Loading…
Reference in New Issue
Block a user