龚焕茏
2024-06-26 11dda318d00aea0ca51133d3dd397ee8a3cfaa1e
src/main/resources/mapper/QuestionMapper.xml
@@ -106,4 +106,15 @@
            and deleted = 0 and status = 1
    </select>
    <select id="getRandomQuestion" resultMap="BaseResultMap">
        SELECT
               *
        FROM
             t_question tq
        WHERE
              tq.subject_id = #{subjectId}
        ORDER BY
                 RAND()
        LIMIT #{num}
    </select>
</mapper>