|
@@ -176,8 +176,11 @@ FROM
|
176
|
176
|
<if test="orgId != null">
|
177
|
177
|
and p.org_id = #{orgId}
|
178
|
178
|
</if>
|
179
|
|
- LEFT JOIN ta_person c on p.share_person_id = c.person_id
|
|
179
|
+ -- LEFT JOIN ta_person c on p.share_person_id = c.person_id
|
|
180
|
+ -- LEFT JOIN td_wx_dict w ON p.scene_id = w.scene_id
|
180
|
181
|
LEFT JOIN td_wx_dict w ON p.scene_id = w.scene_id
|
|
182
|
+ LEFT JOIN ta_person p2 ON a.person_id = p2.person_id
|
|
183
|
+ LEFT JOIN ta_person c ON p2.recommend_person = c.person_id
|
181
|
184
|
LEFT JOIN ta_building t2 ON a.building_id = t2.building_id
|
182
|
185
|
<where>
|
183
|
186
|
a.status > 0
|
|
@@ -254,7 +257,8 @@ FROM
|
254
|
257
|
FROM
|
255
|
258
|
ta_recommend_customer t
|
256
|
259
|
LEFT JOIN ta_building t2 ON t.building_id = t2.building_id
|
257
|
|
- LEFT JOIN ta_person t3 ON t.recommend_person = t3.person_id
|
|
260
|
+ LEFT JOIN ta_person t6 ON t.person_id = t6.person_id
|
|
261
|
+ LEFT JOIN ta_person t3 ON t6.recommend_person = t3.person_id
|
258
|
262
|
LEFT JOIN ta_person_from_record t4 ON t.person_id = t4.person_id AND t4.is_first_time = 1 AND t4.org_id = #{orgId}
|
259
|
263
|
LEFT JOIN td_wx_dict t5 ON t4.scene_id = t5.scene_id
|
260
|
264
|
<where>
|
|
@@ -573,7 +577,8 @@ FROM
|
573
|
577
|
FROM
|
574
|
578
|
ta_recommend_customer t
|
575
|
579
|
LEFT JOIN ta_building t2 ON t.building_id = t2.building_id
|
576
|
|
- LEFT JOIN ta_person t3 ON t.recommend_person = t3.person_id
|
|
580
|
+ LEFT JOIN ta_person t7 ON t.person_id = t7.person_id
|
|
581
|
+ LEFT JOIN ta_person t3 ON t7.recommend_person = t3.person_id
|
577
|
582
|
LEFT JOIN ta_person_from_record t4 ON t.person_id = t4.person_id AND t4.is_first_time = 1 AND t4.org_id =
|
578
|
583
|
#{orgId}
|
579
|
584
|
LEFT JOIN td_wx_dict t5 ON t4.scene_id = t5.scene_id
|
|
@@ -695,9 +700,13 @@ FROM
|
695
|
700
|
LEFT JOIN ta_person b ON a.realty_consultant = b.person_id
|
696
|
701
|
LEFT JOIN ta_user d on d.user_id = a.realty_consultant
|
697
|
702
|
LEFT JOIN ta_person_from_record p ON a.person_id = p.person_id AND p.is_first_time = 1 and p.org_id = #{orgId}
|
698
|
|
- LEFT JOIN ta_person c ON p.share_person_id = c.person_id
|
699
|
|
- left join ta_building t on a.building_id = t.building_id
|
700
|
703
|
LEFT JOIN td_wx_dict w ON p.scene_id = w.scene_id
|
|
704
|
+ LEFT JOIN ta_person p2 ON a.person_id = p2.person_id
|
|
705
|
+ LEFT JOIN ta_person c ON p2.recommend_person = c.person_id
|
|
706
|
+ left join ta_building t on a.building_id = t.building_id
|
|
707
|
+ -- LEFT JOIN ta_person c ON p.share_person_id = c.person_id
|
|
708
|
+ -- left join ta_building t on a.building_id = t.building_id
|
|
709
|
+ -- LEFT JOIN td_wx_dict w ON p.scene_id = w.scene_id
|
701
|
710
|
left JOIN (select sum(points_amount) as points,person_id from ta_points_records where org_id = #{orgId} GROUP BY
|
702
|
711
|
person_id) s on a.person_id = s.person_id
|
703
|
712
|
left join (select sum(t.intention) as intention,t.person_id From ta_person_intention_record t where t.org_id =
|