xiangpei
2025-07-11 cca9b37d15cefe705d03219e2be1f73d77ee7254
framework/src/main/resources/mapper/lmk/ThumbsUpRecordMapper.xml
@@ -44,16 +44,43 @@
    <select id="countNumGroupByComment" resultType="cn.lili.modules.lmk.domain.vo.CollectTypeNumVO">
        SELECT
               LTUR.ref_id as id,
               LVC.id as id,
               count(LTUR.ref_id) as countNum
        FROM
             lmk_thumbs_up_record LTUR
                INNER JOIN lmk_video_comment LVC ON LTUR.ref_id = LVC.id AND LVC.thumbs_up_job = 1 AND LVC.delete_flag = 0
             lmk_video_comment LVC
                LEFT JOIN lmk_thumbs_up_record LTUR ON LTUR.ref_id = LVC.id AND LTUR.thumbs_up_type = 'video_comment' AND LTUR.delete_flag = 0
        WHERE
             LTUR.thumbs_up_type = 'video_comment'
             AND LTUR.delete_flag = 0
              LVC.thumbs_up_job = 1
              AND LVC.delete_flag = 0
        GROUP BY
             LTUR.ref_id
    </select>
    <select id="countNumGroupByVideo" resultType="cn.lili.modules.lmk.domain.vo.CollectTypeNumVO">
        SELECT
            LV.id as id,
            count(LTUR.ref_id) as countNum
        FROM
            lmk_video LV
                LEFT JOIN lmk_thumbs_up_record LTUR ON LTUR.ref_id = LV.id AND LTUR.thumbs_up_type = 'video' AND LTUR.delete_flag = 0
        WHERE
            LV.thumbs_up_num_job = 1
            AND LV.delete_flag = 0
        GROUP BY
            LTUR.ref_id
    </select>
    <select id="getThumbssByVideoIds" resultType="cn.lili.modules.lmk.domain.vo.SimpleMyThumbsUpVO">
        SELECT
            id,
            ref_id as refId
        FROM
            lmk_thumbs_up_record
        WHERE
            user_id = #{userId}
            AND delete_flag = 0
            AND thumbs_up_type = 'video'
            AND ref_id IN <foreach collection="videoIds" open="(" item="videoId" close=")" separator=",">#{videoId}</foreach>
    </select>
</mapper>