InternshipPlanManageMapper.xml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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.internship.mapper.InternshipPlanManageMapper">
  6. <select id="getPage" parameterType="com.xjrsoft.module.internship.dto.InternshipPlanManagePageDto" resultType="com.xjrsoft.module.internship.vo.InternshipPlanManagePageVo">
  7. SELECT t1.id,t1.base_semester,t1.internship_plan_name,t1.status,t1.start_time,t1.end_time,t2.name AS insurance_purchaser_cn,
  8. t3.name AS internship_plan_type_cn,t4.name AS internship_whereabouts_cn,t5.name AS insurance_type_cn,t1.internship_unit_name,
  9. t6.name AS enterprise_industry_cn,t7.name AS lodging_plan_cn,t8.name AS internship_site_type_cn,t9.name AS internship_unit_source_cn,
  10. t10.name AS professional_relevance_enterprise_cn,IFNULL(t11.training_name,t12.training_name) AS training_base_name,t1.internship_job_name FROM internship_plan_manage t1
  11. LEFT JOIN xjr_dictionary_detail t2 ON t1.insurance_purchaser = t2.code AND t2.item_id = 1826514469123567618
  12. LEFT JOIN xjr_dictionary_detail t3 ON t1.internship_plan_type = t3.code AND t3.item_id = 1826151188882042882
  13. LEFT JOIN xjr_dictionary_detail t4 ON t1.internship_whereabouts = t4.code AND t4.item_id = 1826520014937174017
  14. LEFT JOIN xjr_dictionary_detail t5 ON t1.insurance_type = t5.code AND t5.item_id = 1826517478180171778
  15. LEFT JOIN xjr_dictionary_detail t6 ON t1.enterprise_industry = t6.code AND t6.item_id = 1826458251034144769
  16. LEFT JOIN xjr_dictionary_detail t7 ON t1.lodging_plan = t7.code AND t7.item_id = 1826523742578716673
  17. LEFT JOIN xjr_dictionary_detail t8 ON t1.internship_site_type = t8.code AND t8.item_id = 1826522165537189889
  18. LEFT JOIN xjr_dictionary_detail t9 ON t1.internship_unit_source = t9.code AND t9.item_id = 1826522877876809730
  19. LEFT JOIN xjr_dictionary_detail t10 ON t1.insurance_type = t10.code AND t10.item_id = 1826513919233536002
  20. LEFT JOIN training_school t11 ON t1.training_base_id = t11.id
  21. LEFT JOIN training_outside t12 ON t1.training_base_id = t12.id
  22. WHERE t1.delete_mark = 0
  23. <if test="dto.internshipPlanName != null and dto.internshipPlanName != ''">
  24. and t1.internship_plan_name like concat('%', #{dto.internshipPlanName}, '%')
  25. </if>
  26. <if test="dto.internshipPlanType != null and dto.internshipPlanType != ''">
  27. and t1.internship_plan_type = #{dto.internshipPlanType}
  28. </if>
  29. <if test="dto.internshipUnitSource != null and dto.internshipUnitSource != ''">
  30. and t1.internship_unit_source = #{dto.internshipUnitSource}
  31. </if>
  32. <if test="dto.internshipSiteType != null and dto.internshipSiteType != ''">
  33. and t1.internship_site_type = #{dto.internshipSiteType}
  34. </if>
  35. <if test="dto.internshipUnitName != null and dto.internshipUnitName != ''">
  36. and t1.internship_unit_name like concat('%', #{dto.internshipUnitName}, '%')
  37. </if>
  38. <if test="dto.startTimeStart != null and dto.startTimeEnd != null">
  39. and t1.start_time between #{dto.startTimeStart} and #{dto.startTimeEnd}
  40. </if>
  41. <if test="dto.endTimeStart != null and dto.endTimeEnd != null">
  42. and t1.start_time between #{dto.endTimeStart} and #{dto.endTimeEnd}
  43. </if>
  44. <if test="dto.internshipWhereabouts != null and dto.internshipWhereabouts != ''">
  45. and t1.internship_whereabouts like concat('%', #{dto.internshipWhereabouts}, '%')
  46. </if>
  47. <if test="dto.baseSemesterId != null">
  48. and t1.base_semester_id = #{dto.baseSemesterId}
  49. </if>
  50. <if test="dto.teacherId != null">
  51. and (t1.id in (
  52. SELECT DISTINCT c1.internship_plan_manage_id FROM internship_plan_class c1
  53. INNER JOIN base_class c2 ON c1.class_id = c2.id
  54. WHERE c1.delete_mark = 0 AND c2.delete_mark = 0
  55. AND c2.teacher_id = #{dto.teacherId}
  56. ) or t1.id in (
  57. SELECT DISTINCT internship_plan_manage_id FROM internship_plan_teacher
  58. WHERE delete_mark = 0 AND user_id = #{dto.teacherId}
  59. ))
  60. </if>
  61. <if test="dto.studentUserId != null">
  62. and t1.id in (
  63. SELECT DISTINCT internship_plan_manage_id FROM internship_plan_manage_participant
  64. WHERE delete_mark = 0 AND participant_user_id = #{dto.studentUserId}
  65. )
  66. </if>
  67. order by t1.create_date desc
  68. </select>
  69. </mapper>