TextbookIssueRecordMapper.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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.textbook.mapper.TextbookIssueRecordMapper">
  6. <select id="getPage" parameterType="com.xjrsoft.module.textbook.dto.TextbookIssueRecordPageDto" resultType="com.xjrsoft.module.textbook.vo.TextbookIssueRecordPageVo">
  7. SELECT t1.id,
  8. t1.sort_code,
  9. t3.issn,
  10. t3.book_name,
  11. t3.publishing_house,
  12. t3.editor_in_chief,
  13. t7.group_name,
  14. t5.name AS grade_name,
  15. ifnull(t6.name, t14.name) AS class_name,
  16. t8.name AS course_name,
  17. t10.name AS textbook_type_cn,
  18. t3.specifications_models,
  19. t11.name AS issue_mode_cn,
  20. t1.create_date,
  21. t9.name AS claim_user,
  22. t1.issue_number,
  23. t15.name as baseSemesterIdCn
  24. FROM textbook_issue_record t1
  25. LEFT JOIN wf_textbook_claim_item t2 ON t1.data_item_id = t2.id
  26. LEFT JOIN wf_textbook_claim t4 ON t1.data_id = t4.id
  27. LEFT JOIN wf_textbook_recede_item t12 ON t12.id = t1.data_item_id
  28. LEFT JOIN wf_textbook_recede t13 ON t13.id = t1.data_id
  29. LEFT JOIN textbook t3 ON t3.id = t1.textbook_id
  30. LEFT JOIN base_grade t5 ON t3.grade_id = t5.id
  31. LEFT JOIN base_class t6 ON t4.class_id = t6.id
  32. LEFT JOIN base_class t14 ON t13.class_id = t14.id
  33. LEFT JOIN subject_group t7 ON t3.subject_group_id = t7.id
  34. LEFT JOIN base_course_subject t8 ON t3.course_subject_id = t8.id
  35. LEFT JOIN xjr_user t9 ON t1.receive_user_id = t9.id
  36. LEFT JOIN xjr_dictionary_detail t10 ON t3.textbook_type = t10.code AND t10.item_id = 1739209191193636865
  37. LEFT JOIN xjr_dictionary_detail t11 ON t1.issue_mode = t11.code AND t11.item_id = 1739821685805215745
  38. LEFT JOIN base_semester t15 ON t15.id = t3.base_semester_id
  39. WHERE t1.delete_mark = 0
  40. <if test="dto.textbookType != null and dto.textbookType != ''">
  41. and t3.textbook_type = #{dto.textbookType}
  42. </if>
  43. <if test="dto.baseSemesterId != null">
  44. and t3.base_semester_id = #{dto.baseSemesterId}
  45. </if>
  46. <if test="dto.publishingHouse != null">
  47. and t3.publishing_house = like concat('%',#{dto.publishingHouse}, '%')
  48. </if>
  49. <if test="dto.subjectGroupId != null">
  50. and t3.subject_group_id = #{dto.subjectGroupId}
  51. </if>
  52. <if test="dto.courseSubjectId != null">
  53. and t3.course_subject_id = #{dto.courseSubjectId}
  54. </if>
  55. <if test="dto.classId != null">
  56. and (t4.class_id = #{dto.classId} or t13.class_id = #{dto.classId})
  57. </if>
  58. <if test="dto.bookName != null and dto.bookName != ''">
  59. and t3.book_name like concat('%',#{dto.bookName}, '%')
  60. </if>
  61. <if test="dto.issn != null and dto.issn != ''">
  62. and t3.issn = #{dto.issn}
  63. </if>
  64. <if test="dto.specificationsModels != null and dto.specificationsModels != ''">
  65. and t3.specifications_models like concat('%',#{dto.specificationsModels}, '%')
  66. </if>
  67. <if test="dto.isTextbookPlan != null and dto.isTextbookPlan != ''">
  68. and t3.is_textbook_plan = #{dto.isTextbookPlan}
  69. </if>
  70. order by t1.create_date desc
  71. </select>
  72. <select id="getList" parameterType="com.xjrsoft.module.textbook.dto.TextbookIssueRecordExportDto" resultType="com.xjrsoft.module.textbook.vo.TextbookIssueRecordPageVo">
  73. SELECT t1.id,
  74. t1.sort_code,
  75. t3.issn,
  76. t3.book_name,
  77. t3.publishing_house,
  78. t3.editor_in_chief,
  79. t7.group_name,
  80. t5.name AS grade_name,
  81. ifnull(t6.name, t14.name) AS class_name,
  82. t8.name AS course_name,
  83. t10.name AS textbook_type_cn,
  84. t3.specifications_models,
  85. t11.name AS issue_mode_cn,
  86. t1.create_date,
  87. t9.name AS claim_user,
  88. t1.issue_number,
  89. t15.name as baseSemesterIdCn
  90. FROM textbook_issue_record t1
  91. LEFT JOIN wf_textbook_claim_item t2 ON t1.data_item_id = t2.id
  92. LEFT JOIN wf_textbook_claim t4 ON t1.data_id = t4.id
  93. LEFT JOIN wf_textbook_recede_item t12 ON t12.id = t1.data_item_id
  94. LEFT JOIN wf_textbook_recede t13 ON t13.id = t1.data_id
  95. LEFT JOIN textbook t3 ON t3.id = t1.textbook_id
  96. LEFT JOIN base_grade t5 ON t3.grade_id = t5.id
  97. LEFT JOIN base_class t6 ON t4.class_id = t6.id
  98. LEFT JOIN base_class t14 ON t13.class_id = t14.id
  99. LEFT JOIN subject_group t7 ON t3.subject_group_id = t7.id
  100. LEFT JOIN base_course_subject t8 ON t3.course_subject_id = t8.id
  101. LEFT JOIN xjr_user t9 ON t1.receive_user_id = t9.id
  102. LEFT JOIN xjr_dictionary_detail t10 ON t3.textbook_type = t10.code AND t10.item_id = 1739209191193636865
  103. LEFT JOIN xjr_dictionary_detail t11 ON t1.issue_mode = t11.code AND t11.item_id = 1739821685805215745
  104. LEFT JOIN base_semester t15 ON t15.id = t3.base_semester_id
  105. WHERE t1.delete_mark = 0
  106. <if test="dto.ids != null and dto.ids.size() > 0">
  107. and t1.id in <foreach item="id" index="index" collection="dto.ids" open="(" close=")"
  108. separator=",">
  109. #{id}
  110. </foreach>
  111. </if>
  112. order by t1.create_date desc
  113. </select>
  114. </mapper>