SchoolRollStudentMapper.xml 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.xjrsoft.module.student.mapper.SchoolRollStudentMapper">
  6. <select id="getPage" parameterType="com.xjrsoft.module.student.dto.SchoolRollStudentPageDto" resultType="com.xjrsoft.module.student.vo.SchoolRollStudentPageVo">
  7. SELECT t.id,t.sort_code,t1.name,t1.credential_number,t3.name AS scholarship_source_cn,
  8. t4.name AS before_class_name,t5.name AS back_class_name,t1.remark,t.in_class_date,t.out_class_date
  9. ,t.scholarship_source,t2.student_id,t8.name AS applicant_user_name FROM school_roll_student t
  10. LEFT JOIN xjr_user t1 ON t1.id = t.student_id
  11. LEFT JOIN base_student t2 ON t.student_id = t2.user_id
  12. LEFT JOIN xjr_dictionary_detail t3 ON t.scholarship_source = t3.code AND t3.item_id = 1729751199857102849
  13. LEFT JOIN base_class t4 ON t.before_class_id = t4.id
  14. LEFT JOIN base_class t5 ON t.back_class_id = t5.id
  15. LEFT JOIN school_roll_category t6 ON t.school_roll_category_id = t6.id
  16. LEFT JOIN school_roll_reason t7 ON t.school_roll_reason_id = t7.id
  17. LEFT JOIN xjr_user t8 ON t8.id = t.applicant_user_id
  18. WHERE t.delete_mark = 0 AND t.status = 1
  19. <if test="dto.name != null and dto.name != ''">
  20. and t1.name like concat('%', #{dto.name}, '%')
  21. </if>
  22. <if test="dto.scholarshipSource != null and dto.scholarshipSource != ''">
  23. and t.scholarship_source = #{dto.scholarshipSource}
  24. </if>
  25. <if test="dto.schoolRollReasonId != null">
  26. and t7.id = #{dto.schoolRollReasonId}
  27. </if>
  28. </select>
  29. <select id="getInfo" resultType="com.xjrsoft.module.student.vo.SchoolRollStudentVo">
  30. select t.id,t1.name,t2.student_id,t1.gender,t1.credential_number,t3.name as scholarship_source_cn
  31. ,t.scholarship_source,t.is_retain,t8.name as applicant_user_name,t.create_date,t.is_record
  32. ,t.leave_year,t.is_under_graduate,t.status
  33. ,t4.name AS before_class_name,t9.name as before_grade_name,t10.name as before_major_set_name,
  34. t11.name as before_department_name,
  35. t5.name AS back_class_name,t12.name as back_grade_name,t13.name as back_major_set_name,
  36. t14.name as back_department_name,t.reason,
  37. t1.remark,t.in_class_date,t.out_class_date,t.status,t.leave_start_year,t.leave_end_year,t.is_maintained
  38. from school_roll_student t
  39. left join xjr_user t1 on t1.id = t.student_id
  40. left join base_student t2 on t.student_id = t2.user_id
  41. left join xjr_dictionary_detail t3 on t.scholarship_source = t3.code and t3.item_id = 1729751199857102849
  42. left join base_class t4 on t.before_class_id = t4.id
  43. LEFT JOIN base_class t5 ON t.back_class_id = t5.id
  44. left join school_roll_category t6 on t.school_roll_category_id = t6.id
  45. left join school_roll_reason t7 on t.school_roll_reason_id = t7.id
  46. LEFT JOIN xjr_user t8 ON t8.id = t.applicant_user_id
  47. left join base_grade t9 on t9.id = t.before_grade_id
  48. left join base_major_set t10 on t10.id = t.before_major_set_id
  49. left join xjr_department t11 on t11.id = t.before_department_id
  50. LEFT JOIN base_grade t12 ON t12.id = t.back_grade_id
  51. LEFT JOIN base_major_set t13 ON t13.id = t.back_major_set_id
  52. LEFT JOIN xjr_department t14 ON t14.id = t.back_department_id
  53. where t.delete_mark = 0 and t.status = 1
  54. and t.id = #{id}
  55. </select>
  56. </mapper>