|
@@ -179,8 +179,11 @@ FROM
|
179
|
179
|
<if test="orgId != null">
|
180
|
180
|
and p.org_id = #{orgId}
|
181
|
181
|
</if>
|
182
|
|
- LEFT JOIN ta_person c on p.share_person_id = c.person_id
|
|
182
|
+ -- LEFT JOIN ta_person c on p.share_person_id = c.person_id
|
|
183
|
+ -- LEFT JOIN td_wx_dict w ON p.scene_id = w.scene_id
|
183
|
184
|
LEFT JOIN td_wx_dict w ON p.scene_id = w.scene_id
|
|
185
|
+ LEFT JOIN ta_person p2 ON a.person_id = p2.person_id
|
|
186
|
+ LEFT JOIN ta_person c ON p2.recommend_person = c.person_id
|
184
|
187
|
LEFT JOIN ta_building t2 ON a.building_id = t2.building_id
|
185
|
188
|
<where>
|
186
|
189
|
a.status > 0
|
|
@@ -257,7 +260,8 @@ FROM
|
257
|
260
|
FROM
|
258
|
261
|
ta_recommend_customer t
|
259
|
262
|
LEFT JOIN ta_building t2 ON t.building_id = t2.building_id
|
260
|
|
- LEFT JOIN ta_person t3 ON t.recommend_person = t3.person_id
|
|
263
|
+ LEFT JOIN ta_person t6 ON t.person_id = t6.person_id
|
|
264
|
+ LEFT JOIN ta_person t3 ON t6.recommend_person = t3.person_id
|
261
|
265
|
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}
|
262
|
266
|
LEFT JOIN td_wx_dict t5 ON t4.scene_id = t5.scene_id
|
263
|
267
|
<where>
|
|
@@ -585,7 +589,8 @@ FROM
|
585
|
589
|
FROM
|
586
|
590
|
ta_recommend_customer t
|
587
|
591
|
LEFT JOIN ta_building t2 ON t.building_id = t2.building_id
|
588
|
|
- LEFT JOIN ta_person t3 ON t.recommend_person = t3.person_id
|
|
592
|
+ LEFT JOIN ta_person t7 ON t.person_id = t7.person_id
|
|
593
|
+ LEFT JOIN ta_person t3 ON t7.recommend_person = t3.person_id
|
589
|
594
|
LEFT JOIN ta_person_from_record t4 ON t.person_id = t4.person_id AND t4.is_first_time = 1 AND t4.org_id =
|
590
|
595
|
#{orgId}
|
591
|
596
|
LEFT JOIN td_wx_dict t5 ON t4.scene_id = t5.scene_id
|
|
@@ -707,9 +712,13 @@ FROM
|
707
|
712
|
LEFT JOIN ta_person b ON a.realty_consultant = b.person_id
|
708
|
713
|
LEFT JOIN ta_user d on d.user_id = a.realty_consultant
|
709
|
714
|
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}
|
710
|
|
- LEFT JOIN ta_person c ON p.share_person_id = c.person_id
|
711
|
|
- left join ta_building t on a.building_id = t.building_id
|
712
|
715
|
LEFT JOIN td_wx_dict w ON p.scene_id = w.scene_id
|
|
716
|
+ LEFT JOIN ta_person p2 ON a.person_id = p2.person_id
|
|
717
|
+ LEFT JOIN ta_person c ON p2.recommend_person = c.person_id
|
|
718
|
+ left join ta_building t on a.building_id = t.building_id
|
|
719
|
+ -- LEFT JOIN ta_person c ON p.share_person_id = c.person_id
|
|
720
|
+ -- left join ta_building t on a.building_id = t.building_id
|
|
721
|
+ -- LEFT JOIN td_wx_dict w ON p.scene_id = w.scene_id
|
713
|
722
|
left JOIN (select sum(points_amount) as points,person_id from ta_points_records where org_id = #{orgId} GROUP BY
|
714
|
723
|
person_id) s on a.person_id = s.person_id
|
715
|
724
|
left join (select sum(t.intention) as intention,t.person_id From ta_person_intention_record t where t.org_id =
|