weichaochao 5 년 전
부모
커밋
aad505b535

+ 1
- 1
src/main/resources/mapper/TaPersonBuildingMapper.xml 파일 보기

@@ -8,7 +8,7 @@
8 8
         left join ta_person b on t.user_id = b.user_id
9 9
         left join ta_share_count c on b.person_id = c.person_id
10 10
         LEFT JOIN ta_building d on a.building_id = d.building_id
11
-        where t.org_id = #{orgId}
11
+        where t.org_id = #{orgId} and t.is_consultant = 1
12 12
             <if test="buildingId != null and buildingId != ''">
13 13
               and a.building_id = #{buildingId}
14 14
             </if>

+ 2
- 2
src/main/resources/mapper/TaRecommendCustomerMapper.xml 파일 보기

@@ -613,11 +613,11 @@ FROM
613 613
         if(a.sex = 1, '男', if(a.sex = 2, '女', '未知')) as sex,
614 614
         CASE
615 615
         WHEN b.NAME IS NULL THEN
616
-        c.NAME ELSE b.NAME
616
+        d.user_name ELSE b.NAME
617 617
         END AS consultantName,
618 618
         CASE
619 619
         WHEN b.tel IS NULL THEN
620
-        c.tel ELSE b.tel
620
+        d.phone ELSE b.tel
621 621
         END AS consultTel,
622 622
         t.building_name
623 623
         FROM

+ 5
- 4
src/main/resources/mapper/TaShareCountMapper.xml 파일 보기

@@ -31,7 +31,7 @@
31 31
         from ta_share_count t
32 32
         left join ta_building_dynamic a on t.be_share = a.dynamic_id and t.tagert_type = 'activity'
33 33
         left join ta_help_activity b on t.be_share = b.help_activity_id and t.tagert_type = 'help'
34
-        left join ta_share_activity c on t.be_share = c.share_id and t.tagert_type = 'group'
34
+        left join ta_share_activity c on t.be_share = c.group_activity_id and t.tagert_type = 'group'
35 35
         LEFT JOIN ta_drainage d on t.be_share = d.drainage_id and t.tagert_type = 'h5'
36 36
         left join ta_building e on t.be_share = e.building_id and t.tagert_type = 'project'
37 37
         LEFT JOIN ta_news f on t.be_share = f.news_id and t.tagert_type = 'news'
@@ -67,8 +67,8 @@
67 67
                 when a.`name` != null || a.`name` != '' then a.`name`
68 68
                 else '空'
69 69
                 end as shareTitle,
70
-                        a.phone as personPhone,
71
-                        a.nickName as personName,
70
+                        z.phone as personPhone,
71
+                        z.nickName as personName,
72 72
                         t.create_date
73 73
 
74 74
         FROM
@@ -81,7 +81,8 @@
81 81
                 left join ta_building e on t.target_id = e.building_id and t.target_type = 'building_share'
82 82
                 LEFT JOIN ta_news f on t.target_id = f.news_id and t.target_type = 'news_share'
83 83
 
84
-        LEFT JOIN ta_person a ON t.person_id = a.person_id and t.target_type = 'card_share'
84
+        LEFT JOIN ta_person a ON t.share_person = a.person_id or t.share_person = a.user_id
85
+        LEFT JOIN ta_person z ON t.person_id = z.person_id
85 86
         WHERE
86 87
             (t.share_person = (select user_id from ta_person where person_id = #{personId}) or t.share_person = #{personId})
87 88
         AND t.org_id = #{orgId}