guyue
2025-09-03 dd028e18a12ad9ae7c43ed09b15ddd6bde1a43e9
src/main/resources/mapper/keywordMapper.xml
@@ -99,11 +99,11 @@
    </select>
    <select id="getResultByPlatformId" resultType="com.linghu.model.vo.ResultListVO">
        SELECT
            r.reference_id,
            MIN(r.reference_id) AS reference_id,
            p.platform_name,
            r.title,
            r.repetition_num,
            r.create_time,
            MAX(r.title) AS title,  -- 或者使用 GROUP_CONCAT(r.title) 如果你想要所有标题
            SUM(r.repetition_num) AS repetition_num,
            MAX(r.create_time) AS create_time,  -- 或者 MIN(r.create_time) 取决于你的需求
            r.url
        FROM
        reference r
@@ -119,8 +119,10 @@
                AND r.platform_id = #{platformId}
            </if>
        GROUP BY
        p.platform_name
        ORDER BY
        r.repetition_num DESC
        repetition_num DESC
    </select>
    <select id="getTypeIds" resultType="java.lang.Integer">
        SELECT DISTINCT t.type_id  -- 使用 DISTINCT 去重,确保每个 type_id 只出现一次