2025-05-28 11:07:39 +08:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
2025-06-03 17:11:55 +08:00
|
|
|
<mapper namespace="com.wzj.soopin.content.mapper.CommentMapper" >
|
|
|
|
<resultMap id="BaseResultMap" type="com.wzj.soopin.content.domain.po.Comment" >
|
2025-05-28 11:07:39 +08:00
|
|
|
<!--
|
|
|
|
WARNING - @mbg.generated
|
|
|
|
-->
|
|
|
|
<id column="id" property="id" jdbcType="VARCHAR" />
|
|
|
|
<result column="vloger_id" property="vlogerId" jdbcType="VARCHAR" />
|
|
|
|
<result column="father_comment_id" property="fatherCommentId" jdbcType="VARCHAR" />
|
|
|
|
<result column="vlog_id" property="vlogId" jdbcType="VARCHAR" />
|
|
|
|
<result column="comment_user_id" property="commentUserId" jdbcType="VARCHAR" />
|
|
|
|
<result column="content" property="content" jdbcType="VARCHAR" />
|
|
|
|
<result column="like_counts" property="likeCounts" jdbcType="INTEGER" />
|
|
|
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
|
|
|
</resultMap>
|
2025-06-07 09:22:31 +08:00
|
|
|
|
|
|
|
<!-- 根据视频ID查询评论列表 -->
|
|
|
|
<select id="selectByVlogId" resultType="com.wzj.soopin.content.domain.po.Comment">
|
2025-08-13 17:29:13 +08:00
|
|
|
SELECT * FROM cont_comment
|
2025-06-07 09:22:31 +08:00
|
|
|
WHERE vlog_id = #{vlogId}
|
|
|
|
ORDER BY create_time DESC
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 根据父评论ID查询子评论列表 -->
|
|
|
|
<select id="selectByFatherCommentId" resultType="com.wzj.soopin.content.domain.po.Comment">
|
2025-08-13 17:29:13 +08:00
|
|
|
SELECT * FROM cont_comment
|
2025-06-07 09:22:31 +08:00
|
|
|
WHERE father_comment_id = #{fatherCommentId}
|
|
|
|
ORDER BY create_time ASC
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 根据评论ID查询评论信息 -->
|
|
|
|
<select id="selectByCommentId" resultType="com.wzj.soopin.content.domain.po.Comment">
|
2025-08-13 17:29:13 +08:00
|
|
|
SELECT * FROM cont_comment
|
2025-06-07 09:22:31 +08:00
|
|
|
WHERE id = #{commentId}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 根据视频ID统计评论数量 -->
|
|
|
|
<select id="countByVlogId" resultType="java.lang.Integer">
|
2025-08-13 17:29:13 +08:00
|
|
|
SELECT COUNT(*) FROM cont_comment
|
2025-06-07 09:22:31 +08:00
|
|
|
WHERE vlog_id = #{vlogId}
|
|
|
|
</select>
|
2025-06-03 17:11:55 +08:00
|
|
|
</mapper>
|