Ver código fonte

Merge branch 'v3.5' of http://git.ycjcjy.com/zhiyuxing/estateagents into v3.5

胡轶钦 5 anos atrás
pai
commit
a72ecf02ad

+ 6
- 6
src/main/java/com/huiju/estateagents/activity/service/impl/ActivityServiceImpl.java Ver arquivo

@@ -59,16 +59,16 @@ public class ActivityServiceImpl implements ActivityServiceI {
59 59
 		queryWrapper.eq("org_id",orgId);
60 60
 		queryWrapper.eq("person_id",person.getPersonId());
61 61
 		List<TaActivityDynamicEnlist> taActivityDynamicEnlists = taActivityDynamicEnlistMapper.selectList(queryWrapper);
62
-		//查询是否报名了分享活动
62
+		//查询是否报名了拼团活动
63 63
 		QueryWrapper<TaShareRecord> taShareRecordQueryWrapper = new QueryWrapper<>();
64 64
 		taShareRecordQueryWrapper.eq("org_id",orgId);
65 65
 		taShareRecordQueryWrapper.eq("person_id",person.getPersonId());
66 66
 		List<TaShareRecord> taShareRecords = taShareRecordMapper.selectList(taShareRecordQueryWrapper);
67 67
 		//判断是否报名了助力活动
68
-		QueryWrapper<HelpRecord> helpRecordQueryWrapper = new QueryWrapper<>();
69
-		helpRecordQueryWrapper.eq("org_id",orgId);
70
-		helpRecordQueryWrapper.eq("person_id",person.getPersonId());
71
-		List<HelpRecord> helpRecords = helpRecordMapper.selectList(helpRecordQueryWrapper);
68
+		QueryWrapper<HelpInitiateRecord> helpInitiateRecordListQueryWrapper = new QueryWrapper<>();
69
+		helpInitiateRecordListQueryWrapper.eq("org_id",orgId);
70
+		helpInitiateRecordListQueryWrapper.eq("person_id",person.getPersonId());
71
+		List<HelpInitiateRecord> HelpInitiateRecords = helpInitiateRecordMapper.selectList(helpInitiateRecordListQueryWrapper);
72 72
 		
73 73
 		//分页获取全部数据
74 74
 		Page pg = new Page(pageNumber,pageSize);
@@ -95,7 +95,7 @@ public class ActivityServiceImpl implements ActivityServiceI {
95 95
 				List<TaShareRecord> taShareRecordsList = taShareRecordMapper.selectList(shareRecordQueryWrapper);
96 96
 				e.setSuccessNum(taShareRecordsList.size());
97 97
 			}else if (e.getType().equals("help")){
98
-				helpRecords.forEach(help -> {
98
+				HelpInitiateRecords.forEach(help -> {
99 99
 					if (e.getId().equals(help.getHelpActivityId())){
100 100
 						e.setActivityStatus(CommConstant.ACTIVITY_STATUS_PARTNER);
101 101
 					}

+ 18
- 0
src/main/java/com/huiju/estateagents/common/CommConstant.java Ver arquivo

@@ -429,4 +429,22 @@ public class CommConstant {
429 429
 	public static final Object GROUP_ACTIVITY = "groupActivity";
430 430
 	public static final String TARGET_TYPE_H5 = "H5";
431 431
     public static final String ACTIVITY_QRCODE = "{\"scene\":\"id=#0&type=#1\",\"page\":\"pages/checkin/index\"}";
432
+    
433
+    /**
434
+     * 消息通知
435
+     * 必须存在表   td_miniapp_template_type 中
436
+     */
437
+    public static final String MINIAPP_TPL_NOTICE = "notice";
438
+    
439
+    /**
440
+     * 助力通知
441
+     * 必须存在表   td_miniapp_template_type 中
442
+     */
443
+    public static final String MINIAPP_TPL_HELP = "help.result";
444
+    
445
+    /**
446
+     * 拼团通知
447
+     * 必须存在表   td_miniapp_template_type 中
448
+     */
449
+    public static final String MINIAPP_TPL_GROUP = "group.result";
432 450
 }

+ 5
- 0
src/main/java/com/huiju/estateagents/controller/HelpActivityController.java Ver arquivo

@@ -472,6 +472,11 @@ public class HelpActivityController extends BaseController {
472 472
                 helpRecordQueryWrapper.eq("help_activity_id",helpActivity.getHelpActivityId());
473 473
                 helpRecordQueryWrapper.eq("help_record_initiate_id",helpInitiateRecord.getHelpRecordInitiateId());
474 474
                 List<HelpRecord> helpRecordList = helpRecordService.list(helpRecordQueryWrapper);
475
+                helpRecordList.forEach(e -> {
476
+                    if (e.getPersonId().equals(person.getPersonId())){
477
+                        map.put("isJoin",true);
478
+                    }
479
+                });
475 480
         
476 481
                 map.put("helpInitiateRecord",helpInitiateRecord);
477 482
                 map.put("helpRecordList",helpRecordList);

+ 13
- 1
src/main/java/com/huiju/estateagents/controller/MiniAppController.java Ver arquivo

@@ -357,7 +357,19 @@ public class MiniAppController extends BaseController {
357 357
 //                taCustomerPersonService.insertBean(person.getPersonId(),customers.getCustomerId());
358 358
 //            }
359 359
         }
360
-
360
+//        else{
361
+//            TaRecommendCustomer taRecommendCustomer = new TaRecommendCustomer();
362
+//            taRecommendCustomer.setPersonId(person.getPersonId());
363
+//            taRecommendCustomer.setPicture(person.getAvatarurl());
364
+//            taRecommendCustomer.setCountry(person.getCountry());
365
+//            taRecommendCustomer.setCity(person.getCity());
366
+//            taRecommendCustomer.setProvince(person.getProvince());
367
+//            taRecommendCustomer.setVerifyStatus(CommConstant.VERIFY_AGREE);
368
+//            taRecommendCustomer.setOrgId(getOrgId(request));
369
+//            taRecommendCustomer.setEntryType(CommConstant.ENTRY_VOLUNTEER);
370
+//            taRecommendCustomer.setSex(Integer.getInteger(person.getGender()));
371
+//
372
+//        }
361 373
         return ResponseBean.success(phoneNoInfo);
362 374
     }
363 375
 

+ 5
- 0
src/main/java/com/huiju/estateagents/controller/TaShareActivityController.java Ver arquivo

@@ -348,6 +348,11 @@ public class TaShareActivityController extends BaseController {
348 348
                 childRecordQueryWrapper.eq("group_activity_id",taShareActivity.getGroupActivityId());
349 349
                 childRecordQueryWrapper.eq("record_id",taShareRecord.getRecordId());
350 350
                 List<TaShareChildRecord> shareChildRecordList = taShareChildRecordService.list(childRecordQueryWrapper);
351
+                shareChildRecordList.forEach(e -> {
352
+                    if (e.getPersonId().equals(person.getPersonId())){
353
+                        map.put("isJoin",true);
354
+                    }
355
+                });
351 356
                 map.put("shareChildRecordList",shareChildRecordList);
352 357
             }
353 358
     

+ 8
- 11
src/main/java/com/huiju/estateagents/mapper/TaPersonMapper.java Ver arquivo

@@ -52,21 +52,19 @@ public interface TaPersonMapper extends BaseMapper<TaPerson> {
52 52
 
53 53
     /**
54 54
      * 总用户数
55
-     * @param personType
56 55
      * @return
57 56
      */
58 57
     @ResultType(Integer.class)
59
-    @Select("select count(1) from ta_person where org_id = #{org} AND ifnull(person_type, '') != #{personType}")
60
-    Integer selectUserCount(@Param("org") Integer orgId, @Param("personType") String personType);
58
+    @Select("select count(1) from ta_person where org_id = #{org} AND person_type IN ('customer','drift','estate agent')")
59
+    Integer selectUserCount(@Param("org") Integer orgId);
61 60
 
62 61
     /**
63 62
      * 总注册数
64
-     * @param personType
65 63
      * @return
66 64
      */
67 65
     @ResultType(Integer.class)
68
-    @Select("select count(1) from ta_person where org_id = #{org} AND ifnull(person_type, '') != #{personType} and phone is not null")
69
-    Integer selectRegisteredCount(@Param("org") Integer orgId, @Param("personType") String personType);
66
+    @Select("select count(1) from ta_person where org_id = #{org} AND person_type IN ('customer','drift','estate agent') and phone is not null")
67
+    Integer selectRegisteredCount(@Param("org") Integer orgId);
70 68
 
71 69
     /**
72 70
      * 根据时间段查询
@@ -115,11 +113,10 @@ public interface TaPersonMapper extends BaseMapper<TaPerson> {
115 113
      *
116 114
      *  据说 1 男  2 女
117 115
      *
118
-     * @param personType
119 116
      * @return
120 117
      */
121
-    @Select("select count(1) as sex_count from ta_person where org_id = #{org} AND ifnull(person_type, '') != #{personType} and gender = #{gender}")
122
-    Integer selectSexUser(@Param("org") Integer orgId, @Param("personType") String personType, @Param("gender") Integer gender);
118
+    @Select("select count(1) as sex_count from ta_person where org_id = #{org} AND person_type IN ('customer','drift','estate agent')  and gender = #{gender}")
119
+    Integer selectSexUser(@Param("org") Integer orgId, @Param("gender") Integer gender);
123 120
 
124 121
 
125 122
     /**
@@ -140,10 +137,10 @@ public interface TaPersonMapper extends BaseMapper<TaPerson> {
140 137
             "on a.city = b.id " +
141 138
             "WHERE " +
142 139
             "   a.org_id = #{org} " +
143
-            "	AND ifnull(a.person_type, '') != #{personType} " +
140
+            "	AND a.person_type IN ('customer','drift','estate agent')  " +
144 141
             "GROUP BY " +
145 142
             "	a.city ")
146
-    List<Map<String, Object>> selectCityUser(@Param("org") Integer orgId, @Param("personType") String personType);
143
+    List<Map<String, Object>> selectCityUser(@Param("org") Integer orgId);
147 144
 
148 145
 
149 146
     // ------------- 用户来源 start ------------

+ 1
- 1
src/main/java/com/huiju/estateagents/mapper/TaRecommendCustomerMapper.java Ver arquivo

@@ -44,7 +44,7 @@ public interface TaRecommendCustomerMapper extends BaseMapper<TaRecommendCustome
44 44
      * @param sex
45 45
      * @return
46 46
      */
47
-    IPage<TaRecommendCustomer> getPublicCustomerList(IPage<TaRecommendCustomer> page, @Param("buildingId") String buildingId, @Param("name") String name, @Param("tel") String tel,@Param("entryType") String entryType,@Param("verifyStatus") String verifyStatus,@Param("sex") Integer sex, @Param("orgId") Integer orgId,@Param("consultTel")String consultTel);
47
+    IPage<TaPerson> getPublicCustomerList(IPage<TaPerson> page, @Param("buildingId") String buildingId, @Param("name") String name, @Param("tel") String tel,@Param("entryType") String entryType,@Param("verifyStatus") String verifyStatus,@Param("sex") Integer sex, @Param("orgId") Integer orgId,@Param("consultTel")String consultTel);
48 48
 
49 49
     /**
50 50
      * 导出数据 获取推荐用户数据

+ 3
- 3
src/main/java/com/huiju/estateagents/service/impl/MiniAppServiceImpl.java Ver arquivo

@@ -82,7 +82,7 @@ public class MiniAppServiceImpl implements IMiniAppService {
82 82
         data.add(new WxMaTemplateData("keyword3", content, "#fffff"));
83 83
         data.add(new WxMaTemplateData("keyword4", DateUtils.cutSecond(dt), "#fffff"));
84 84
 
85
-        sendMessage("notice", toUser, link, data);
85
+        sendMessage(CommConstant.MINIAPP_TPL_NOTICE, toUser, link, data);
86 86
     }
87 87
     
88 88
     @Override
@@ -92,7 +92,7 @@ public class MiniAppServiceImpl implements IMiniAppService {
92 92
         data.add(new WxMaTemplateData("keyword2", activityName, "#fffff"));
93 93
         data.add(new WxMaTemplateData("keyword3", DateUtils.cutSecond(dt), "#fffff"));
94 94
         
95
-        sendMessage("help.result", toUser, link, data);
95
+        sendMessage(CommConstant.MINIAPP_TPL_HELP, toUser, link, data);
96 96
     }
97 97
     
98 98
     @Override
@@ -102,7 +102,7 @@ public class MiniAppServiceImpl implements IMiniAppService {
102 102
         data.add(new WxMaTemplateData("keyword2", activityName, "#fffff"));
103 103
         data.add(new WxMaTemplateData("keyword3", DateUtils.cutSecond(dt), "#fffff"));
104 104
         
105
-        sendMessage("group.result", toUser, link, data);
105
+        sendMessage(CommConstant.MINIAPP_TPL_GROUP, toUser, link, data);
106 106
     }
107 107
 
108 108
     @Override

+ 12
- 12
src/main/java/com/huiju/estateagents/service/impl/StatisticalServiceImpl.java Ver arquivo

@@ -52,10 +52,10 @@ public class StatisticalServiceImpl implements IStatisticalService {
52 52
         Map<String,Object> map = new HashMap<>();
53 53
 
54 54
         // 总用户数
55
-        Integer selectUserCount = taPersonMapper.selectUserCount(orgId, CommConstant.PERSON_REALTY_CONSULTANT);
55
+        Integer selectUserCount = taPersonMapper.selectUserCount(orgId);
56 56
 
57 57
         // 注册数
58
-        Integer selectRegisteredCount = taPersonMapper.selectRegisteredCount(orgId, CommConstant.PERSON_REALTY_CONSULTANT);
58
+        Integer selectRegisteredCount = taPersonMapper.selectRegisteredCount(orgId);
59 59
 
60 60
         // 最近七天
61 61
         Integer selectRecentlyCount = taPersonMapper.selectRecentlyCount(orgId, CommConstant.PERSON_REALTY_CONSULTANT, null, null);
@@ -71,8 +71,8 @@ public class StatisticalServiceImpl implements IStatisticalService {
71 71
 
72 72
         // 性别比例
73 73
         // 1 男 2 女
74
-        Integer selectSexMale = taPersonMapper.selectSexUser(orgId, CommConstant.PERSON_REALTY_CONSULTANT, CommConstant.SEX_MALE);
75
-        Integer selectSexFemale = taPersonMapper.selectSexUser(orgId, CommConstant.PERSON_REALTY_CONSULTANT, CommConstant.SEX_FEMALE);
74
+        Integer selectSexMale = taPersonMapper.selectSexUser(orgId, CommConstant.SEX_MALE);
75
+        Integer selectSexFemale = taPersonMapper.selectSexUser(orgId, CommConstant.SEX_FEMALE);
76 76
         Map<String, Object> selectSexMaleMap = new HashMap<>();
77 77
         selectSexMaleMap.put("name", "男");
78 78
         selectSexMaleMap.put("value", selectSexMale);
@@ -84,7 +84,7 @@ public class StatisticalServiceImpl implements IStatisticalService {
84 84
         selectSexUser.add(selectSexFemaleMap);
85 85
 
86 86
         // 城市比例
87
-        List<Map<String, Object>> selectCityUser = taPersonMapper.selectCityUser(orgId, CommConstant.PERSON_REALTY_CONSULTANT);
87
+        List<Map<String, Object>> selectCityUser = taPersonMapper.selectCityUser(orgId);
88 88
 
89 89
         // 转化率, 当前 默认项目收藏
90 90
         Map<String, Object> selectBuildingStatistical = taBuildingMapper.selectBuildingStatistical(orgId, "save");
@@ -235,10 +235,10 @@ public class StatisticalServiceImpl implements IStatisticalService {
235 235
 
236 236
             case CommConstant.AUTHORIZATION_PHONE:
237 237
                 // 总用户数
238
-                Integer selectUserCount = taPersonMapper.selectUserCount(orgId, CommConstant.PERSON_REALTY_CONSULTANT);
238
+                Integer selectUserCount = taPersonMapper.selectUserCount(orgId);
239 239
 
240 240
                 // 注册数
241
-                Integer selectRegisteredCount = taPersonMapper.selectRegisteredCount(orgId, CommConstant.PERSON_REALTY_CONSULTANT);
241
+                Integer selectRegisteredCount = taPersonMapper.selectRegisteredCount(orgId);
242 242
                 Map<String, Object> userMap = new HashMap<>();
243 243
                 userMap.put("pvNum", selectUserCount);
244 244
                 userMap.put("registeredCount", selectRegisteredCount);
@@ -284,7 +284,7 @@ public class StatisticalServiceImpl implements IStatisticalService {
284 284
     public ResponseBean selectUserCount(Integer orgId) {
285 285
         ResponseBean responseBean = new ResponseBean();
286 286
         // 总用户数
287
-        Integer selectUserCount = taPersonMapper.selectUserCount(orgId, CommConstant.PERSON_REALTY_CONSULTANT);
287
+        Integer selectUserCount = taPersonMapper.selectUserCount(orgId);
288 288
         Map<String, Object> map = new HashMap<>();
289 289
         map.put("selectUserCount", selectUserCount);
290 290
         responseBean.addSuccess(map);
@@ -295,7 +295,7 @@ public class StatisticalServiceImpl implements IStatisticalService {
295 295
     public ResponseBean selectRegisteredCount(Integer orgId) {
296 296
         ResponseBean responseBean = new ResponseBean();
297 297
         // 注册数
298
-        Integer selectRegisteredCount = taPersonMapper.selectRegisteredCount(orgId, CommConstant.PERSON_REALTY_CONSULTANT);
298
+        Integer selectRegisteredCount = taPersonMapper.selectRegisteredCount(orgId);
299 299
         Map<String, Object> map = new HashMap<>();
300 300
         map.put("selectRegisteredCount", selectRegisteredCount);
301 301
         responseBean.addSuccess(map);
@@ -319,8 +319,8 @@ public class StatisticalServiceImpl implements IStatisticalService {
319 319
 
320 320
         // 性别比例
321 321
         // 1 男 2 女
322
-        Integer selectSexMale = taPersonMapper.selectSexUser(orgId, CommConstant.PERSON_REALTY_CONSULTANT, CommConstant.SEX_MALE);
323
-        Integer selectSexFemale = taPersonMapper.selectSexUser(orgId, CommConstant.PERSON_REALTY_CONSULTANT, CommConstant.SEX_FEMALE);
322
+        Integer selectSexMale = taPersonMapper.selectSexUser(orgId, CommConstant.SEX_MALE);
323
+        Integer selectSexFemale = taPersonMapper.selectSexUser(orgId, CommConstant.SEX_FEMALE);
324 324
         Map<String, Object> selectSexMaleMap = new HashMap<>();
325 325
         selectSexMaleMap.put("name", "男");
326 326
         selectSexMaleMap.put("value", selectSexMale);
@@ -342,7 +342,7 @@ public class StatisticalServiceImpl implements IStatisticalService {
342 342
         ResponseBean responseBean = new ResponseBean();
343 343
 
344 344
         // 城市比例
345
-        List<Map<String, Object>> selectCityUser = taPersonMapper.selectCityUser(orgId, CommConstant.PERSON_REALTY_CONSULTANT);
345
+        List<Map<String, Object>> selectCityUser = taPersonMapper.selectCityUser(orgId);
346 346
         Map<String, Object> map = new HashMap<>();
347 347
         map.put("selectCityUser", selectCityUser);
348 348
         responseBean.addSuccess(map);

+ 1
- 1
src/main/java/com/huiju/estateagents/service/impl/TaRecommendCustomerServiceImpl.java Ver arquivo

@@ -398,7 +398,7 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
398 398
              */
399 399
 
400 400
             // 公客
401
-            IPage<TaRecommendCustomer>page = new Page<>(pageNumber,pageSize);
401
+            IPage<TaPerson>page = new Page<>(pageNumber,pageSize);
402 402
             return taRecommendCustomerMapper.getPublicCustomerList(page, building,name, tel,  entryType, verifyStatus, sex, orgId,consultTel);
403 403
         } else {
404 404
             // 私客

+ 11
- 12
src/main/resources/mapper/TaPersonMapper.xml Ver arquivo

@@ -157,7 +157,7 @@ FROM
157 157
         FROM
158 158
         ta_person tp
159 159
         where tp.org_id = #{org} AND
160
-          ifnull(tp.person_type, '') != #{personType}
160
+        tp.person_type IN ('customer','drift','estate agent')
161 161
 
162 162
         <if test="startDate != null or endDate != null">
163 163
             AND  tp.create_date BETWEEN #{startDate} and #{endDate}
@@ -196,7 +196,7 @@ FROM
196 196
             FROM
197 197
               ta_person tp
198 198
             INNER JOIN ta_person_visit_record tpvr ON tp.person_id = tpvr.person_id
199
-            where tp.org_id = #{org} AND ifnull(tp.person_type, '') != #{personType}
199
+            where tp.org_id = #{org} AND tp.person_type IN ('customer','drift','estate agent')
200 200
             <if test="buildingId != null and buildingId != ''">
201 201
                 and tpvr.building_id = #{buildingId}
202 202
             </if>
@@ -254,7 +254,7 @@ FROM
254 254
              LEFT JOIN
255 255
             ( SELECT *, MAX(visit_time) as max_visit_time FROM ta_person_visit_record GROUP BY  person_id  ) as tpvr
256 256
             ON tp.person_id = tpvr.person_id
257
-             where tp.org_id = #{org} AND ifnull(tp.person_type, '') != #{personType}
257
+             where tp.org_id = #{org} AND tp.person_type IN ('customer','drift','estate agent')
258 258
              GROUP BY DATE_FORMAT( tpvr.max_visit_time , '%Y-%m-%d' )
259 259
         ) AS temp ON
260 260
         <if test="dateType == 'month'.toString()">
@@ -297,7 +297,7 @@ FROM
297 297
                         tp.create_date as create_date
298 298
                     FROM
299 299
                       ta_person tp
300
-                    where ifnull(tp.person_type, '') != #{personType} and tp.org_id = #{orgId}
300
+                    where tp.person_type IN ('customer','drift','estate agent') and tp.org_id = #{orgId}
301 301
                     and tp.phone is NOT NULL
302 302
                     <if test="startDate != null or endDate != null">
303 303
                         AND tp.create_date BETWEEN #{startDate} and #{endDate}
@@ -335,7 +335,7 @@ FROM
335 335
                     tp.create_date as create_date
336 336
                 FROM
337 337
                  ta_person tp
338
-                where ifnull(tp.person_type, '') != #{personType} and tp.org_id = #{orgId}
338
+                where tp.person_type IN ('customer','drift','estate agent') and tp.org_id = #{orgId}
339 339
                 <if test="startDate != null or endDate != null">
340 340
                     AND tp.create_date BETWEEN #{startDate} and #{endDate}
341 341
                 </if>
@@ -355,8 +355,7 @@ FROM
355 355
     <select id="selectUserSourcePie" resultType="integer">
356 356
         select count(1)
357 357
         FROM ta_person
358
-        WHERE org_id = #{org} AND
359
-          ifnull(person_type, '') != #{personType}
358
+        WHERE org_id = #{org} AND person_type IN ('customer','drift','estate agent')
360 359
         <if test="recommendPersonType != null and recommendPersonType != ''">
361 360
             and recommend_person_type = #{recommendPersonType}
362 361
         </if>
@@ -373,7 +372,7 @@ FROM
373 372
             ON tps.from_code = tpfs.from_code
374 373
             WHERE tpfs.from_code = tpf.from_code and tps.phone is NOT NULL
375 374
             AND tps.org_id = #{org}
376
-            and ifnull(tps.person_type, '') != #{personType}
375
+            and tps.person_type IN ('customer','drift','estate agent')
377 376
             <if test="startDate != null or endDate != null">
378 377
                 and tps.create_date BETWEEN #{startDate} and #{endDate}
379 378
             </if>
@@ -389,7 +388,7 @@ FROM
389 388
             ON tps.from_code = tpfs.from_code
390 389
             WHERE tpfs.from_code = tpf.from_code
391 390
             AND tps.org_id = #{org}
392
-            and ifnull(tps.person_type, '') != #{personType}
391
+            and tps.person_type IN ('customer','drift','estate agent')
393 392
             <if test="startDate != null or endDate != null">
394 393
                 and tps.create_date BETWEEN #{startDate} and #{endDate}
395 394
             </if>
@@ -401,7 +400,7 @@ FROM
401 400
         FROM td_person_from tpf
402 401
         LEFT JOIN ta_person tp
403 402
         ON tp.from_code = tpf.from_code
404
-        where tp.org_id = #{org} AND ifnull(tp.person_type, '') != #{personType}
403
+        where tp.org_id = #{org} AND tp.person_type IN ('customer','drift','estate agent')
405 404
         GROUP BY tpf.from_code
406 405
     </select>
407 406
 
@@ -445,7 +444,7 @@ FROM
445 444
             ON tps.from_code = tpfs.from_code
446 445
             WHERE tpfs.from_code = tps.from_code
447 446
             AND tps.org_id = #{org}
448
-            and ifnull(tps.person_type, '') != 'Realty Consultant'
447
+            and tps.person_type IN ('customer','drift','estate agent')
449 448
             AND tps.create_date BETWEEN #{startDate} AND #{endDate}
450 449
 
451 450
             GROUP BY tpfs.from_code
@@ -463,7 +462,7 @@ FROM
463 462
             ON tps.from_code = tpfs.from_code
464 463
             WHERE tpfs.from_code = tps.from_code
465 464
                 AND tps.org_id = #{org}
466
-                and ifnull(tps.person_type, '') != 'Realty Consultant'
465
+                and tps.person_type IN ('customer','drift','estate agent')
467 466
                 AND tps.create_date BETWEEN #{startDate} AND #{endDate}
468 467
                 and tps.phone is not null
469 468
             GROUP BY tpfs.from_code

+ 29
- 5
src/main/resources/mapper/TaRecommendCustomerMapper.xml Ver arquivo

@@ -203,11 +203,35 @@ FROM
203 203
 	WHERE a.customer_id = #{customerId}
204 204
     </select>
205 205
 
206
-    <select id="getPublicCustomerList" resultType="com.huiju.estateagents.entity.TaRecommendCustomer">
207
-        select * from
208
-        ta_recommend_customer ta
209
-        WHERE (ta.realty_consultant is NULL OR ta.realty_consultant = '')
210
-        order by ta.create_date desc
206
+    <select id="getPublicCustomerList" resultType="com.huiju.estateagents.entity.TaPerson">
207
+        SELECT
208
+                b.*
209
+                FROM
210
+                ta_person b
211
+               <where>
212
+                    b.status > 0
213
+                   AND IFNULL(b.person_type, '') in ('estate agent', 'customer')
214
+                    <if test="name != null and name !=''">
215
+                        and b.nickname like CONCAT('%',#{name}, '%')
216
+                    </if>
217
+                    <if test="tel != null and tel!=''">
218
+                        and b.phone like CONCAT('%',#{tel}, '%')
219
+                    </if>
220
+                    <if test="entryType != null and entryType !=''">
221
+                        and b.entry_type = #{entryType}
222
+                    </if>
223
+                    <if test="sex != null and sex !=''">
224
+                        and b.sex = #{sex}
225
+                    </if>
226
+                    <if test="orgId != null">
227
+                       and b.org_id = #{orgId}
228
+                    </if>
229
+                    <if test="consultTel != null and consultTel !=''">
230
+                        and b.tel like CONCAT('%',#{consultTel}, '%')
231
+                    </if>
232
+                    and NOT EXISTS ( select * from ta_recommend_customer a where a.recommend_person = b.person_id)
233
+                </where>
234
+               order by b.create_date desc
211 235
     </select>
212 236
 
213 237
     <select id="getRecCustomerExport" resultType="com.huiju.estateagents.excel.ExcelRecommendCustomer">