KmtQualityQuestionsMapper.xml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.ssj.service.mapper.KmtQualityQuestionsMapper">
  4. <!--查询搜索的题目-->
  5. <select id="findKmtQuestionsById" resultType="com.ssj.service.kmt.dto.ExerciseQuetionDto">
  6. select eq.id question_id, eq.course_name, eq.handle_user_id, eq.auditing_user_id, eq.analysis_user_id, eq.analysis_auditer_id, eq.book_course_id course_id,
  7. eq.big_question_index, eq.num small_question_index, eq.question,eq.question_text, eq.option_answer answer,
  8. eq.answer_json, eq.deal_status question_status, eq.create_time, eq.remark reason, eq.from_user_id, eq.to_user_id, eq.analysis question_analysis,
  9. eq.analysis_json, eq.question_type question_types, eq.difficulty_level difficulty_levels, eq.real_exam_type real_exam_types,
  10. eq.training_skill training_skills, parent_id, image question_image, eq.update_type, qqc.begin_year, qqc.end_year
  11. from kmt_quality_questions eq
  12. left join kmt_quality_question_comment qqc on eq.id=qqc.question_id
  13. where (eq.id=#{questionId} or eq.parent_id=#{questionId}) and eq.question_class_type in (0, 2) and eq.book_id is null
  14. <choose>
  15. <when test="dealType == 1">
  16. and eq.handle_user_id = #{userId} and eq.deal_status &lt; 2
  17. </when>
  18. <when test="dealType == 2">
  19. and eq.auditing_user_id = #{userId} and eq.deal_status in (3, 7)
  20. </when>
  21. <otherwise>
  22. and eq.deal_status != 6
  23. </otherwise>
  24. </choose>
  25. order by eq.num
  26. </select>
  27. <!--查询大题-->
  28. <select id="findBigQuestionById" resultType="com.ssj.service.kmt.dto.ExerciseQuetionDto">
  29. select eq.id question_id, eq.course_name, eq.handle_user_id, eq.auditing_user_id, eq.analysis_user_id, eq.analysis_auditer_id, eq.book_course_id course_id,
  30. eq.big_question_index, eq.small_question_name small_question_index, eq.question,eq.question_text, eq.option_answer answer,
  31. eq.answer_json, eq.deal_status question_status, eq.create_time, eq.remark reason, eq.analysis question_analysis,
  32. eq.analysis_json, eq.question_type question_types, eq.difficulty_level difficulty_levels, eq.real_exam_type real_exam_types,
  33. eq.training_skill training_skills, eq.parent_id, image question_image,eq.update_type, qqc.begin_year, qqc.end_year
  34. from kmt_quality_questions eq
  35. left join kmt_quality_question_comment qqc on eq.id=qqc.question_id
  36. where eq.id = #{id}
  37. </select>
  38. <select id="findData2EsByQuestionList" resultType="java.util.Map">
  39. select k.id,
  40. k.question_id,
  41. k.how_details_id,
  42. k.how_details_kd_id,
  43. k.how_detail_sort_id,
  44. k.how_detail_kd_sort_id,
  45. k.version,
  46. date_format(k.create_time, '%Y-%m-%dT%H:%i:%s.000Z') create_time,
  47. book_id,
  48. unit_id,
  49. book_course_id,
  50. question,
  51. question_type,
  52. option_answer,
  53. source,
  54. big_question_index,
  55. date_format(analysis_submit_time, '%Y-%m-%dT%H:%i:%s.000Z') analysis_submit_time,
  56. page_index,
  57. image,
  58. precision_percent,
  59. auditing_user_id,
  60. handle_user_id,
  61. deal_status,
  62. remark,
  63. analysis_submit_type,
  64. answer_image,
  65. t.num,
  66. small_question_name,
  67. question_text,
  68. option_answer_text,
  69. ifnull(parent_id, '') parent_id,
  70. big_name,
  71. analysis,
  72. question_json,
  73. answer_json,
  74. real_exam_type,
  75. date_format(publish_time, '%Y-%m-%dT%H:%i:%s.000Z') publish_time,
  76. update_type,
  77. analysis_user_id,
  78. ifnull(difficulty_level, 0) difficulty_level,
  79. t.course_name,
  80. training_skill,
  81. analysis_json,
  82. concise_id,
  83. analysis_auditer_id,
  84. date_format(handler_submit_time, '%Y-%m-%dT%H:%i:%s.000Z') handler_submit_time,
  85. date_format(analysis_handler_submit_time, '%Y-%m-%dT%H:%i:%s.000Z') analysis_handler_submit_time,
  86. question_class_type,
  87. ifnull(khds.alias, '') knowledge_name,
  88. khds.course_name,
  89. khds.semester,
  90. khds.grade,
  91. date_format(t.repulse_time, '%Y-%m-%dT%H:%i:%s.000Z') repulse_time,
  92. qqc.begin_year,
  93. qqc.end_year
  94. from (select *
  95. from kmt_quality_question_know
  96. where question_id in
  97. <foreach collection="questionIdList" open="(" item="questionId" separator="," close=")">
  98. #{questionId}
  99. </foreach>
  100. limit 1000) k join kmt_quality_questions t on k.question_id = t.id
  101. left join kmt_quality_question_comment qqc on t.id = qqc.question_id
  102. left join zyb_know_how_details_sort khds on k.how_detail_sort_id = khds.id
  103. </select>
  104. <select id="findQuestionByParentId" resultType="com.ssj.bean.kmt.kmt.domain.KmtQualityQuestions">
  105. select * from kmt_quality_questions where (id in
  106. <foreach collection="parentIds" open="(" item="id" separator="," close=")">
  107. #{id}
  108. </foreach>or parent_id in
  109. <foreach collection="parentIds" open="(" item="id" separator="," close=")">
  110. #{id}
  111. </foreach>
  112. ) and deal_status != 6
  113. order by num
  114. limit 2000
  115. </select>
  116. <select id="findQualityQuestionKnowByQuestionId" resultType="com.ssj.bean.kmt.kmt.domain.KmtQualityQuestionKnow">
  117. select * from kmt_quality_question_know where question_id=#{questionId}
  118. </select>
  119. </mapper>