| | |
| | | |
| | | <select id="countNumGroupByVideo" resultType="cn.lili.modules.lmk.domain.vo.CollectTypeNumVO"> |
| | | SELECT |
| | | video_id as id, |
| | | COUNT(*) as countNum |
| | | LV.id as id, |
| | | COUNT(LVC.video_id) as countNum |
| | | FROM |
| | | lmk_video_comment |
| | | lmk_video LV |
| | | LEFT JOIN lmk_video_comment LVC ON LVC.video_id = LV.id AND LVC.delete_flag = 0 AND LVC.status = 'normal' |
| | | WHERE |
| | | delete_flag = 0 AND status = 'normal' |
| | | LV.comment_num_job = 1 AND LV.delete_flag = 0 AND LV.status = '1' |
| | | GROUP BY |
| | | video_id |
| | | LVC.video_id |
| | | </select> |
| | | |
| | | |
| | | <update id="updateCommentThumbsUpNumBatch"> |
| | | UPDATE lmk_video_comment |
| | | SET thumbs_up_num = CASE id |
| | | <foreach collection="list" item="comment"> |
| | | WHEN #{comment.id} THEN #{comment.countNum} |
| | | </foreach> |
| | | ELSE thumbs_up_num |
| | | END |
| | | WHERE id IN |
| | | <foreach collection="list" item="comment" open="(" separator="," close=")"> |
| | | #{comment.id} |
| | | </foreach> |
| | | </update> |
| | | |
| | | </mapper> |