胡轶钦 5 years ago
parent
commit
b17366731c
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      src/main/resources/mapper/TaRecommendCustomerMapper.xml

+ 3
- 2
src/main/resources/mapper/TaRecommendCustomerMapper.xml View File

150
         SELECT
150
         SELECT
151
         a.*,
151
         a.*,
152
         a.customer_id as customerId,
152
         a.customer_id as customerId,
153
-        b.name as consultantName,
154
-        b.tel as consultTel,
153
+        IFNULL(b.name,d.user_name) as consultantName,
154
+        IFNULL(b.tel,d.phone) as consultTel,
155
         c.nickname as recommendName,
155
         c.nickname as recommendName,
156
         c.tel as recommendTel,
156
         c.tel as recommendTel,
157
         (select if(ifnull(tpp.name, '') != '',tpp.name, tpp.nickname) from ta_share_person_from tspf left join ta_person tpp on  tspf.share_person = tpp.person_id where tspf.is_first_time = 1 and a.person_id = tspf.person_id) as sharePersonName
157
         (select if(ifnull(tpp.name, '') != '',tpp.name, tpp.nickname) from ta_share_person_from tspf left join ta_person tpp on  tspf.share_person = tpp.person_id where tspf.is_first_time = 1 and a.person_id = tspf.person_id) as sharePersonName
159
         ta_recommend_customer a
159
         ta_recommend_customer a
160
         LEFT JOIN ta_person b ON a.realty_consultant = b.person_id
160
         LEFT JOIN ta_person b ON a.realty_consultant = b.person_id
161
         LEFT JOIN ta_person c on a.recommend_person = c.person_id
161
         LEFT JOIN ta_person c on a.recommend_person = c.person_id
162
+        LEFT JOIN ta_user d on d.user_id = b.user_id
162
         <where>
163
         <where>
163
             a.status > 0
164
             a.status > 0
164
             and a.realty_consultant is not null
165
             and a.realty_consultant is not null