| | |
| | | RAND() LIMIT #{questionNum} |
| | | </select> |
| | | |
| | | <select id="questionsBySubjectIds" resultType="integer"> |
| | | SELECT |
| | | question_id |
| | | FROM |
| | | t_question_subject |
| | | <where> |
| | | subject_id IN <foreach collection="subjectIds" open="(" separator="," close=")" item="subjectId">#{subjectId}</foreach> |
| | | </where> |
| | | ORDER BY |
| | | id DESC |
| | | </select> |
| | | |
| | | <select id="questionsBySubjectId" resultType="integer"> |
| | | SELECT |
| | | tqs.question_id |
| | | FROM |
| | | t_question_subject tqs |
| | | INNER JOIN t_question tq ON tqs.question_id = tq.id AND tqs.subject_id = #{subjectId} |
| | | ORDER BY |
| | | tqs.id DESC |
| | | </select> |
| | | |
| | | <select id="questionsBySubjectIdAndQuestionType" resultType="integer"> |
| | | SELECT |
| | | tqs.question_id |
| | | FROM |
| | | t_question_subject tqs |
| | | INNER JOIN t_question tq ON tqs.question_id = tq.id AND tqs.subject_id = #{subjectId} AND tq.question_type = #{questionType} |
| | | ORDER BY |
| | | tqs.id DESC |
| | | </select> |
| | | |
| | | </mapper> |