洪城义警-正式版后台
zengh
2022-05-26 4c19ddd36bdfb43b5ef4e8df3c9a98cd4d356d6c
src/main/java/org/springblade/modules/comment/mapper/CommentMapper.xml
@@ -3,16 +3,60 @@
<mapper namespace="org.springblade.modules.comment.mapper.CommentMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="ulikesResultMap" type="org.springblade.modules.comment.entity.Comment">
        <id column="id" property="id"/>
        <result column="name" property="name"/>
        <result column="identityCard" property="identityCard"/>
        <result column="ticketCode" property="ticketCode"/>
    <resultMap id="ulikesResultMap" type="org.springblade.modules.comment.vo.CommentVO">
    </resultMap>
    <select id="selectSurveyPage" resultMap="ulikesResultMap">
        select * from sys_ulikes
        SELECT
            com.*,
            user.real_name as name
        FROM
            sys_comment com
            LEFT JOIN blade_user user ON com.user_id = user.id
        where 1=1 and isexamine = 1
        <if test="comment.article!=null and comment.article!=''">
            and article = #{comment.article}
        </if>
            ORDER BY topping DESC,time DESC
    </select>
    <select id="articlepage" resultMap="ulikesResultMap">
        SELECT
        com.*,
        user.real_name AS name,
        art.title,
        art.source_name
        FROM
        sys_comment com
        LEFT JOIN blade_user user ON com.user_id = user.id
        LEFT JOIN sys_article art on art.id = com.article
        WHERE
        1 =1
        <if test="comment.topping!=null and comment.topping!=''">
            and topping = #{comment.topping}
        </if>
        <if test="comment.isexamine!=null and comment.isexamine!=''">
            and isexamine = #{comment.isexamine}
        </if>
        <if test="comment.sourceName!=null and comment.sourceName!=''">
            and source_name LIKE CONCAT ('%', #{comment.sourceName},'%')
        </if>
        <if test="comment.title!=null and comment.title!=''">
            and title LIKE CONCAT ('%', #{comment.title},'%')
        </if>
        <if test="comment.name!=null and comment.name!=''">
            and name LIKE CONCAT ('%', #{comment.name},'%')
        </if>
        <if test="comment.startTime!=null and comment.startTime!=''">
            and time&gt;=#{comment.startTime}
        </if>
        <if test="comment.endTime!=null and comment.endTime!=''">
            and time&lt;=#{comment.endTime}
        </if>
            ORDER BY isexamine ASC,topping DESC,time DESC
    </select>