洪城义警-正式版后台
zengh
2021-11-05 b39cc2beacc1ec2e37cff349cae42e420105c8a6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?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="org.springblade.modules.comment.mapper.CommentMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="ulikesResultMap" type="org.springblade.modules.comment.vo.CommentVO">
 
    </resultMap>
 
 
    <select id="selectSurveyPage" resultMap="ulikesResultMap">
        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>
 
 
</mapper>