This commit is contained in:
xyc 2025-04-29 16:06:22 +08:00
parent bf96e6f341
commit 6d79a705e9
6 changed files with 121 additions and 90 deletions

View File

@ -79,6 +79,18 @@ public interface DlDriveSchoolStudentMapper extends BaseMapper<DlDriveSchoolStud
**/
List<DlDriveSchoolStudentVO> selectStudentList(@Param("coachId") Long coachId, @Param("startTime") String startTime, @Param("endTime") String endTime);
/**
* 查学生列表---驾校层面查询
*
* @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> selectStudentListByOrder(@Param("coachId") Long coachId, @Param("startTime") String startTime, @Param("endTime") String endTime);
/**
* 教练层面查询自己的学生列表
*

View File

@ -24,6 +24,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.*;
import java.util.stream.Collectors;
@ -154,8 +156,8 @@ public class DataViewServiceImpl implements DataViewService {
schoolRate = (double)schoolNum / allNum;
}
}
studentInfoMap.put("coachNum",coachNum);
studentInfoMap.put("coachAmount",coachAmount);
studentInfoMap.put("coachNum", new BigDecimal(coachNum).setScale(2, RoundingMode.HALF_UP));
studentInfoMap.put("coachAmount", new BigDecimal(coachAmount).setScale(2, RoundingMode.HALF_UP));
studentInfoMap.put("coachRate",0!=coachRate?(Double.parseDouble(df.format(coachRate))*100):0);
studentInfoMap.put("schoolNum",schoolNum);
studentInfoMap.put("schoolAmount",schoolAmount);

View File

@ -288,7 +288,7 @@ public class DlDriveSchoolCoachServiceImpl extends ServiceImpl<DlDriveSchoolCoac
result.setCoachInfo(coach);
/*2.车辆信息*/
DriveSchoolCar schoolCar = new DriveSchoolCar();
if (ObjectUtil.isNotEmpty(coach.getCarId())) {
if (ObjectUtil.isNotEmpty(schoolCar)) {
if (null != coach.getUserId()) {
schoolCar = schoolCarService.selectByCoachId(coach.getUserId());
if (null != schoolCar.getCarRegisterDate()) {

View File

@ -41,7 +41,7 @@
LEFT JOIN drive_school_coach_course dscc ON main.id = dscc.coach_id AND dscc.deleted = 0
LEFT JOIN drive_school_car dsc ON main.user_id = dsc.user_id AND dsc.deleted = 0
<where>
main.deleted = 0
main.deleted = 0 AND dscc.is_sign = 1 AND dscc.deleted = 0 AND dscc.if_end = 0
<if test="entity.type != null and entity.type != ''">
AND main.type = #{entity.type}
</if>

View File

@ -138,7 +138,7 @@
dss.* ,SUM(dsco.reserve_money+dsco.rest_money)AS priceAmount
FROM
drive_school_student dss
LEFT JOIN drive_school_course_order dsco ON dss.user_id=dsco.user_id AND dsco.deleted=0
LEFT JOIN drive_school_course_order dsco ON dss.user_id=dsco.user_id AND dsco.deleted=0 AND dsco.if_end=0 AND dsco.is_sign = 1
WHERE
dss.deleted=0
AND dsco.id IS NOT NULL
@ -153,6 +153,22 @@
</if>
GROUP BY dss.id
</select>
<select id="selectStudentListByOrder" resultType="cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO">
SELECT dss.*,SUM(dsco.reserve_money+dsco.rest_money)AS priceAmount
FROM drive_school_course_order dsco
LEFT JOIN drive_school_student dss ON dsco.user_id=dss.user_id AND dss.deleted=0
WHERE dsco.deleted=0
<if test="startTime!=null and startTime!=''">
AND dsco.create_time &gt;= #{startTime}
</if>
<if test="endTime!=null and endTime!=''">
AND dsco.create_time &lt;= #{endTime}
</if>
<if test="coachId!=null and coachId!=''">
AND dsco.coach_id=#{coachId}
</if>
GROUP BY dss.id
</select>
<select id="selectStudentListCoach" resultType="cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO">
SELECT
dss.*,dsco.grad_time AS orderGradTime,dsco.id AS orderId
@ -254,7 +270,7 @@
<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 AND o.deleted=0
LEFT JOIN drive_school_course_order o ON s.user_id = o.user_id AND o.payment_status > 1 AND o.deleted=0 AND o.is_sign = 1 AND o.if_end = 0
<if test="startTime != null and startTime != ''">
AND o.create_time &gt;= #{startTime}
</if>
@ -281,6 +297,7 @@
ORDER BY
totalNum DESC
</select>
<select id="indexGetFormList" resultType="cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO">
SELECT
main.id AS id,

View File

@ -47,7 +47,7 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
default PageResult<AdminUserDO> selectPage(UserPageReqVO reqVO, Collection<Long> deptIds) {
return selectPage(reqVO, new LambdaQueryWrapperX<AdminUserDO>()
.likeIfPresent(AdminUserDO::getUsername, reqVO.getUsername())
// .likeIfPresent(AdminUserDO::getUsername, reqVO.getUsername())
.likeIfPresent(AdminUserDO::getMobile, reqVO.getMobile())
// 这里加了个模糊查询用户名称搜索时可以模糊查用户昵称
.likeIfPresent(AdminUserDO::getNickname, reqVO.getUsername())