<?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>
|