CommentMapper.xml 2.14 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.auth_status=2 AND t.type=2
        AND t.relation_id = #{courseId,jdbcType=BIGINT}
        ORDER BY
            t.id ASC
        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.auth_status=2 AND t.type=2
        AND t.relation_id = #{courseId,jdbcType=BIGINT}
    </select>
    <select id="informationCommentList" 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 = 1
        WHERE
            t.is_delete = 0 AND t.auth_status=2 AND t.type=1
        AND t.relation_id = #{informationId,jdbcType=BIGINT}
        ORDER BY
            t.id ASC
        LIMIT #{start,jdbcType=INTEGER},#{pageSize,jdbcType=INTEGER}
    </select>
    <select id="informationCommentListTotal" 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 = 1
        WHERE
            t.is_delete = 0 AND t.auth_status=2 AND t.type=1
        AND t.relation_id = #{informationId,jdbcType=BIGINT}
    </select>

</mapper>