This commit is contained in:
sjm
2023-12-26 23:16:03 +08:00
parent eda0e41b53
commit 8b6b6a6b7a
6 changed files with 57 additions and 81 deletions

View File

@@ -13,6 +13,9 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="rating" jdbcType="INTEGER" property="rating" />
</resultMap>
<sql id="Base_Column_List">
id, url_id, user_id, content, root_comment_id, like_count, comment_time, comment_status,
update_time, rating
@@ -164,34 +167,18 @@
<select id="queryFirstCommentList" parameterType="java.lang.Integer" resultMap="com.lovenav.dao.mybaits.Map">
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 = 0
</select>
<!-- <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="com.lovenav.dao.mybaits.Map">
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 != 0
</select>