mitao
2025-02-21 31573d6180d15ef65ed0df9c2732495f40b12663
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
68
69
70
71
72
73
74
75
76
<?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>
    <update id="reply">
        update sys_user_feedback set reply=#{dto.reply} where id=#{dto.id}
    </update>
 
 
    <select id="detailFeedback" resultType="com.panzhihua.common.model.vos.user.SysUserFeedbackVO">
        select
        u.name,
        u.nick_name,
        f.*,
        u.phone,
        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,
        f.reply
        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>
            <if test='pageFeedBackDTO.areaCode != null and pageFeedBackDTO.areaCode.trim() != &quot;&quot;'>
                and c.area_code = #{pageFeedBackDTO.areaCode}
            </if>
            <if test="pageFeedBackDTO.propertyId != null and pageFeedBackDTO.propertyId != ''">
                and f.property_id = #{pageFeedBackDTO.propertyId}
            </if>
            <if test="pageFeedBackDTO.type != null and pageFeedBackDTO.type != ''">
                and f.type = #{pageFeedBackDTO.type}
            </if>
        </where>
        order by f.create_at desc
 
    </select>
 
 
</mapper>