| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.xjrsoft.module.banding.mapper.BandingTaskClassStudentMapper">
- <select id="satisfyStudent" parameterType="com.xjrsoft.module.banding.dto.StudentDto" resultType="com.xjrsoft.module.student.vo.BaseNewStudentPageVo">
- SELECT t1.id,t1.graduate_school,t1.name,t1.gender,t2.name AS gender_cn,t1.credential_number,t1.height,t1.weight,
- t1.score,t1.graduate_class,t6.name as source,t1.stduy_status,t3.name AS stduy_status_cn,t1.mobile,t7.name as first_ambition,
- t8.name as second_ambition,t1.is_adjust,t1.status,t1.remarks FROM base_new_student t1
- INNER JOIN banding_task_class_student t5 ON t1.id = t5.new_student_id
- LEFT JOIN xjr_dictionary_detail t2 ON t1.gender = t2.code AND t2.item_id = 2023000000000000004
- LEFT JOIN xjr_dictionary_detail t3 ON t1.stduy_status = t3.code AND t3.item_id = 2023000000000000030
- LEFT JOIN xjr_dictionary_detail t6 ON t1.source = t6.code AND t6.item_id = 2023000000000000028
- LEFT JOIN enrollment_plan t4 ON t1.enrollment_plan_id = t4.id
- LEFT JOIN base_major_set t7 ON t1.first_ambition = t7.id
- LEFT JOIN base_major_set t8 ON t1.second_ambition = t8.id
- WHERE t1.delete_mark = 0 AND t5.delete_mark = 0 and t1.is_can_banding = 1
- AND t5.banding_task_class_id = #{dto.bandingTaskClassId}
- <if test="dto.name != null and dto.name != ''">
- and t1.name like concat('%', #{dto.name},'%')
- </if>
- <if test="dto.gender != null and dto.gender != ''">
- and t1.gender = #{dto.gender}
- </if>
- <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
- and t1.credential_number like concat('%', #{dto.credentialNumber},'%')
- </if>
- <if test="dto.order != null">
- <if test="dto.order == 'ascend'">
- <if test="dto.field != null and dto.field == 'height'">
- order by t1.height asc
- </if>
- <if test="dto.field != null and dto.field == 'weight'">
- order by t1.weight asc
- </if>
- <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
- order by t1.score asc
- </if>
- </if>
- <if test="dto.order == 'descend'">
- <if test="dto.field != null and dto.field == 'height'">
- order by t1.height desc
- </if>
- <if test="dto.field != null and dto.field == 'weight'">
- order by t1.weight desc
- </if>
- <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
- order by t1.score desc
- </if>
- </if>
- </if>
- </select>
- <select id="satisfyStudentSure" parameterType="com.xjrsoft.module.banding.dto.StudentDto" resultType="com.xjrsoft.module.student.vo.BaseNewStudentPageVo">
- SELECT t1.id,t1.graduate_school,t1.name,t1.gender,t2.name AS gender_cn,t1.credential_number,t1.height,t1.weight,
- t1.score,t1.graduate_class,t6.name as source,t1.stduy_status,t3.name AS stduy_status_cn,t1.mobile,t7.name as first_ambition,
- t8.name as second_ambition,t1.is_adjust,t1.status,t1.remarks FROM base_new_student t1
- INNER JOIN banding_task_class_student_sure t5 ON t1.id = t5.new_student_id
- LEFT JOIN xjr_dictionary_detail t2 ON t1.gender = t2.code AND t2.item_id = 2023000000000000004
- LEFT JOIN xjr_dictionary_detail t3 ON t1.stduy_status = t3.code AND t3.item_id = 2023000000000000030
- LEFT JOIN xjr_dictionary_detail t6 ON t1.source = t6.code AND t6.item_id = 2023000000000000028
- LEFT JOIN enrollment_plan t4 ON t1.enrollment_plan_id = t4.id
- LEFT JOIN base_major_set t7 ON t1.first_ambition = t7.id
- LEFT JOIN base_major_set t8 ON t1.second_ambition = t8.id
- WHERE t1.delete_mark = 0 AND t5.delete_mark = 0 and t1.is_can_banding = 1
- AND t5.banding_task_class_id = #{dto.bandingTaskClassId}
- <if test="dto.name != null and dto.name != ''">
- and t1.name like concat('%', #{dto.name},'%')
- </if>
- <if test="dto.gender != null and dto.gender != ''">
- and t1.gender = #{dto.gender}
- </if>
- <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
- and t1.credential_number like concat('%', #{dto.credentialNumber},'%')
- </if>
- <if test="dto.order != null">
- <if test="dto.order == 'ascend'">
- <if test="dto.field != null and dto.field == 'height'">
- order by t1.height asc
- </if>
- <if test="dto.field != null and dto.field == 'weight'">
- order by t1.weight asc
- </if>
- <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
- order by t1.score asc
- </if>
- </if>
- <if test="dto.order == 'descend'">
- <if test="dto.field != null and dto.field == 'height'">
- order by t1.height desc
- </if>
- <if test="dto.field != null and dto.field == 'weight'">
- order by t1.weight desc
- </if>
- <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
- order by t1.score desc
- </if>
- </if>
- </if>
- </select>
- <select id="surplusStudent" parameterType="com.xjrsoft.module.banding.dto.StudentDto" resultType="com.xjrsoft.module.student.vo.BaseNewStudentPageVo">
- SELECT t1.id,t1.graduate_school,t1.name,t1.gender,t2.name AS gender_cn,t1.credential_number,t1.height,t1.weight,
- t1.score,t1.graduate_class,t6.name as source,t1.stduy_status,t3.name AS stduy_status_cn,t1.mobile,t7.name as first_ambition,
- t8.name as second_ambition,t1.is_adjust,t1.status,t1.remarks FROM base_new_student t1
- LEFT JOIN xjr_dictionary_detail t2 ON t1.gender = t2.code AND t2.item_id = 2023000000000000004
- LEFT JOIN xjr_dictionary_detail t3 ON t1.stduy_status = t3.code AND t3.item_id = 2023000000000000030
- LEFT JOIN enrollment_plan t4 ON t1.enrollment_plan_id = t4.id
- LEFT JOIN banding_task t5 ON t4.grade_id = t5.grade_id AND t4.enroll_type = t5.enroll_type
- LEFT JOIN xjr_dictionary_detail t6 ON t1.source = t6.code AND t6.item_id = 2023000000000000028
- LEFT JOIN base_major_set t7 ON t1.first_ambition = t7.id
- LEFT JOIN base_major_set t8 ON t1.second_ambition = t8.id
- WHERE t1.delete_mark = 0 AND t5.id = #{dto.bandingTaskId}
- and t1.is_can_banding = 1
- AND (t1.first_ambition_id = #{dto.majorSetId} or t1.second_ambition_id = #{dto.majorSetId})
- and t1.id not in (SELECT new_student_id FROM banding_task_class_student c1
- INNER JOIN banding_task_class c2 ON c1.banding_task_class_id = c2.id
- WHERE c1.delete_mark = 0 AND c2.delete_mark = 0 AND c2.banding_task_id = #{dto.bandingTaskId}
- )
- <if test="dto.name != null and dto.name != ''">
- and t1.name like concat('%', #{dto.name},'%')
- </if>
- <if test="dto.gender != null and dto.gender != ''">
- and t1.gender = #{dto.gender}
- </if>
- <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
- and t1.credential_number like concat('%', #{dto.credentialNumber},'%')
- </if>
- <if test="dto.order != null">
- <if test="dto.order == 'ascend'">
- <if test="dto.field != null and dto.field == 'height'">
- order by t1.height asc
- </if>
- <if test="dto.field != null and dto.field == 'weight'">
- order by t1.weight asc
- </if>
- <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
- order by t1.score asc
- </if>
- </if>
- <if test="dto.order == 'descend'">
- <if test="dto.field != null and dto.field == 'height'">
- order by t1.height desc
- </if>
- <if test="dto.field != null and dto.field == 'weight'">
- order by t1.weight desc
- </if>
- <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
- order by t1.score desc
- </if>
- </if>
- </if>
- </select>
- <select id="surplusStudentSure" parameterType="com.xjrsoft.module.banding.dto.StudentDto" resultType="com.xjrsoft.module.student.vo.BaseNewStudentPageVo">
- SELECT t1.id,t1.graduate_school,t1.name,t1.gender,t2.name AS gender_cn,t1.credential_number,t1.height,t1.weight,
- t1.score,t1.graduate_class,t6.name as source,t1.stduy_status,t3.name AS stduy_status_cn,t1.mobile,t7.name as first_ambition,
- t8.name as second_ambition,t1.is_adjust,t1.status,t1.remarks FROM base_new_student t1
- LEFT JOIN xjr_dictionary_detail t2 ON t1.gender = t2.code AND t2.item_id = 2023000000000000004
- LEFT JOIN xjr_dictionary_detail t3 ON t1.stduy_status = t3.code AND t3.item_id = 2023000000000000030
- LEFT JOIN enrollment_plan t4 ON t1.enrollment_plan_id = t4.id
- LEFT JOIN banding_task t5 ON t4.grade_id = t5.grade_id AND t4.enroll_type = t5.enroll_type
- LEFT JOIN xjr_dictionary_detail t6 ON t1.source = t6.code AND t6.item_id = 2023000000000000028
- LEFT JOIN base_major_set t7 ON t1.first_ambition = t7.id
- LEFT JOIN base_major_set t8 ON t1.second_ambition = t8.id
- WHERE t1.delete_mark = 0 AND t5.id = #{dto.bandingTaskId}
- and t1.is_can_banding = 1
- AND (t1.first_ambition_id = #{dto.majorSetId} or t1.second_ambition_id = #{dto.majorSetId})
- and t1.id not in (SELECT new_student_id FROM banding_task_class_student_sure c1
- INNER JOIN banding_task_class c2 ON c1.banding_task_class_id = c2.id
- WHERE c1.delete_mark = 0 AND c2.delete_mark = 0 AND c2.banding_task_id = #{dto.bandingTaskId}
- )
- <if test="dto.name != null and dto.name != ''">
- and t1.name like concat('%', #{dto.name},'%')
- </if>
- <if test="dto.gender != null and dto.gender != ''">
- and t1.gender = #{dto.gender}
- </if>
- <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
- and t1.credential_number like concat('%', #{dto.credentialNumber},'%')
- </if>
- <if test="dto.order != null">
- <if test="dto.order == 'ascend'">
- <if test="dto.field != null and dto.field == 'height'">
- order by t1.height asc
- </if>
- <if test="dto.field != null and dto.field == 'weight'">
- order by t1.weight asc
- </if>
- <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
- order by t1.score asc
- </if>
- </if>
- <if test="dto.order == 'descend'">
- <if test="dto.field != null and dto.field == 'height'">
- order by t1.height desc
- </if>
- <if test="dto.field != null and dto.field == 'weight'">
- order by t1.weight desc
- </if>
- <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
- order by t1.score desc
- </if>
- </if>
- </if>
- </select>
- <select id="getSyncStudentDataList" resultType="com.xjrsoft.module.banding.vo.SyncStudentDataListVo">
- SELECT t2.id AS new_student_id,t4.class_id,t6.banding_task_class_id,t4.stduy_status FROM student_report_record t1
- INNER JOIN base_new_student t2 ON t1.user_id = t2.id
- INNER JOIN xjr_user t3 ON t2.credential_number = t3.credential_number AND t3.delete_mark = 0
- INNER JOIN base_student_school_roll t4 ON t3.id = t4.user_id AND t4.delete_mark = 0
- LEFT JOIN banding_task_class t5 ON t4.class_id = t5.base_class_id
- LEFT JOIN banding_task_class_student t6 ON t2.id = t6.new_student_id AND t6.delete_mark = 0
- WHERE t1.delete_mark = 0 AND t1.student_report_plan_id = #{studentReportPlanId}
- </select>
- </mapper>
|