CommentMapper.xml
1.1 KB
<?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.server.web.common.mapping.CommentMapper" >
<select id="commentList" resultType="java.util.HashMap">
SELECT
t.id,
t.create_dt AS createDt,
t.reply_content AS replyContent,
u.full_name AS fullName,
u.head_photo AS headPhoto
FROM
t_kzy_comment t
LEFT JOIN t_kzy_user u ON t.user_id = u.id AND t.type = 2
WHERE
t.is_delete = 0
AND t.relation_id = #{courseId,jdbcType=BIGINT}
ORDER BY
t.id DESC
LIMIT #{start,jdbcType=INTEGER},#{pageSize,jdbcType=INTEGER}
</select>
<select id="commentListTotal" resultType="java.lang.Integer">
SELECT
count(t.id)
FROM
t_kzy_comment t
LEFT JOIN t_kzy_user u ON t.user_id = u.id AND t.type = 2
WHERE
t.is_delete = 0
AND t.relation_id = #{courseId,jdbcType=BIGINT}
</select>
</mapper>