<?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="org.springblade.modules.circle.mapper.CircleCommentMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="circleResultMap" type="org.springblade.modules.circle.vo.CircleCommentVO">
|
<result property="id" column="id" />
|
<result property="circleId" column="circle_id" />
|
<result property="content" column="content" />
|
<result property="userId" column="user_id" />
|
<result property="parentId" column="parent_id" />
|
<result property="replyTime" column="reply_time" />
|
<result property="topping" column="topping" />
|
<result property="isexamine" column="isexamine" />
|
<result property="checkUser" column="check_user" />
|
<result property="checkTime" column="check_time" />
|
<result property="checkStatus" column="check_status" />
|
<result property="checkRemark" column="check_remark" />
|
<result property="createTime" column="create_time" />
|
<result property="isDeleted" column="is_deleted" />
|
<result property="depth" column="depth" />
|
|
<collection property="children" column="id" javaType="java.util.List"
|
ofType="org.springblade.modules.circle.vo.CircleCommentVO"
|
autoMapping="true"
|
select="selectCircleCommentByParentId">
|
|
</collection>
|
|
</resultMap>
|
|
|
<resultMap type="org.springblade.modules.circle.dto.CircleCommentDTO" id="CircleCommentDTOResult">
|
<result property="id" column="id" />
|
<result property="circleId" column="circle_id" />
|
<result property="content" column="content" />
|
<result property="userId" column="user_id" />
|
<result property="parentId" column="parent_id" />
|
<result property="replyTime" column="reply_time" />
|
<result property="topping" column="topping" />
|
<result property="isexamine" column="isexamine" />
|
<result property="checkUser" column="check_user" />
|
<result property="checkTime" column="check_time" />
|
<result property="checkStatus" column="check_status" />
|
<result property="checkRemark" column="check_remark" />
|
<result property="createTime" column="create_time" />
|
<result property="isDeleted" column="is_deleted" />
|
<result property="depth" column="depth" />
|
</resultMap>
|
|
<sql id="selectCircleComment">
|
select
|
id,
|
circle_id,
|
content,
|
user_id,
|
parent_id,
|
reply_time,
|
topping,
|
isexamine,
|
check_user,
|
check_time,
|
check_status,
|
check_remark,
|
create_time,
|
is_deleted,
|
depth
|
from
|
jczz_circle_comment
|
</sql>
|
|
<select id="selectCircleCommentById" parameterType="int" resultMap="CircleCommentDTOResult">
|
<include refid="selectCircleComment"/>
|
where
|
id = #{id}
|
</select>
|
|
<select id="selectCircleCommentByParentId" parameterType="int" resultMap="CircleCommentDTOResult">
|
<include refid="selectCircleComment"/>
|
where
|
parent_id = #{id}
|
</select>
|
|
<select id="selectCircleCommentList" parameterType="org.springblade.modules.circle.dto.CircleCommentDTO" resultMap="CircleCommentDTOResult">
|
<include refid="selectCircleComment"/>
|
<where>
|
<if test="id != null "> and id = #{id}</if>
|
<if test="circleId != null "> and circle_id = #{circleId}</if>
|
<if test="content != null and content != ''"> and content = #{content}</if>
|
<if test="userId != null "> and user_id = #{userId}</if>
|
<if test="parentId != null "> and parent_id = #{parentId}</if>
|
<if test="replyTime != null "> and reply_time = #{replyTime}</if>
|
<if test="topping != null "> and topping = #{topping}</if>
|
<if test="isexamine != null "> and isexamine = #{isexamine}</if>
|
<if test="checkUser != null "> and check_user = #{checkUser}</if>
|
<if test="checkTime != null "> and check_time = #{checkTime}</if>
|
<if test="checkStatus != null "> and check_status = #{checkStatus}</if>
|
<if test="checkRemark != null and checkRemark != ''"> and check_remark = #{checkRemark}</if>
|
<if test="createTime != null "> and create_time = #{createTime}</if>
|
<if test="isDeleted != null "> and is_deleted = #{isDeleted}</if>
|
<if test="depth != null "> and depth = #{depth}</if>
|
</where>
|
</select>
|
|
|
<select id="selectCircleCommentPage" resultMap="circleResultMap">
|
select
|
jcc.id,
|
jcc.circle_id,
|
jcc.content,
|
jcc.user_id,
|
jcc.parent_id,
|
jcc.reply_time,
|
jcc.topping,
|
jcc.isexamine,
|
jcc.check_user,
|
jcc.check_time,
|
jcc.check_status,
|
jcc.check_remark,
|
jcc.create_time,
|
jcc.is_deleted,
|
bu.name,
|
bu.avatar,
|
jcc.depth
|
from
|
jczz_circle_comment jcc left join blade_user bu on jcc.user_id = bu.id
|
<where>
|
<if test="circle.id != null "> and jcc.id = #{circle.id}</if>
|
<if test="circle.circleId != null "> and jcc.circle_id = #{circle.circleId}</if>
|
<if test="circle.content != null and circle.content != ''"> and content = #{circle.content}</if>
|
<if test="circle.userId != null "> and jcc.user_id = #{circle.userId}</if>
|
<if test="circle.parentId != null "> and jcc.parent_id = #{circle.parentId}</if>
|
<if test="circle.replyTime != null "> and jcc.reply_time = #{circle.replyTime}</if>
|
<if test="circle.topping != null "> and jcc.topping = #{circle.topping}</if>
|
<if test="circle.isexamine != null "> and jcc.isexamine = #{circle.isexamine}</if>
|
<if test="circle.checkUser != null "> and jcc.check_user = #{circle.checkUser}</if>
|
<if test="circle.checkTime != null "> and jcc.check_time = #{circle.checkTime}</if>
|
<if test="circle.checkStatus != null "> and jcc.check_status = #{circle.checkStatus}</if>
|
<if test="circle.checkRemark != null and circle.checkRemark != ''"> and jcc.check_remark = #{circle.checkRemark}</if>
|
<if test="circle.createTime != null "> and jcc.create_time = #{circle.createTime}</if>
|
<if test="circle.isDeleted != null "> and jcc.is_deleted = #{circle.isDeleted}</if>
|
<if test="circle.depth != null "> and jcc.depth = #{circle.depth}</if>
|
</where>
|
</select>
|
|
|
</mapper>
|