BaseStudentGraduateMapper.xml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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.BaseStudentGraduateMapper">
  6. <select id="getPage" parameterType="com.xjrsoft.module.student.dto.BaseStudentGraduatePageDto" resultType="com.xjrsoft.module.student.vo.BaseStudentGraduatePageVo">
  7. SELECT t5.id,
  8. t1.user_id,
  9. t1.student_id,
  10. t2.name,
  11. t2.gender,
  12. t9.name as genderCn,
  13. t2.mobile as phone,
  14. t4.name AS major_name,
  15. t3.stduy_status,
  16. t6.name AS stduy_status_cn,
  17. t3.archives_status,
  18. t10.name AS archives_status_cn,
  19. t3.roll_modality,
  20. t12.name AS roll_modality_cn,
  21. IFNULL(t5.status, 0) AS status,
  22. t5.certificate_number,
  23. t5.certificate_date,
  24. t7.name AS class_name,
  25. t8.name AS grade_name,
  26. t5.appendix_id
  27. FROM base_student t1
  28. LEFT JOIN xjr_user t2 ON t1.user_id = t2.id
  29. LEFT JOIN base_student_school_roll t3 ON t1.user_id = t3.user_id
  30. LEFT JOIN base_major_set t4 ON t3.major_set_id = t4.id
  31. LEFT JOIN base_student_graduate t5 ON t1.user_id = t5.user_id
  32. LEFT JOIN xjr_dictionary_detail t6 ON t3.stduy_status = t6.code
  33. LEFT JOIN base_class t7 ON t7.id = t3.class_id
  34. LEFT JOIN base_grade t8 ON t8.id = t3.grade_id
  35. LEFT JOIN xjr_dictionary_detail t9 on t9.code = t2.gender
  36. LEFT JOIN xjr_dictionary_detail t10 on t10.code = t3.archives_status
  37. LEFT JOIN xjr_dictionary_detail t12 on t12.code = t3.roll_modality
  38. WHERE t1.delete_mark = 0
  39. AND t2.delete_mark = 0
  40. AND t3.delete_mark = 0
  41. <if test="dto.archivesStatus != null and dto.archivesStatus != ''">
  42. and t3.archives_status = #{dto.archivesStatus}
  43. </if>
  44. <if test="dto.stduyStatus != null and dto.stduyStatus != ''">
  45. and t3.stduy_status = #{dto.stduyStatus}
  46. </if>
  47. <if test="dto.rollModality != null and dto.rollModality != ''">
  48. and t3.learn_status = #{dto.rollModality}
  49. </if>
  50. <if test="dto.name != null and dto.name != ''">
  51. and t2.name like concat('%',#{dto.name}, '%')
  52. </if>
  53. <if test="dto.status != null">
  54. and t5.status = #{dto.status}
  55. </if>
  56. <if test="dto.classId != null and dto.classId > 0">
  57. and t3.class_id = #{dto.classId}
  58. </if>
  59. </select>
  60. <select id="getInfoById" resultType="com.xjrsoft.module.student.vo.BaseStudentGraduateVo">
  61. SELECT t5.id,t1.user_id,t1.student_id,t2.name,t4.name AS major_name,t6.name AS stduy_status_cn,
  62. IFNULL(t5.status,0) AS status,t5.certificate_number,t5.certificate_date,t7.name AS class_name,t8.name AS grade_name,t5.appendix_id FROM base_student t1
  63. LEFT JOIN xjr_user t2 ON t1.user_id = t2.id
  64. LEFT JOIN base_student_school_roll t3 ON t1.user_id = t3.user_id
  65. LEFT JOIN base_major_set t4 ON t3.major_set_id = t4.id
  66. LEFT JOIN base_student_graduate t5 ON t1.user_id = t5.user_id
  67. LEFT JOIN xjr_dictionary_detail t6 ON t3.stduy_status = t6.code AND t6.item_id = 2023000000000000030
  68. LEFT JOIN base_class t7 ON t7.id = t3.class_id
  69. LEFT JOIN base_grade t8 ON t8.id = t3.grade_id
  70. WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
  71. AND t3.delete_mark = 0
  72. AND t1.user_id = #{id}
  73. </select>
  74. </mapper>