| | |
| | | p.platform_name |
| | | ORDER BY |
| | | total_repetitions DESC |
| | | LIMIT 30 |
| | | </select> |
| | | <select id="getResultByTypeId" resultType="com.linghu.model.vo.PlatformProportionVO"> |
| | | SELECT |
| | |
| | | ORDER BY |
| | | r.repetition_num DESC |
| | | </select> |
| | | <select id="getTypeIds" resultType="java.lang.Integer"> |
| | | SELECT DISTINCT t.type_id -- 使用 DISTINCT 去重,确保每个 type_id 只出现一次 |
| | | FROM reference r |
| | | JOIN platform p ON r.platform_id = p.platform_id |
| | | JOIN type t ON p.type_id = t.type_id |
| | | WHERE r.keyword_id = #{keywordId} |
| | | <if test="questionId != null"> |
| | | AND r.question_id = #{questionId} |
| | | </if> |
| | | AND r.num = #{num} |
| | | ORDER BY t.type_id -- 按 type_id 排序,结果更规范 |
| | | </select> |
| | | </mapper> |