Browse Source

* bug fix

顾绍勇 5 years ago
parent
commit
5f58c31f0d
1 changed files with 14 additions and 5 deletions
  1. 14
    5
      src/main/resources/mapper/TaRecommendCustomerMapper.xml

+ 14
- 5
src/main/resources/mapper/TaRecommendCustomerMapper.xml View File

176
         <if test="orgId != null">
176
         <if test="orgId != null">
177
             and p.org_id = #{orgId}
177
             and p.org_id = #{orgId}
178
         </if>
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
         LEFT JOIN td_wx_dict w ON p.scene_id = w.scene_id
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
         LEFT JOIN ta_building t2 ON a.building_id = t2.building_id
184
         LEFT JOIN ta_building t2 ON a.building_id = t2.building_id
182
         <where>
185
         <where>
183
             a.status > 0
186
             a.status > 0
254
         FROM
257
         FROM
255
         ta_recommend_customer t
258
         ta_recommend_customer t
256
         LEFT JOIN ta_building t2 ON t.building_id = t2.building_id
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
         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
         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
         LEFT JOIN td_wx_dict t5 ON t4.scene_id = t5.scene_id
263
         LEFT JOIN td_wx_dict t5 ON t4.scene_id = t5.scene_id
260
         <where>
264
         <where>
573
         FROM
577
         FROM
574
         ta_recommend_customer t
578
         ta_recommend_customer t
575
         LEFT JOIN ta_building t2 ON t.building_id = t2.building_id
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
         LEFT JOIN ta_person_from_record t4 ON t.person_id = t4.person_id AND t4.is_first_time = 1 AND t4.org_id =
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
         #{orgId}
583
         #{orgId}
579
         LEFT JOIN td_wx_dict t5 ON t4.scene_id = t5.scene_id
584
         LEFT JOIN td_wx_dict t5 ON t4.scene_id = t5.scene_id
695
         LEFT JOIN ta_person b ON a.realty_consultant = b.person_id
700
         LEFT JOIN ta_person b ON a.realty_consultant = b.person_id
696
         LEFT JOIN ta_user d on d.user_id = a.realty_consultant
701
         LEFT JOIN ta_user d on d.user_id = a.realty_consultant
697
         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}
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
         LEFT JOIN td_wx_dict w ON p.scene_id = w.scene_id
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
         left JOIN (select sum(points_amount) as points,person_id from ta_points_records where org_id = #{orgId} GROUP BY
710
         left JOIN (select sum(points_amount) as points,person_id from ta_points_records where org_id = #{orgId} GROUP BY
702
         person_id) s on a.person_id = s.person_id
711
         person_id) s on a.person_id = s.person_id
703
         left join (select sum(t.intention) as intention,t.person_id From ta_person_intention_record t where t.org_id =
712
         left join (select sum(t.intention) as intention,t.person_id From ta_person_intention_record t where t.org_id =