LearnExamineeMapper.xml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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.ruoyi.learn.mapper.LearnExamineeMapper">
  6. <resultMap type="LearnExaminee" id="LearnExamineeResult">
  7. <result property="examineeId" column="examinee_id" />
  8. <result property="studentId" column="student_id" />
  9. <result property="paperType" column="paper_type" />
  10. <result property="paperId" column="paper_id" />
  11. <result property="beginTime" column="begin_time" />
  12. <result property="endTime" column="end_time" />
  13. <result property="state" column="state" />
  14. <result property="scoreLevel" column="score_level" />
  15. <result property="score" column="score" />
  16. <result property="scoreRate" column="score_rate" />
  17. <result property="ranking" column="ranking" />
  18. <result property="gradeRanking" column="grade_ranking" />
  19. <result property="chooseCount" column="choose_count" />
  20. <result property="chooseTotal" column="choose_total" />
  21. <result property="subjectiveCount" column="subjective_count" />
  22. <result property="subjectiveTotal" column="subjective_total" />
  23. <result property="createTime" column="create_time" />
  24. <result property="updateTime" column="update_time" />
  25. </resultMap>
  26. <sql id="selectLearnExamineeVo">
  27. select examinee_id, student_id, paper_type, paper_id, begin_time, end_time, state, score_level, score, score_rate, ranking, grade_ranking, choose_count, choose_total, subjective_count, subjective_total, create_time, update_time from learn_examinee
  28. </sql>
  29. <select id="selectLearnExamineeList" parameterType="LearnExaminee" resultMap="LearnExamineeResult">
  30. <include refid="selectLearnExamineeVo"/>
  31. <where>
  32. <if test="studentId != null "> and student_id = #{studentId}</if>
  33. <if test="paperType != null "> and paper_type = #{paperType}</if>
  34. <if test="paperId != null "> and paper_id = #{paperId}</if>
  35. <if test="beginTime != null "> and begin_time = #{beginTime}</if>
  36. <if test="endTime != null "> and end_time = #{endTime}</if>
  37. <if test="state != null "> and state = #{state}</if>
  38. <if test="scoreLevel != null and scoreLevel != ''"> and score_level = #{scoreLevel}</if>
  39. <if test="score != null "> and score = #{score}</if>
  40. <if test="scoreRate != null "> and score_rate = #{scoreRate}</if>
  41. <if test="ranking != null "> and ranking = #{ranking}</if>
  42. <if test="gradeRanking != null "> and grade_ranking = #{gradeRanking}</if>
  43. <if test="chooseCount != null "> and choose_count = #{chooseCount}</if>
  44. <if test="chooseTotal != null "> and choose_total = #{chooseTotal}</if>
  45. <if test="subjectiveCount != null "> and subjective_count = #{subjectiveCount}</if>
  46. <if test="subjectiveTotal != null "> and subjective_total = #{subjectiveTotal}</if>
  47. </where>
  48. </select>
  49. <select id="selectLearnExamineeByExamineeId" parameterType="Long" resultMap="LearnExamineeResult">
  50. <include refid="selectLearnExamineeVo"/>
  51. where examinee_id = #{examineeId}
  52. </select>
  53. <insert id="insertLearnExaminee" parameterType="LearnExaminee" useGeneratedKeys="true" keyProperty="examineeId">
  54. insert into learn_examinee
  55. <trim prefix="(" suffix=")" suffixOverrides=",">
  56. <if test="studentId != null">student_id,</if>
  57. <if test="paperType != null">paper_type,</if>
  58. <if test="paperId != null">paper_id,</if>
  59. <if test="beginTime != null">begin_time,</if>
  60. <if test="endTime != null">end_time,</if>
  61. <if test="state != null">state,</if>
  62. <if test="scoreLevel != null">score_level,</if>
  63. <if test="score != null">score,</if>
  64. <if test="scoreRate != null">score_rate,</if>
  65. <if test="ranking != null">ranking,</if>
  66. <if test="gradeRanking != null">grade_ranking,</if>
  67. <if test="chooseCount != null">choose_count,</if>
  68. <if test="chooseTotal != null">choose_total,</if>
  69. <if test="subjectiveCount != null">subjective_count,</if>
  70. <if test="subjectiveTotal != null">subjective_total,</if>
  71. <if test="createTime != null">create_time,</if>
  72. <if test="updateTime != null">update_time,</if>
  73. </trim>
  74. <trim prefix="values (" suffix=")" suffixOverrides=",">
  75. <if test="studentId != null">#{studentId},</if>
  76. <if test="paperType != null">#{paperType},</if>
  77. <if test="paperId != null">#{paperId},</if>
  78. <if test="beginTime != null">#{beginTime},</if>
  79. <if test="endTime != null">#{endTime},</if>
  80. <if test="state != null">#{state},</if>
  81. <if test="scoreLevel != null">#{scoreLevel},</if>
  82. <if test="score != null">#{score},</if>
  83. <if test="scoreRate != null">#{scoreRate},</if>
  84. <if test="ranking != null">#{ranking},</if>
  85. <if test="gradeRanking != null">#{gradeRanking},</if>
  86. <if test="chooseCount != null">#{chooseCount},</if>
  87. <if test="chooseTotal != null">#{chooseTotal},</if>
  88. <if test="subjectiveCount != null">#{subjectiveCount},</if>
  89. <if test="subjectiveTotal != null">#{subjectiveTotal},</if>
  90. <if test="createTime != null">#{createTime},</if>
  91. <if test="updateTime != null">#{updateTime},</if>
  92. </trim>
  93. </insert>
  94. <update id="updateLearnExaminee" parameterType="LearnExaminee">
  95. update learn_examinee
  96. <trim prefix="SET" suffixOverrides=",">
  97. <if test="studentId != null">student_id = #{studentId},</if>
  98. <if test="paperType != null">paper_type = #{paperType},</if>
  99. <if test="paperId != null">paper_id = #{paperId},</if>
  100. <if test="beginTime != null">begin_time = #{beginTime},</if>
  101. <if test="endTime != null">end_time = #{endTime},</if>
  102. <if test="state != null">state = #{state},</if>
  103. <if test="scoreLevel != null">score_level = #{scoreLevel},</if>
  104. <if test="score != null">score = #{score},</if>
  105. <if test="scoreRate != null">score_rate = #{scoreRate},</if>
  106. <if test="ranking != null">ranking = #{ranking},</if>
  107. <if test="gradeRanking != null">grade_ranking = #{gradeRanking},</if>
  108. <if test="chooseCount != null">choose_count = #{chooseCount},</if>
  109. <if test="chooseTotal != null">choose_total = #{chooseTotal},</if>
  110. <if test="subjectiveCount != null">subjective_count = #{subjectiveCount},</if>
  111. <if test="subjectiveTotal != null">subjective_total = #{subjectiveTotal},</if>
  112. <if test="createTime != null">create_time = #{createTime},</if>
  113. <if test="updateTime != null">update_time = #{updateTime},</if>
  114. </trim>
  115. where examinee_id = #{examineeId}
  116. </update>
  117. <delete id="deleteLearnExamineeByExamineeId" parameterType="Long">
  118. delete from learn_examinee where examinee_id = #{examineeId}
  119. </delete>
  120. <delete id="deleteLearnExamineeByExamineeIds" parameterType="String">
  121. delete from learn_examinee where examinee_id in
  122. <foreach item="examineeId" collection="array" open="(" separator="," close=")">
  123. #{examineeId}
  124. </foreach>
  125. </delete>
  126. </mapper>