RecordQuestionMapper.xml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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.RecordQuestionMapper">
  4. <update id="updateQuestionNum">
  5. update tb_test_question
  6. set question_num = question_num - #{step}
  7. where type = #{openTestQuestion.type}
  8. and grade = #{openTestQuestion.grade}
  9. and subject = #{openTestQuestion.subject}
  10. and version = #{openTestQuestion.version}
  11. and unit = #{openTestQuestion.unit}
  12. and question_num > #{openTestQuestion.questionNum}
  13. and update_version > -1
  14. </update>
  15. <select id="findZtKnowledgeList" resultType="com.ssj.bean.mybatis.KnowledgeMBDto" parameterType="java.util.Map">
  16. select distinct (t1.alias) name,t1.two_module module
  17. from zyb_know_how_details_sort t1
  18. where t1.course_name = '语文'
  19. and exists(
  20. select 1 from zyb_know_how_details t2 where t1.how_id = t2.how_id and t2.is_zt = 1
  21. )
  22. and t1.stat=2
  23. and t1.grade = #{map.grade}
  24. and t1.semester = #{map.semester}
  25. and t1.type = 2
  26. order by t1.two_module,t1.alias
  27. </select>
  28. <select id="findKnowledgeList" resultType="com.ssj.bean.mybatis.KnowledgeMBDto" parameterType="java.util.Map">
  29. select distinct t.alias name
  30. from zyb_know_how_details_sort t
  31. where t.stat=2
  32. <if test="map.subject != null and map.subject != '' ">
  33. and t.course_name = #{map.subject}
  34. </if>
  35. <if test="map.version != null and map.version != '' ">
  36. and t.type = #{map.version}
  37. </if>
  38. <if test="map.semester != null and map.semester != '' ">
  39. and t.semester = #{map.semester}
  40. </if>
  41. <if test="map.howIds.size() > 0">
  42. and t.how_id in
  43. <foreach collection="map.howIds" index="i" item="howId" open="(" close=")" separator=",">
  44. #{howId}
  45. </foreach>
  46. </if>
  47. order by t.num
  48. </select>
  49. </mapper>