Your Name 3 years ago
parent
commit
fe1c281060

+ 7
- 0
src/main/java/com/yunzhi/marketing/controller/MiniAppController.java View File

111
     @Autowired
111
     @Autowired
112
     private TaSalesBatchMapper taSalesBatchMapper;
112
     private TaSalesBatchMapper taSalesBatchMapper;
113
 
113
 
114
+    @Autowired
115
+    public TaChannelService taChannelService;
116
+
114
     /**
117
     /**
115
      * 验证接入
118
      * 验证接入
116
      */
119
      */
248
             taPerson.setMiniappId(appid);
251
             taPerson.setMiniappId(appid);
249
             taPersonService.updateById(taPerson);
252
             taPersonService.updateById(taPerson);
250
 
253
 
254
+            if (CommConstant.PERSON_ESTATE_CHANNEL.equals(taPerson.getPersonType())) {
255
+                taPerson.setChannelList(taChannelService.getListByPerson(taPerson));
256
+            }
257
+
251
             // 增加积分线程 --- 3.5.23版本授权手机分享者增加积分,单纯分享不增加积分
258
             // 增加积分线程 --- 3.5.23版本授权手机分享者增加积分,单纯分享不增加积分
252
 //            ExecutorService threadPool = Executors.newCachedThreadPool();
259
 //            ExecutorService threadPool = Executors.newCachedThreadPool();
253
 //            threadPool.execute(() -> {
260
 //            threadPool.execute(() -> {

+ 1
- 1
src/main/java/com/yunzhi/marketing/controller/TaPersonController.java View File

220
         if(StringUtils.isEmpty(channelCode)){
220
         if(StringUtils.isEmpty(channelCode)){
221
             person.setPersonType(CommConstant.PERSON_ESTATE_AGENT);
221
             person.setPersonType(CommConstant.PERSON_ESTATE_AGENT);
222
         }else {
222
         }else {
223
-            person.setPersonType(CommConstant.PERSON_ESTATE_AGENT);
223
+            person.setPersonType(CommConstant.PERSON_ESTATE_CHANNEL);
224
             QueryWrapper<TaChannel> queryWrapper = new QueryWrapper();
224
             QueryWrapper<TaChannel> queryWrapper = new QueryWrapper();
225
             queryWrapper.eq("channel_code",channelCode);
225
             queryWrapper.eq("channel_code",channelCode);
226
             queryWrapper.eq("org_id",orgId);
226
             queryWrapper.eq("org_id",orgId);

+ 5
- 9
src/main/java/com/yunzhi/marketing/controller/TaRecommendCustomerController.java View File

228
      * @return
228
      * @return
229
      */
229
      */
230
     @PostMapping("/wx/channel/report")
230
     @PostMapping("/wx/channel/report")
231
-    @ApiOperation(value = "森哥看这里-wx-渠道顾问报备客户", notes = "森哥看这里-wx-渠道顾问报备客户")
231
+    @ApiOperation(value = "wx-渠道顾问报备客户", notes = "森哥看这里-wx-渠道顾问报备客户")
232
     public ResponseBean channelReportCust(@RequestBody ChannelReportDTO channelReportDTO, HttpServletRequest request) throws Exception {
232
     public ResponseBean channelReportCust(@RequestBody ChannelReportDTO channelReportDTO, HttpServletRequest request) throws Exception {
233
-        String openid = getOpenId(request);
233
+        String personId = getPersonId(request);
234
         Integer orgId = getOrgId(request);
234
         Integer orgId = getOrgId(request);
235
-        channelReportDTO.setOpenid(openid);
235
+        channelReportDTO.setPersonId(personId);
236
         channelReportDTO.setOrgId(orgId);
236
         channelReportDTO.setOrgId(orgId);
237
         return taRecommendCustomerService.channelReportCust(channelReportDTO);
237
         return taRecommendCustomerService.channelReportCust(channelReportDTO);
238
     }
238
     }
567
     @GetMapping("/wx/customer/recommend/mine")
567
     @GetMapping("/wx/customer/recommend/mine")
568
     public ResponseBean getWxCustomersIRecommended(@RequestParam int pageNumber, @RequestParam int pageSize, HttpServletRequest request) {
568
     public ResponseBean getWxCustomersIRecommended(@RequestParam int pageNumber, @RequestParam int pageSize, HttpServletRequest request) {
569
         Integer orgId = getOrgId(request);
569
         Integer orgId = getOrgId(request);
570
-        String openid = getOpenId(request);
571
-        List<TaPerson> taPersons = taPersonService.getPersonsByOpenId(openid);
572
-        if (null == taPersons || taPersons.size() != 1) {
573
-            return ResponseBean.error("验证人员信息失败", ResponseBean.ERROR_UNAVAILABLE);
574
-        }
575
-        TaPerson person = taPersons.get(0);
570
+        String personId = getPersonId(request);
571
+        TaPerson person = taPersonService.getById(personId);
576
         try {
572
         try {
577
             return ResponseBean.success(taRecommendCustomerService.getCustomersIRecommended(pageNumber, pageSize, person.getPersonId(), orgId, null));
573
             return ResponseBean.success(taRecommendCustomerService.getCustomersIRecommended(pageNumber, pageSize, person.getPersonId(), orgId, null));
578
         } catch (Exception e) {
574
         } catch (Exception e) {

+ 1
- 1
src/main/java/com/yunzhi/marketing/dto/ChannelReportDTO.java View File

5
 @Data
5
 @Data
6
 public class ChannelReportDTO {
6
 public class ChannelReportDTO {
7
 
7
 
8
-    private String openid;
8
+    private String personId;
9
 
9
 
10
     private Integer orgId;
10
     private Integer orgId;
11
 
11
 

+ 6
- 0
src/main/java/com/yunzhi/marketing/entity/TaPerson.java View File

347
      */
347
      */
348
     @TableField(exist = false)
348
     @TableField(exist = false)
349
     private String id;
349
     private String id;
350
+
351
+    /**
352
+     * 经济所属渠道列表
353
+     */
354
+    @TableField(exist = false)
355
+    private List<TaChannel> channelList;
350
 }
356
 }

+ 3
- 0
src/main/java/com/yunzhi/marketing/mapper/TaChannelMapper.java View File

3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
 import com.yunzhi.marketing.entity.TaChannel;
5
 import com.yunzhi.marketing.entity.TaChannel;
6
+import com.yunzhi.marketing.entity.TaPerson;
6
 import com.yunzhi.marketing.entity.TaPersonBuilding;
7
 import com.yunzhi.marketing.entity.TaPersonBuilding;
7
 import com.yunzhi.marketing.entity.TsActivityDaily;
8
 import com.yunzhi.marketing.entity.TsActivityDaily;
8
 import com.yunzhi.marketing.excel.ActivityStatistics.ChannelAddRegistNum;
9
 import com.yunzhi.marketing.excel.ActivityStatistics.ChannelAddRegistNum;
72
     List<ChannelVisitNum> getChannelVisitNumListExport(@Param("orgId") Integer orgId,@Param("channelId") Integer channelId,@Param("targetId") String targetId,@Param("targetType") String targetType,@Param("buildingId") String buildingId,@Param("startDate") LocalDate startDate,@Param("endDate") LocalDate endDate);
73
     List<ChannelVisitNum> getChannelVisitNumListExport(@Param("orgId") Integer orgId,@Param("channelId") Integer channelId,@Param("targetId") String targetId,@Param("targetType") String targetType,@Param("buildingId") String buildingId,@Param("startDate") LocalDate startDate,@Param("endDate") LocalDate endDate);
73
 
74
 
74
     List<ChannelVisitPersonNum> getChannelPersonNumListExport(@Param("orgId") Integer orgId,@Param("channelId") Integer channelId,@Param("targetId") String targetId,@Param("targetType") String targetType,@Param("buildingId") String buildingId,@Param("startDate") LocalDate startDate,@Param("endDate") LocalDate endDate);
75
     List<ChannelVisitPersonNum> getChannelPersonNumListExport(@Param("orgId") Integer orgId,@Param("channelId") Integer channelId,@Param("targetId") String targetId,@Param("targetType") String targetType,@Param("buildingId") String buildingId,@Param("startDate") LocalDate startDate,@Param("endDate") LocalDate endDate);
76
+
77
+    List<TaChannel> getListByPerson(@Param("params") TaPerson taPerson);
75
 }
78
 }

+ 3
- 0
src/main/java/com/yunzhi/marketing/service/TaChannelService.java View File

3
 import com.baomidou.mybatisplus.extension.service.IService;
3
 import com.baomidou.mybatisplus.extension.service.IService;
4
 import com.yunzhi.marketing.base.ResponseBean;
4
 import com.yunzhi.marketing.base.ResponseBean;
5
 import com.yunzhi.marketing.entity.TaChannel;
5
 import com.yunzhi.marketing.entity.TaChannel;
6
+import com.yunzhi.marketing.entity.TaPerson;
6
 import com.yunzhi.marketing.entity.TaPersonBuilding;
7
 import com.yunzhi.marketing.entity.TaPersonBuilding;
7
 import com.yunzhi.marketing.excel.ActivityStatistics.ChannelAddRegistNum;
8
 import com.yunzhi.marketing.excel.ActivityStatistics.ChannelAddRegistNum;
8
 import com.yunzhi.marketing.excel.ActivityStatistics.ChannelVisitNum;
9
 import com.yunzhi.marketing.excel.ActivityStatistics.ChannelVisitNum;
118
      * @return
119
      * @return
119
      */
120
      */
120
     List<ChannelVisitPersonNum> getPersonNumListExport(Integer orgId, Integer channelId, String targetId, String targetType, String buildingId, LocalDate startDate, LocalDate endDate);
121
     List<ChannelVisitPersonNum> getPersonNumListExport(Integer orgId, Integer channelId, String targetId, String targetType, String buildingId, LocalDate startDate, LocalDate endDate);
122
+
123
+    List<TaChannel> getListByPerson(TaPerson taPerson);
121
 }
124
 }

+ 6
- 0
src/main/java/com/yunzhi/marketing/service/impl/TaChannelServiceImpl.java View File

6
 import com.yunzhi.marketing.base.ResponseBean;
6
 import com.yunzhi.marketing.base.ResponseBean;
7
 import com.yunzhi.marketing.common.StringUtils;
7
 import com.yunzhi.marketing.common.StringUtils;
8
 import com.yunzhi.marketing.entity.TaChannel;
8
 import com.yunzhi.marketing.entity.TaChannel;
9
+import com.yunzhi.marketing.entity.TaPerson;
9
 import com.yunzhi.marketing.entity.TaPersonBuilding;
10
 import com.yunzhi.marketing.entity.TaPersonBuilding;
10
 import com.yunzhi.marketing.entity.TsActivityDaily;
11
 import com.yunzhi.marketing.entity.TsActivityDaily;
11
 import com.yunzhi.marketing.excel.ActivityStatistics.ChannelAddRegistNum;
12
 import com.yunzhi.marketing.excel.ActivityStatistics.ChannelAddRegistNum;
219
     public List<ChannelVisitPersonNum> getPersonNumListExport(Integer orgId, Integer channelId, String targetId, String targetType, String buildingId, LocalDate startDate, LocalDate endDate) {
220
     public List<ChannelVisitPersonNum> getPersonNumListExport(Integer orgId, Integer channelId, String targetId, String targetType, String buildingId, LocalDate startDate, LocalDate endDate) {
220
         return taChannelMapper.getChannelPersonNumListExport(orgId, channelId, targetId, targetType, buildingId,startDate,endDate);
221
         return taChannelMapper.getChannelPersonNumListExport(orgId, channelId, targetId, targetType, buildingId,startDate,endDate);
221
     }
222
     }
223
+
224
+    @Override
225
+    public List<TaChannel> getListByPerson(TaPerson taPerson) {
226
+        return taChannelMapper.getListByPerson(taPerson);
227
+    }
222
 }
228
 }

+ 2
- 6
src/main/java/com/yunzhi/marketing/service/impl/TaRecommendCustomerServiceImpl.java View File

363
     public ResponseBean channelReportCust(ChannelReportDTO channelReportDTO) throws Exception {
363
     public ResponseBean channelReportCust(ChannelReportDTO channelReportDTO) throws Exception {
364
 
364
 
365
         // 当前人员
365
         // 当前人员
366
-        List<TaPerson> persons = getPersonsByOpenId(channelReportDTO.getOpenid());
367
-        if (null == persons || persons.size() != 1) {
368
-            throw new Exception("当前人员 openid 异常");
369
-        }
370
-        TaPerson person = persons.get(0);
366
+        TaPerson person = taPersonMapper.getById(channelReportDTO.getPersonId());
371
 
367
 
372
         // 先查看在ta_recommend_customer 手机号是否存在
368
         // 先查看在ta_recommend_customer 手机号是否存在
373
         LambdaQueryWrapper<TaRecommendCustomer> queryWrapper = new LambdaQueryWrapper<>();
369
         LambdaQueryWrapper<TaRecommendCustomer> queryWrapper = new LambdaQueryWrapper<>();
420
         channelCustomer.setPicture(channelReportDTO.getPicture());
416
         channelCustomer.setPicture(channelReportDTO.getPicture());
421
         channelCustomer.setPhone(channelReportDTO.getPhone());
417
         channelCustomer.setPhone(channelReportDTO.getPhone());
422
         channelCustomer.setSex(channelReportDTO.getSex());
418
         channelCustomer.setSex(channelReportDTO.getSex());
423
-        channelCustomer.setRecommendPerson(channelReportDTO.getRealtyChannel());
419
+        channelCustomer.setRecommendPerson(channelReportDTO.getPersonId());
424
         channelCustomer.setCreateDate(LocalDateTime.now());
420
         channelCustomer.setCreateDate(LocalDateTime.now());
425
         channelCustomer.setStatus("1");
421
         channelCustomer.setStatus("1");
426
         channelCustomer.setChannelId(taChannelPeople.getChannelId());
422
         channelCustomer.setChannelId(taChannelPeople.getChannelId());

+ 19
- 5
src/main/java/com/yunzhi/marketing/xlk/controller/ChannelCustomerController.java View File

17
 import org.springframework.beans.factory.annotation.Autowired;
17
 import org.springframework.beans.factory.annotation.Autowired;
18
 import org.springframework.web.bind.annotation.*;
18
 import org.springframework.web.bind.annotation.*;
19
 
19
 
20
+import javax.servlet.http.HttpServletRequest;
21
+
20
 /**
22
 /**
21
  * <p>
23
  * <p>
22
     * 渠道报备客户表  前端控制器
24
     * 渠道报备客户表  前端控制器
45
     @ApiOperation(value = "admin-渠道报备客户表", notes = "admin-渠道报备客户表")
47
     @ApiOperation(value = "admin-渠道报备客户表", notes = "admin-渠道报备客户表")
46
     @RequestMapping(value="/admin/channelCustomer",method= RequestMethod.GET)
48
     @RequestMapping(value="/admin/channelCustomer",method= RequestMethod.GET)
47
     public ResponseBean channelCustomerList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
49
     public ResponseBean channelCustomerList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
48
-                                            @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
50
+                                            @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
51
+                                            @RequestParam(value ="buildingId", required = false) String buildingId,
52
+                                            @RequestParam(value ="name", required = false) String name,
53
+                                            @RequestParam(value ="phone", required = false) String phone,
54
+                                            @RequestParam(value ="recommendPersonName", required = false) String recommendPersonName,
55
+                                            @RequestParam(value ="recommendPhone", required = false) String recommendPhone,
56
+                                            @RequestParam(value ="status", required = false) String status,
57
+                                            HttpServletRequest request){
58
+        Integer orgId = getOrgId(request);
49
         ResponseBean responseBean = new ResponseBean();
59
         ResponseBean responseBean = new ResponseBean();
50
         try {
60
         try {
51
             //使用分页插件
61
             //使用分页插件
52
 		    IPage<ChannelCustomer> pg = new Page<>(pageNum, pageSize);
62
 		    IPage<ChannelCustomer> pg = new Page<>(pageNum, pageSize);
53
-            LambdaQueryWrapper<ChannelCustomer> queryWrapper = new LambdaQueryWrapper<>();
54
-            queryWrapper.eq(ChannelCustomer::getStatus,"1");
55
-            queryWrapper.orderByDesc(ChannelCustomer::getCreateDate);
56
 
63
 
57
-            IPage<ChannelCustomer> result = iChannelCustomerService.page(pg, queryWrapper);
64
+            IPage<ChannelCustomer> result = iChannelCustomerService.getProfileList(pg,
65
+                    orgId,
66
+                    buildingId,
67
+                    name,
68
+                    phone,
69
+                    recommendPersonName,
70
+                    recommendPhone,
71
+                    status);
58
             responseBean.addSuccess(result);
72
             responseBean.addSuccess(result);
59
         }catch (Exception e){
73
         }catch (Exception e){
60
             e.printStackTrace();
74
             e.printStackTrace();

+ 21
- 0
src/main/java/com/yunzhi/marketing/xlk/entity/ChannelCustomer.java View File

1
 package com.yunzhi.marketing.xlk.entity;
1
 package com.yunzhi.marketing.xlk.entity;
2
 
2
 
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
5
+import com.baomidou.mybatisplus.annotation.TableId;
3
 import com.baomidou.mybatisplus.annotation.TableName;
6
 import com.baomidou.mybatisplus.annotation.TableName;
4
 import io.swagger.models.auth.In;
7
 import io.swagger.models.auth.In;
5
 import lombok.Data;
8
 import lombok.Data;
28
     /**
31
     /**
29
      * 主键
32
      * 主键
30
      */
33
      */
34
+    @TableId(value = "channel_customer_id", type = IdType.UUID)
31
     private String channelCustomerId;
35
     private String channelCustomerId;
32
 
36
 
33
     /**
37
     /**
45
      */
49
      */
46
     private String buildingId;
50
     private String buildingId;
47
 
51
 
52
+
53
+    /**
54
+     * 楼盘名称
55
+     */
56
+    @TableField(exist = false)
57
+    private String buildingName;
58
+
48
     /**
59
     /**
49
      * 电话
60
      * 电话
50
      */
61
      */
85
      */
96
      */
86
     private Integer channelId;
97
     private Integer channelId;
87
 
98
 
99
+    /**
100
+     * 推荐人姓名
101
+     */
102
+    @TableField(exist = false)
103
+    private String recommendPersonName;
88
 
104
 
105
+    /**
106
+     * 推荐人手机
107
+     */
108
+    @TableField(exist = false)
109
+    private String recommendPhone;
89
 }
110
 }

+ 11
- 0
src/main/java/com/yunzhi/marketing/xlk/mapper/ChannelCustomerMapper.java View File

1
 package com.yunzhi.marketing.xlk.mapper;
1
 package com.yunzhi.marketing.xlk.mapper;
2
 
2
 
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.yunzhi.marketing.xlk.entity.ChannelCustomer;
5
 import com.yunzhi.marketing.xlk.entity.ChannelCustomer;
5
 import org.apache.ibatis.annotations.Mapper;
6
 import org.apache.ibatis.annotations.Mapper;
7
+import org.apache.ibatis.annotations.Param;
6
 
8
 
7
 /**
9
 /**
8
  * <p>
10
  * <p>
15
 @Mapper
17
 @Mapper
16
 public interface ChannelCustomerMapper extends BaseMapper<ChannelCustomer> {
18
 public interface ChannelCustomerMapper extends BaseMapper<ChannelCustomer> {
17
 
19
 
20
+    IPage<ChannelCustomer> getProfileList(IPage<ChannelCustomer> pg,
21
+                                          @Param("orgId") Integer orgId,
22
+                                          @Param("buildingId") String buildingId,
23
+                                          @Param("name") String name,
24
+                                          @Param("phone") String phone,
25
+                                          @Param("recommendPersonName") String recommendPersonName,
26
+                                          @Param("recommendPhone") String recommendPhone,
27
+                                          @Param("status") String status);
28
+
18
 }
29
 }

+ 10
- 0
src/main/java/com/yunzhi/marketing/xlk/service/IChannelCustomerService.java View File

1
 package com.yunzhi.marketing.xlk.service;
1
 package com.yunzhi.marketing.xlk.service;
2
 
2
 
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
3
 import com.baomidou.mybatisplus.extension.service.IService;
4
 import com.baomidou.mybatisplus.extension.service.IService;
4
 import com.yunzhi.marketing.base.ResponseBean;
5
 import com.yunzhi.marketing.base.ResponseBean;
5
 import com.yunzhi.marketing.xlk.dto.ChannelCustomerDTO;
6
 import com.yunzhi.marketing.xlk.dto.ChannelCustomerDTO;
38
      * @return
39
      * @return
39
      */
40
      */
40
     ResponseBean invalidCustomerUpdate(MarkingChannelCustomerDTO params);
41
     ResponseBean invalidCustomerUpdate(MarkingChannelCustomerDTO params);
42
+
43
+    IPage<ChannelCustomer> getProfileList(IPage<ChannelCustomer> pg,
44
+                                          Integer orgId,
45
+                                          String buildingId,
46
+                                          String name,
47
+                                          String phone,
48
+                                          String recommendPersonName,
49
+                                          String recommendPhone,
50
+                                          String status);
41
 }
51
 }

+ 13
- 0
src/main/java/com/yunzhi/marketing/xlk/service/impl/ChannelCustomerServiceImpl.java View File

1
 package com.yunzhi.marketing.xlk.service.impl;
1
 package com.yunzhi.marketing.xlk.service.impl;
2
 
2
 
3
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
3
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
 import com.yunzhi.marketing.base.ResponseBean;
6
 import com.yunzhi.marketing.base.ResponseBean;
6
 import com.yunzhi.marketing.common.CommConstant;
7
 import com.yunzhi.marketing.common.CommConstant;
192
         }
193
         }
193
         return ResponseBean.error("无效操作", ResponseBean.ERROR_UNAVAILABLE);
194
         return ResponseBean.error("无效操作", ResponseBean.ERROR_UNAVAILABLE);
194
     }
195
     }
196
+
197
+    @Override
198
+    public IPage<ChannelCustomer> getProfileList(IPage<ChannelCustomer> pg,
199
+                                                 Integer orgId,
200
+                                                 String buildingId,
201
+                                                 String name,
202
+                                                 String phone,
203
+                                                 String recommendPersonName,
204
+                                                 String recommendPhone,
205
+                                                 String status) {
206
+        return channelCustomerMapper.getProfileList(pg, orgId, buildingId, name, phone, recommendPersonName, recommendPhone, status);
207
+    }
195
 }
208
 }

+ 10
- 0
src/main/resources/mapper/TaChannelMapper.xml View File

461
         group by t.person_id
461
         group by t.person_id
462
         order by t.create_date desc
462
         order by t.create_date desc
463
     </select>
463
     </select>
464
+    <select id="getListByPerson" resultType="com.yunzhi.marketing.entity.TaChannel">
465
+        SELECT
466
+            t.*
467
+        FROM
468
+            ta_channel t
469
+                INNER JOIN ta_channel_person s ON t.channel_id = s.channel_id
470
+        WHERE
471
+            t.org_id = #{params.orgId}
472
+          AND s.person_id = #{params.personId}
473
+    </select>
464
 
474
 
465
 </mapper>
475
 </mapper>

+ 36
- 0
src/main/resources/mapper/xlk/ChannelCustomerMapper.xml View File

2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
 <mapper namespace="com.yunzhi.marketing.xlk.mapper.ChannelCustomerMapper">
3
 <mapper namespace="com.yunzhi.marketing.xlk.mapper.ChannelCustomerMapper">
4
 
4
 
5
+    <select id="getProfileList" resultType="com.yunzhi.marketing.xlk.entity.ChannelCustomer">
6
+        SELECT
7
+            t.*,
8
+            s.building_name,
9
+            m.nickname AS recommend_person_name,
10
+            m.phone AS recommend_person_phone
11
+        FROM
12
+            xlk_channel_customer t
13
+                LEFT JOIN ta_building s ON t.building_id = s.building_id
14
+                INNER JOIN ta_person m ON t.recommend_person = m.person_id
15
+        WHERE
16
+            t.org_id = #{orgId}
17
+          <if test="buildingId != null and buildingId != ''">
18
+              AND t.building_id = #{buildingId}
19
+          </if>
20
+          <if test="name != null and name != ''">
21
+              AND t.`name` LIKE CONCAT( '%', #{name}, '%' )
22
+          </if>
23
+          <if test="phone != null and phone != ''">
24
+            AND t.phone LIKE CONCAT( '%', #{phone}, '%' )
25
+          </if>
26
+          <if test="recommendPersonName != null and recommendPersonName != ''">
27
+            AND m.nickname LIKE CONCAT( '%', #{recommendPersonName}, '%' )
28
+          </if>
29
+          <if test="recommendPhone != null and recommendPhone != ''">
30
+            AND m.phone LIKE CONCAT( '%', #{recommendPhone}, '%' )
31
+          </if>
32
+          <if test="status != null and status != ''">
33
+            AND t.`status` = #{status}
34
+          </if>
35
+          <if test="status == null or status == ''">
36
+            AND t.`status` &gt; -1
37
+          </if>
38
+            ORDER BY
39
+                t.create_date DESC
40
+    </select>
5
 </mapper>
41
 </mapper>