This commit is contained in:
xyc 2025-06-04 14:23:49 +08:00
parent bb1bfee430
commit a749fea2f3
2 changed files with 84 additions and 61 deletions

View File

@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
import java.util.List;
@Schema(description = "驾校人员-手机APP查询专用接口") @Schema(description = "驾校人员-手机APP查询专用接口")
@Data @Data
@ -55,4 +56,12 @@ public class DlDriveSchoolStaffVO {
private String endTime; private String endTime;
/**是否合格*/ /**是否合格*/
private String examStatus; private String examStatus;
/**查询时间范围*/
private List<String> rangeTime;
/**地址*/
private String address;
/**年龄*/
private List<String> age;
/**拿证天数*/
private Integer passDays;
} }

View File

@ -49,68 +49,82 @@
ORDER BY ORDER BY
dss.create_time DESC dss.create_time DESC
</select> </select>
<select id="pageStaffStudent" resultType="cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO"> <select id="pageStaffStudent" resultType="cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO">
SELECT SELECT
main.id AS id, main.id AS id,
main.NAME AS NAME, main.NAME AS NAME,
main.type AS type, main.type AS type,
main.avatar AS avatar, main.avatar AS avatar,
main.phone AS phone, main.phone AS phone,
main.user_id AS userId, main.user_id AS userId,
dsco.course_type, dsco.course_type,
dsp.`subject` dsp.`subject`
FROM FROM
drive_school_student main drive_school_student main
LEFT JOIN drive_school_course_order dsco ON main.user_id = dsco.user_id LEFT JOIN drive_school_course_order dsco ON main.user_id = dsco.user_id
AND dsco.deleted = 0 AND dsco.deleted = 0
AND dsco.payment_status IN ( '2', '3', '4', '5' ) AND dsco.payment_status IN ( '2', '3', '4', '5' )
AND dsco.if_end = 0 AND dsco.if_end = 0
LEFT JOIN drive_school_process dsp ON main.user_id = dsp.user_id LEFT JOIN drive_school_process dsp ON main.user_id = dsp.user_id
AND dsco.course_id = dsp.course_id AND dsco.course_id = dsp.course_id
AND dsp.`status` = '1' AND dsp.`status` = '1'
WHERE WHERE
main.deleted = 0 AND dsco.is_sign = 1 main.deleted = 0 AND dsco.is_sign = 1
<if test="entity.coachId != null and entity.coachId != ''"> <if test="entity.coachId != null and entity.coachId != ''">
AND dsp.coach_id = #{entity.coachId} AND dsp.coach_id = #{entity.coachId}
</if> </if>
<if test="entity.sourceCoachId != null and entity.sourceCoachId != ''"> <if test="entity.sourceCoachId != null and entity.sourceCoachId != ''">
AND main.source_user_id = #{entity.sourceCoachId} AND main.source_user_id = #{entity.sourceCoachId}
</if> </if>
<if test="entity.name!=null and entity.name!=''"> <if test="entity.name!=null and entity.name!=''">
AND main.name LIKE CONCAT('%',#{entity.name},'%') AND main.name LIKE CONCAT('%',#{entity.name},'%')
</if> </if>
<if test="entity.courseType != null and entity.courseType != ''"> <if test="entity.courseType != null and entity.courseType != ''">
AND dsco.course_type = #{entity.courseType} AND dsco.course_type = #{entity.courseType}
</if> </if>
<if test="entity.subject != null and entity.subject != ''"> <if test="entity.subject != null and entity.subject != ''">
AND dsp.subject = #{entity.subject} AND dsp.subject = #{entity.subject}
</if> </if>
<if test="entity.startTime!=null and entity.startTime!=''"> <if test="entity.startTime!=null and entity.startTime!=''">
AND dsco.create_time &gt;= #{entity.startTime} AND dsco.create_time &gt;= #{entity.startTime}
</if> </if>
<if test="entity.endTime!=null and entity.endTime!=''"> <if test="entity.endTime!=null and entity.endTime!=''">
AND dsco.create_time &lt;= #{entity.endTime} AND dsco.create_time &lt;= #{entity.endTime}
</if> </if>
<if test="entity.source!=null and entity.source!=''"> <if test="entity.source!=null and entity.source!=''">
AND main.source = #{entity.source} AND main.source = #{entity.source}
</if> </if>
<if test="entity.examStatus!=null and entity.examStatus!=''"> <if test="entity.examStatus!=null and entity.examStatus!=''">
AND dsp.exam_status = #{entity.examStatus} AND dsp.exam_status = #{entity.examStatus}
</if> </if>
GROUP BY <if test="entity.rangeTime!=null">
main.id AND dsco.create_time BETWEEN #{entity.rangeTime[0]} AND #{entity.rangeTime[1]}
<choose> </if>
<when test="entity.sort=='asc'"> <if test="entity.address!=null and entity.address!=''">
ORDER BY AND main.address LIKE CONCAT('%',#{entity.address},'%')
dsco.create_time ASC </if>
</when> <if test="entity.age!=null and entity.age!=''">
<otherwise> AND main.id_card IS NOT NULL
ORDER BY AND TIMESTAMPDIFF(YEAR, STR_TO_DATE(SUBSTRING(main.id_card, 7, 8), '%Y%m%d'), CURDATE()) BETWEEN #{entity.age[0]} AND #{entity.age[1]}
dsco.create_time DESC </if>
</otherwise> <if test="entity.passDays!=null and entity.passDays!=''">
</choose> AND dsco.pass_time IS NOT NULL
</select> AND TIMESTAMPDIFF(DAY, dsco.create_time, dsco.pass_time) = #{entity.passDays}
</if>
GROUP BY
main.id
<choose>
<when test="entity.sort=='asc'">
ORDER BY
dsco.create_time ASC
</when>
<otherwise>
ORDER BY
dsco.create_time DESC
</otherwise>
</choose>
</select>
<select id="selectByCoachId" resultType="cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO"> <select id="selectByCoachId" resultType="cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO">
SELECT SELECT
temp.* temp.*