| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 |
- <?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.student.mapper.BaseNewStudentMapper">
- <select id="getPage" parameterType="com.xjrsoft.module.student.dto.BaseNewStudentPageDto" 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,t1.source,t5.name as source_cn,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,ifnull(t11.name,t1.delete_reason) AS class_name,t12.name AS teacher_name,
- t1.paymnystate,t1.userdef6,t1.previous,t1.province,t1.city,t1.myarea,t1.remarks,t1.is_can_banding 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 xjr_dictionary_detail t5 ON t1.source = t5.code AND t5.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
- LEFT JOIN xjr_user t9 ON t1.credential_number = t9.credential_number AND t9.delete_mark = 0
- LEFT JOIN base_student_school_roll t10 ON t9.id = t10.user_id AND t10.delete_mark = 0
- LEFT JOIN base_class t11 ON t10.class_id = t11.id
- LEFT JOIN xjr_user t12 ON t11.teacher_id = t12.id
- WHERE t1.delete_mark = 0
- <if test="dto.name != null and dto.name != ''">
- and t1.name like concat('%', #{dto.name}, '%')
- </if>
- <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
- and t1.credential_number like concat('%', #{dto.credentialNumber}, '%')
- </if>
- <if test="dto.graduateSchool != null and dto.graduateSchool != ''">
- and t1.graduate_school like concat('%', #{dto.graduateSchool}, '%')
- </if>
- <if test="dto.isImportScore != null">
- <if test="dto.isImportScore == 1">
- and t1.score is not null
- </if>
- <if test="dto.isImportScore == 0">
- and t1.score is null
- </if>
- </if>
- <if test="dto.firstAmbition != null and dto.firstAmbition != ''">
- and t1.first_ambition = #{dto.firstAmbition}
- </if>
- <if test="dto.secondAmbition != null and dto.secondAmbition != ''">
- and t1.second_ambition = #{dto.secondAmbition}
- </if>
- <if test="dto.startDate != null and dto.endDate != null">
- AND t1.create_date between #{dto.startDate} and #{dto.endDate}
- </if>
- <if test="dto.gender != null and dto.gender != ''">
- AND t1.gender = #{dto.gender}
- </if>
- <if test="dto.status != null">
- AND t1.status = #{dto.status}
- </if>
- <if test="dto.isAdjust != null">
- AND t1.is_adjust = #{dto.isAdjust}
- </if>
- <if test="dto.enrollmentPlanId != null">
- AND t1.enrollment_plan_id = #{dto.enrollmentPlanId}
- </if>
- <if test="dto.treeId != null and dto.treeType != null">
- <if test="dto.treeType == 1">
- AND t4.grade_id = #{dto.treeId}
- </if>
- <if test="dto.treeType == 2">
- AND t4.enroll_type = #{dto.treeId}
- </if>
- </if>
- <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
- <if test="dto.order == 'descend'">
- order by t1.score desc
- </if>
- <if test="dto.order == 'ascend'">
- order by t1.score asc
- </if>
- </if>
- </select>
- <select id="getReportPage" parameterType="com.xjrsoft.module.student.dto.BaseNewStudentPageDto" 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.family_mobile,
- t1.score,t1.graduate_class,t1.source,t5.name as source_cn,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,ifnull(t11.name,t1.delete_reason) AS class_name,t12.name AS teacher_name ,t13.report_time,
- t9.id as user_id,(select count(*) from student_report_record where user_id = t9.id
- and base_semester_id = #{dto.baseSemesterId} and delete_mark = 0) as is_report 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 xjr_dictionary_detail t5 ON t1.source = t5.code AND t5.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
- LEFT JOIN xjr_user t9 ON t1.credential_number = t9.credential_number AND t9.delete_mark = 0
- LEFT JOIN base_student_school_roll t10 ON t9.id = t10.user_id AND t10.delete_mark = 0
- LEFT JOIN base_class t11 ON t10.class_id = t11.id
- LEFT JOIN xjr_user t12 ON t11.teacher_id = t12.id
- LEFT JOIN student_report_record t13 ON t9.id = t13.user_id
- and t13.base_semester_id = #{dto.baseSemesterId} and t13.delete_mark = 0
- WHERE t1.delete_mark = 0 and (t1.delete_reason is null or t1.delete_reason = '') AND t9.delete_mark = 0
- <if test="dto.name != null and dto.name != ''">
- and t1.name like concat('%', #{dto.name}, '%')
- </if>
- <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
- and t1.credential_number like concat('%', #{dto.credentialNumber}, '%')
- </if>
- <if test="dto.graduateSchool != null and dto.graduateSchool != ''">
- and t1.graduate_school like concat('%', #{dto.graduateSchool}, '%')
- </if>
- <if test="dto.isImportScore != null">
- <if test="dto.isImportScore == 1">
- and t1.score is not null
- </if>
- <if test="dto.isImportScore == 0">
- and t1.score is null
- </if>
- </if>
- <if test="dto.firstAmbition != null and dto.firstAmbition != ''">
- and t1.first_ambition = #{dto.firstAmbition}
- </if>
- <if test="dto.secondAmbition != null and dto.secondAmbition != ''">
- and t1.second_ambition = #{dto.secondAmbition}
- </if>
- <if test="dto.startDate != null and dto.endDate != null">
- AND t13.report_time between #{dto.startDate} and #{dto.endDate}
- </if>
- <if test="dto.gender != null and dto.gender != ''">
- AND t1.gender = #{dto.gender}
- </if>
- <if test="dto.status != null">
- AND t1.status = #{dto.status}
- </if>
- <if test="dto.isAdjust != null">
- AND t1.is_adjust = #{dto.isAdjust}
- </if>
- <if test="dto.teacherId != null">
- AND t11.teacher_id = #{dto.teacherId}
- </if>
- <if test="dto.classId != null">
- AND t11.id = #{dto.classId}
- </if>
- <if test="dto.isReport != null">
- AND (select count(*) from student_report_record where user_id = t9.id and base_semester_id = #{dto.baseSemesterId} and delete_mark = 0) = #{dto.isReport}
- </if>
- <if test="dto.stduyStatus != null and dto.stduyStatus != ''">
- AND t10.stduy_status = #{dto.stduyStatus}
- </if>
- <if test="dto.source != null and dto.source != ''">
- AND t1.source = #{dto.source}
- </if>
- <if test="dto.enrollmentPlanId != null">
- AND t1.enrollment_plan_id = #{dto.enrollmentPlanId}
- </if>
- <if test="dto.treeId != null and dto.treeType != null">
- <if test="dto.treeType == 1">
- AND t4.grade_id = #{dto.treeId}
- </if>
- <if test="dto.treeType == 2">
- AND t4.enroll_type = #{dto.treeId}
- </if>
- </if>
- <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
- <if test="dto.order == 'descend'">
- order by t1.score desc
- </if>
- <if test="dto.order == 'ascend'">
- order by t1.score asc
- </if>
- </if>
- </select>
- <select id="getReportList" parameterType="com.xjrsoft.module.student.dto.BaseNewStudentPageDto" 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.family_mobile,
- t1.score,t1.graduate_class,t1.source,t5.name as source_cn,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,ifnull(t11.name,t1.delete_reason) AS class_name,t12.name AS teacher_name ,t13.report_time,
- t9.id as user_id,(select count(*) from student_report_record where user_id = t9.id and base_semester_id = #{dto.baseSemesterId} and delete_mark = 0) as is_report 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 xjr_dictionary_detail t5 ON t1.source = t5.code AND t5.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
- LEFT JOIN xjr_user t9 ON t1.credential_number = t9.credential_number AND t9.delete_mark = 0
- LEFT JOIN base_student_school_roll t10 ON t9.id = t10.user_id AND t10.delete_mark = 0
- LEFT JOIN base_class t11 ON t10.class_id = t11.id
- LEFT JOIN xjr_user t12 ON t11.teacher_id = t12.id
- LEFT JOIN student_report_record t13 ON t9.id = t13.user_id and t13.base_semester_id = #{dto.baseSemesterId} and t13.delete_mark = 0
- WHERE t1.delete_mark = 0 AND t9.delete_mark = 0 and (t1.delete_reason is null or t1.delete_reason = '')
- <if test="dto.name != null and dto.name != ''">
- and t1.name like concat('%', #{dto.name}, '%')
- </if>
- <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
- and t1.credential_number like concat('%', #{dto.credentialNumber}, '%')
- </if>
- <if test="dto.graduateSchool != null and dto.graduateSchool != ''">
- and t1.graduate_school like concat('%', #{dto.graduateSchool}, '%')
- </if>
- <if test="dto.isImportScore != null">
- <if test="dto.isImportScore == 1">
- and t1.score is not null
- </if>
- <if test="dto.isImportScore == 0">
- and t1.score is null
- </if>
- </if>
- <if test="dto.firstAmbition != null and dto.firstAmbition != ''">
- and t1.first_ambition = #{dto.firstAmbition}
- </if>
- <if test="dto.secondAmbition != null and dto.secondAmbition != ''">
- and t1.second_ambition = #{dto.secondAmbition}
- </if>
- <if test="dto.classId != null">
- AND t11.id = #{dto.classId}
- </if>
- <if test="dto.startDate != null and dto.endDate != null">
- AND t13.report_time between #{dto.startDate} and #{dto.endDate}
- </if>
- <if test="dto.gender != null and dto.gender != ''">
- AND t1.gender = #{dto.gender}
- </if>
- <if test="dto.status != null">
- AND t1.status = #{dto.status}
- </if>
- <if test="dto.isAdjust != null">
- AND t1.is_adjust = #{dto.isAdjust}
- </if>
- <if test="dto.teacherId != null">
- AND t11.teacher_id = #{dto.teacherId}
- </if>
- <if test="dto.classId != null">
- AND t11.id = #{dto.classId}
- </if>
- <if test="dto.isReport != null">
- AND (select count(*) from student_report_record where user_id = t9.id and base_semester_id = #{dto.baseSemesterId} and delete_mark = 0) = #{dto.isReport}
- </if>
- <if test="dto.stduyStatus != null and dto.stduyStatus != ''">
- AND t10.stduy_status = #{dto.stduyStatus}
- </if>
- <if test="dto.source != null and dto.source != ''">
- AND t1.source = #{dto.source}
- </if>
- <if test="dto.enrollmentPlanId != null">
- AND t1.enrollment_plan_id = #{dto.enrollmentPlanId}
- </if>
- <if test="dto.treeId != null and dto.treeType != null">
- <if test="dto.treeType == 1">
- AND t4.grade_id = #{dto.treeId}
- </if>
- <if test="dto.treeType == 2">
- AND t4.enroll_type = #{dto.treeId}
- </if>
- </if>
- <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
- <if test="dto.order == 'descend'">
- order by t1.score desc
- </if>
- <if test="dto.order == 'ascend'">
- order by t1.score asc
- </if>
- </if>
- </select>
- <select id="getEnrollmentPlanList" resultType="com.xjrsoft.module.student.vo.EnrollmentPlanTreeVo">
- SELECT t1.enroll_type, t2.name AS enroll_type_cn,t3.name AS grade_name, t3.id as grade_id,t1.id FROM enrollment_plan t1
- LEFT JOIN xjr_dictionary_detail t2 ON t1.enroll_type = t2.code AND t2.item_id = 2023000000000000027
- LEFT JOIN base_grade t3 ON t1.grade_id = t3.id
- WHERE t1.delete_mark = 0
- </select>
- <select id="getGradeList" resultType="com.xjrsoft.module.student.vo.EnrollmentPlanGradeVo">
- SELECT DISTINCT t3.id, t3.name FROM enrollment_plan t1
- LEFT JOIN xjr_dictionary_detail t2 ON t1.enroll_type = t2.code AND t2.item_id = 2023000000000000027
- LEFT JOIN base_grade t3 ON t1.grade_id = t3.id
- WHERE t1.delete_mark = 0
- </select>
- <select id="getFirstAmbitionStudentCount" resultType="com.xjrsoft.module.outint.vo.IdCountVo">
- SELECT t1.first_ambition_id,COUNT(t1.id) FROM base_new_student t1
- INNER JOIN enrollment_plan t2 ON t1.enrollment_plan_id = t2.id
- WHERE t1.delete_mark = 0 AND t2.grade_id = #{gradeId} AND t2.enroll_type = #{enrollType} and t1.is_can_banding = 1
- GROUP BY t1.first_ambition_id
- </select>
- <select id="getSecondAmbitionStudentCount" resultType="com.xjrsoft.module.outint.vo.IdCountVo">
- SELECT t1.second_ambition_id,COUNT(t1.id) FROM base_new_student t1
- INNER JOIN enrollment_plan t2 ON t1.enrollment_plan_id = t2.id
- WHERE t1.delete_mark = 0 AND t2.grade_id = #{gradeId} AND t2.enroll_type = #{enrollType} and t1.is_can_banding = 1
- GROUP BY t1.second_ambition_id
- </select>
- <select id="getMajorStudentCount" resultType="com.xjrsoft.module.banding.vo.IdManyCountVo">
- SELECT t1.id,(
- SELECT COUNT(id) FROM base_new_student WHERE delete_mark = 0
- AND (first_ambition_id = t1.id OR second_ambition_id = t1.id)
- AND score >= IFNULL(t2.score,0) AND height >= IFNULL(t2.height,0)
- and is_can_banding = 1
- ) AS count,(
- SELECT COUNT(id) FROM base_new_student WHERE delete_mark = 0
- AND (first_ambition_id = t1.id OR second_ambition_id = t1.id)
- AND score >= IFNULL(t2.score,0) AND height >= IFNULL(t2.height,0)
- AND gender = 'SB10001' and is_can_banding = 1
- ) AS male_count,(
- SELECT COUNT(id) FROM base_new_student WHERE delete_mark = 0
- AND (first_ambition_id = t1.id OR second_ambition_id = t1.id)
- AND score >= IFNULL(t2.score,0) AND height >= IFNULL(t2.height,0)
- AND gender = 'SB10002' and is_can_banding = 1
- ) AS female_count FROM base_major_set t1
- LEFT JOIN banding_task_major_condition t2 ON t1.id = t2.major_set_id AND t2.banding_task_id = #{id}
- AND t2.delete_mark = 0
- WHERE t1.delete_mark = 0 and t1.enabled_mark = 1
- </select>
- </mapper>
|