EnrollmentPlanMajorSetMapper.xml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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.EnrollmentPlanMajorSetMapper">
  6. <select id="baseMajorSetOfEnrollmentPlan" parameterType="com.xjrsoft.module.student.dto.BaseMajorSetOfEnrollmentPlanPageDto"
  7. resultType="com.xjrsoft.module.student.vo.BaseMajorSetOfEnrollmentPlanPageVo">
  8. select
  9. t.id,
  10. t.name as baseMajorSetCn,
  11. t.department_id as departmentId,
  12. t3.name as majorGradationIdCn,
  13. t4.name as departmentIdCn,
  14. (SELECT
  15. COUNT(*)
  16. FROM enrollment_plan_major_set a
  17. WHERE a.base_major_set_id = t.id
  18. and a.delete_mark = 0
  19. <if test="dto.enrollmentPlanId != null">
  20. and a.enrollment_plan_id = #{dto.enrollmentPlanId}
  21. </if>
  22. ) as isSelect
  23. from base_major_set t
  24. left join base_major_gradation t3 on t3.id = t.major_gradation_id
  25. left join xjr_department t4 on t4.id = t.department_id
  26. where t.delete_mark = 0 and t.enabled_mark = 1
  27. <if test="dto.name != null and dto.name != ''">
  28. and t.name like concat('%', #{dto.name}, '%')
  29. </if>
  30. <if test="dto.departmentId != null and dto.departmentId > 0">
  31. and t.department_id = #{dto.departmentId}
  32. </if>
  33. <if test="dto.majorCategorId != null and dto.majorCategorId > 0">
  34. and t.major_categor_id = #{dto.majorCategorId}
  35. </if>
  36. </select>
  37. <select id="baseGraduateSchoolOfEnrollmentPlan" parameterType="com.xjrsoft.module.student.dto.BaseGraduateSchoolOfEnrollmentPlanListDto"
  38. resultType="com.xjrsoft.module.student.vo.BaseGraduateSchoolOfEnrollmentPlanListVo">
  39. select
  40. t.id,
  41. t.name,
  42. (SELECT
  43. COUNT(*)
  44. FROM enrollment_plan_graduate_school a
  45. left join enrollment_plan_major_set b on b.id = a.enrollment_plan_major_set_id
  46. WHERE a.base_graduate_school_id = t.id
  47. and a.delete_mark = 0
  48. <if test="dto.enrollmentPlanId != null">
  49. and b.enrollment_plan_id = #{dto.enrollmentPlanId}
  50. </if>
  51. <if test="dto.baseMajorSetId != null">
  52. and b.base_major_set_id = #{dto.baseMajorSetId}
  53. </if>
  54. ) as isSelect
  55. from base_graduate_school t
  56. where t.delete_mark = 0
  57. </select>
  58. </mapper>