This commit is contained in:
sjm 2023-12-25 16:49:59 +08:00
parent 8efe35f13b
commit 2b7a0f09c4

View File

@ -169,29 +169,31 @@
<select id="queryFirstCommentList" parameterType="java.lang.Integer" resultMap="ResultMap">
SELECT * FROM ln_comment o LEFT JOIN ln_user u
ON o.user_id=u.id
WHERE o.url_id=#{urlId,jdbcType=INTEGER} AND o.root_comment_id is null
</select>
<resultMap id="ResultMap" type="com.lovenav.entity.Comment">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="url_id" jdbcType="INTEGER" property="urlId" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="content" jdbcType="VARCHAR" property="content" />
<result column="root_comment_id" jdbcType="INTEGER" property="rootCommentId" />
<result column="like_count" jdbcType="BIGINT" property="likeCount" />
<result column="comment_time" jdbcType="TIMESTAMP" property="commentTime" />
<result column="comment_status" jdbcType="TINYINT" property="commentStatus" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="rating" jdbcType="INTEGER" property="rating" />
</resultMap>
<!-- <select id="queryFirstCommentList" parameterType="java.lang.Integer" resultMap="ResultMap">-->
<!-- SELECT * FROM ln_comment o LEFT JOIN ln_user u-->
<!-- ON o.user_id=u.id-->
<!-- WHERE o.url_id=#{urlId,jdbcType=INTEGER} AND o.root_comment_id is null-->
<!-- </select>-->
<!-- <resultMap id="ResultMap" type="com.lovenav.entity.Comment">-->
<!-- <id column="id" jdbcType="INTEGER" property="id" />-->
<!-- <result column="url_id" jdbcType="INTEGER" property="urlId" />-->
<!-- <result column="user_id" jdbcType="INTEGER" property="userId" />-->
<!-- <result column="content" jdbcType="VARCHAR" property="content" />-->
<!-- <result column="root_comment_id" jdbcType="INTEGER" property="rootCommentId" />-->
<!-- <result column="like_count" jdbcType="BIGINT" property="likeCount" />-->
<!-- <result column="comment_time" jdbcType="TIMESTAMP" property="commentTime" />-->
<!-- <result column="comment_status" jdbcType="TINYINT" property="commentStatus" />-->
<!-- <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />-->
<!-- <result column="rating" jdbcType="INTEGER" property="rating" />-->
<!-- </resultMap>-->
<!-- <select id="querySecondCommentList" parameterType="java.lang.Integer" resultMap="ResultMap">-->
<!-- SELECT * FROM ln_comment o LEFT JOIN ln_user u-->
<!-- ON o.user_id=u.id-->
<!-- WHERE o.url_id=#{urlId,jdbcType=INTEGER} AND o.root_comment_id is not null-->
<!-- </select>-->
<select id="querySecondCommentList" parameterType="java.lang.Integer" resultMap="ResultMap">
SELECT * FROM ln_comment o LEFT JOIN ln_user u
ON o.user_id=u.id
WHERE o.url_id=#{urlId,jdbcType=INTEGER} AND o.root_comment_id is not null
</select>
</mapper>