44323
2024-04-23 16b704d18a875d1fb63827aaa507790ba2bef5be
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
<?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="com.stylefeng.guns.modular.system.dao.FindCommentMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.FindComment">
        <id column="id" property="id" />
        <result column="findId" property="findId" />
        <result column="content" property="content" />
        <result column="pid" property="pid" />
        <result column="userId" property="userId" />
        <result column="replyUserId" property="replyUserId" />
        <result column="insertTime" property="insertTime" />
        <result column="isShow" property="isShow" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, findId, content, pid, userId, replyUserId, insertTime, isShow
    </sql>
    <select id="getCommentTwo" resultType="com.stylefeng.guns.modular.system.vo.CommentVO">
        select t1.*,t2.name as userName,t2.headImg,t3.name as replyUserName
        from t_find_comment t1
        left join t_user t2 on t1.userId = t2.id
        left join t_user t3 on t1.replyUserId = t3.id
        where t1.pid = #{id} and t1.isShow = 1
    </select>
    <select id="getCommentOne" resultType="com.stylefeng.guns.modular.system.vo.CommentVO">
        select t1.*,t2.name as userName,t2.headImg
        from t_find_comment t1
        left join t_user t2 on t1.userId = t2.id
        where t1.pid = 0 and t1.isShow = 1 and t1.findId = #{id}
    </select>
    <select id="selectFindComment" resultType="com.stylefeng.guns.modular.system.vo.CommentVO">
        select t1.*,t2.name as userName,t2.phone
        from t_find_comment t1
        left join t_user t2 on t1.userId= t2.id
        where t1.findId = #{req.id}
        order by t1.insertTime desc
    </select>
 
</mapper>