manailin
2021-12-08 a22c110d080fe4387cd7b29a9bd36a727eb5944a
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
64
65
66
67
<?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.panzhihua.service_user.dao.SysUserFeedbackDAO">
    <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.SysUserFeedbackDO">
        <id property="id" column="id"/>
        <result property="content" column="content"/>
        <result property="photoPath" column="photo_path"/>
        <result property="createAt" column="create_at"/>
        <result property="updateAt" column="update_at"/>
        <result property="userId" column="user_id"/>
        <result property="areaId" column="area_id"/>
        <result property="communityId" column="community_id"/>
        <result property="status" column="status"/>
 
    </resultMap>
    <sql id="columns">
        `id`,`content`,`photo_path`,`create_at`,`update_at`,`user_id`,`area_id`,`community_id`,`status`
    </sql>
 
 
    <select id="detailFeedback" resultType="com.panzhihua.common.model.vos.user.SysUserFeedbackVO">
        select
        u.name,
        u.nick_name,
        f.id,
        f.content,
        f.photo_path,
        u.phone,
        f.create_at,
        c.name communityName
        from sys_user_feedback f
        join sys_user u on f.user_id=u.user_id
        join com_act c on u.community_id=c.community_id
        where f.id=#{id}
 
    </select>
 
    <select id="pageFeedback" resultType="com.panzhihua.common.model.vos.user.SysUserFeedbackVO">
        select
        u.name,
        u.nick_name,
        f.id,
        u.phone,
        f.create_at,
        f.content,
        f.photo_path,
        c.name communityName
        from sys_user_feedback f
        left join sys_user u on f.user_id=u.user_id
        left join com_act c on u.community_id=c.community_id
        <where>
            <if test='pageFeedBackDTO.phone != null and pageFeedBackDTO.phone.trim() != &quot;&quot;'>
                and u.phone like concat('%',#{pageFeedBackDTO.phone},'%')
            </if>
            <if test='pageFeedBackDTO.name != null and pageFeedBackDTO.name.trim() != &quot;&quot;'>
                and u.name like concat('%',#{pageFeedBackDTO.name},'%')
            </if>
            <if test='pageFeedBackDTO.nickName != null and pageFeedBackDTO.nickName.trim() != &quot;&quot;'>
                and u.nick_name like concat('%',#{pageFeedBackDTO.nickName},'%')
            </if>
        </where>
        order by f.create_at desc
 
    </select>
 
 
</mapper>