|
@@ -862,8 +862,19 @@ FROM
|
862
|
862
|
intention DESC
|
863
|
863
|
</select>
|
864
|
864
|
|
865
|
|
- <select id="getCustomersIRecommended" resultType="com.yunzhi.marketing.entity.TaRecommendCustomer">
|
866
|
|
- select a.*,b.avatarurl from ta_recommend_customer a left join ta_person b on a.person_id = b.person_id
|
|
865
|
+ <select id="getCustomersIRecommended" resultType="com.yunzhi.marketing.po.TaRecommendCustomerPO">
|
|
866
|
+ select a.customer_id AS id,
|
|
867
|
+ a.NAME,
|
|
868
|
+ a.phone,
|
|
869
|
+ a.picture,
|
|
870
|
+ a.sex,
|
|
871
|
+ "customer" AS type,
|
|
872
|
+ a.building_id AS buildingId,
|
|
873
|
+ a.realty_consultant AS consultant,
|
|
874
|
+ a.STATUS AS customerStatus,
|
|
875
|
+ NULL AS channelStatus,
|
|
876
|
+ b.avatarurl
|
|
877
|
+ from ta_recommend_customer a left join ta_person b on a.person_id = b.person_id
|
867
|
878
|
where a.recommend_person = #{customerId}
|
868
|
879
|
and a.status >= #{status}
|
869
|
880
|
and a.org_id = #{orgId}
|
|
@@ -873,6 +884,31 @@ FROM
|
873
|
884
|
#{personBuilding.buildingId}
|
874
|
885
|
</foreach>
|
875
|
886
|
</if>
|
|
887
|
+ union all
|
|
888
|
+ SELECT
|
|
889
|
+ a.channel_customer_id AS id,
|
|
890
|
+ a.NAME,
|
|
891
|
+ a.phone,
|
|
892
|
+ a.picture,
|
|
893
|
+ a.sex,
|
|
894
|
+ "report" AS type,
|
|
895
|
+ NULL AS buildingId,
|
|
896
|
+ NULL AS consultant,
|
|
897
|
+ NULL AS customerStatus,
|
|
898
|
+ a.STATUS AS channelStatus,
|
|
899
|
+ b.avatarurl
|
|
900
|
+ FROM
|
|
901
|
+ xlk_channel_customer a
|
|
902
|
+ LEFT JOIN ta_person b ON a.person_id = b.person_id
|
|
903
|
+ where a.recommend_person = #{customerId}
|
|
904
|
+ and a.status = #{status}
|
|
905
|
+ and a.org_id = #{orgId}
|
|
906
|
+ <if test="personBuildingList != null and personBuildingList.size > 0">
|
|
907
|
+ AND a.building_id in
|
|
908
|
+ <foreach collection="personBuildingList" item="personBuilding" open="(" close=")" separator=",">
|
|
909
|
+ #{personBuilding.buildingId}
|
|
910
|
+ </foreach>
|
|
911
|
+ </if>
|
876
|
912
|
</select>
|
877
|
913
|
|
878
|
914
|
<select id="getCustomerListOfConsultant" resultType="com.yunzhi.marketing.entity.TaRecommendCustomer">
|