xiangpei
2025-05-27 f2cc79e9e83aafacc1af0e2c86e3c8df384fc895
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?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">
<mapper namespace="cn.lili.modules.lmk.mapper.VideoCommentMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.VideoCommentVO">
        <id column="id" property="id"/>
        <result column="video_id" property="videoId" />
        <result column="comment_content" property="commentContent" />
        <result column="reply_id" property="replyId" />
        <result column="reply_user_id" property="replyUserId" />
        <result column="reply_user_nickname" property="replyUserNickname" />
        <result column="master_comment_id" property="masterCommentId" />
        <result column="status" property="status" />
        <result column="create_by" property="userId" />
        <result column="user_nickname" property="userNickname" />
        <result column="user_avatar" property="userAvatar" />
    </resultMap>
 
 
 
 
 
 
 
    <select id="getById" resultMap="BaseResultMap">
        SELECT
            LVC.video_id,
            LVC.comment_content,
            LVC.reply_id,
            LVC.master_comment_id,
            LVC.status,
            LVC.id
        FROM
            lmk_video_comment LVC
        WHERE
            LVC.id = #{id} AND LVC.delete_flag = 0
    </select>
 
 
    <select id="getPage" resultMap="BaseResultMap">
        SELECT
            LVC.video_id,
            LVC.comment_content,
            LVC.reply_id,
            LVC.master_comment_id,
            LVC.status,
            LVC.id
        FROM
            lmk_video_comment LVC
        WHERE
            LVC.delete_flag = 0
    </select>
 
 
    <select id="masterCommentPage" resultMap="BaseResultMap">
        SELECT
            LVC.video_id,
            LVC.comment_content,
            LVC.reply_id,
            LVC.reply_user_id,
            LVC.reply_user_nickname,
            LVC.master_comment_id,
            LVC.status,
            LVC.id,
            LVC.create_by,
            LVC.user_nickname,
            LVC.user_avatar
        FROM
             lmk_video_comment LVC
        WHERE
              LVC.id = LVC.master_comment_id
              AND LVC.video_id = #{query.videoId}
              AND LVC.status = 'normal'
              AND LVC.delete_flag = 0
        ORDER BY
            LVC.create_time DESC
    </select>
 
    <select id="replyCommentPage" resultMap="BaseResultMap">
        SELECT
            LVC.video_id,
            LVC.comment_content,
            LVC.reply_id,
            LVC.reply_user_id,
            LVC.reply_user_nickname,
            LVC.master_comment_id,
            LVC.status,
            LVC.id,
            LVC.create_by,
            LVC.user_nickname,
            LVC.user_avatar
        FROM
            lmk_video_comment LVC
        WHERE
              LVC.id = LVC.master_comment_id
              AND LVC.video_id = #{query.videoId}
              AND LVC.master_comment_id = #{query.masterCommentId}
              AND LVC.status = 'normal'
              AND LVC.delete_flag = 0
        ORDER BY
            LVC.create_time ASC
    </select>
 
</mapper>