huanghongfa
2021-01-05 d9eee1919dbff7ffddc48b1f4fee2ec41a54a2a2
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
package com.panzhihua.service_user.dao;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.common.model.dtos.user.PageFeedBackDTO;
import com.panzhihua.common.model.vos.user.SysUserFeedbackVO;
import com.panzhihua.service_user.model.dos.SysUserFeedbackDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
 
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
 * @description: 意见反馈
 * @author: huang.hongfa weixin hhf9596 qq 959656820
 * @create: 2020-12-31 13:25
 **/
@Mapper
public interface SysUserFeedbackDAO extends BaseMapper<SysUserFeedbackDO> {
    //    @Select("<script> " +
//            " <where>" +
//            "<if test='nameCn != null and nameCn.trim() != &quot;&quot;'>" +
//            " </if> " +
//            "<if test='nameCn != null and nameCn.trim() != &quot;&quot;'>" +
//            " </if> " +
//            "<if test='nameCn != null and nameCn.trim() != &quot;&quot;'>" +
//            " </if> " +
//            " </where>" +
//            "</script>")
 
    @Select("<script> " +
            "select \n" +
            "u.name,\n" +
            "u.nick_name,\n" +
            "f.id,\n" +
            "u.phone,\n" +
            "f.create_at,\n" +
            "f.content,\n" +
            "f.photo_path,\n" +
            "c.name communityName\n" +
            "from sys_user_feedback f\n" +
            "join sys_user u on f.user_id=u.user_id\n" +
            "<if test='pageFeedBackDTO.name != null and pageFeedBackDTO.name.trim() != &quot;&quot;'>" +
            "and u.name=#{pageFeedBackDTO.name}\n" +
            " </if> " +
            "<if test='pageFeedBackDTO.nickName != null and pageFeedBackDTO.nickName.trim() != &quot;&quot;'>" +
            "and u.nick_name=#{pageFeedBackDTO.nickName}\n" +
            " </if> " +
            "join com_act c on u.community_id=c.community_id\n" +
            "order by f.create_at desc\n" +
            "</script>")
    IPage<SysUserFeedbackVO> pageFeedback(Page page, @Param("pageFeedBackDTO") PageFeedBackDTO pageFeedBackDTO);
 
    @Select("select \n" +
            "u.name,\n" +
            "u.nick_name,\n" +
            "f.id,\n" +
            "f.content,\n" +
            "f.photo_path,\n" +
            "u.phone,\n" +
            "f.create_at,\n" +
            "c.name communityName\n" +
            "from sys_user_feedback f\n" +
            "join sys_user u on f.user_id=u.user_id\n" +
            "join com_act c on u.community_id=c.community_id\n" +
            "where f.id=#{id}\n")
    SysUserFeedbackVO detailFeedback(Long id);
}