Browse Source

Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/estateagents into dev

张延森 5 years ago
parent
commit
e6c6dcdb87

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

576
         FROM
576
         FROM
577
         (
577
         (
578
             SELECT
578
             SELECT
579
-            DATE_FORMAT( DATE_SUB( now( ), INTERVAL a.rownum DAY ), '%Y-%m-%d' ) AS date
579
+            DATE_FORMAT( DATE_SUB( #{endDate}, INTERVAL a.rownum DAY ), '%Y-%m-%d' ) AS date
580
             FROM
580
             FROM
581
             sequence a
581
             sequence a
582
             WHERE
582
             WHERE
659
         FROM
659
         FROM
660
         (
660
         (
661
         SELECT
661
         SELECT
662
-        DATE_FORMAT( DATE_SUB( now( ), INTERVAL a.rownum DAY ), '%Y-%m-%d' ) AS date
662
+        DATE_FORMAT( DATE_SUB( #{endDate}, INTERVAL a.rownum DAY ), '%Y-%m-%d' ) AS date
663
         FROM
663
         FROM
664
         sequence a
664
         sequence a
665
         WHERE
665
         WHERE

+ 72
- 40
src/main/resources/mapper/statistic/TaActivityStaticMapper.xml View File

1649
         </if>
1649
         </if>
1650
         ) as person
1650
         ) as person
1651
         LEFT JOIN (
1651
         LEFT JOIN (
1652
-        SELECT count(*) as visitPersonNum,t.share_person as person_id
1652
+        SELECT count(*) as visitPersonNum, ifnull(a.person_id,b.person_id) as person_id
1653
         FROM ta_share_person_from t
1653
         FROM ta_share_person_from t
1654
+        left join ta_person a on t.share_person = a.person_id
1655
+        left join ta_person b on t.share_person = b.user_id
1654
         where t.target_type in ('dynamic_share','h5_share','help_share','live_share', 'group_share') and t.org_id =
1656
         where t.target_type in ('dynamic_share','h5_share','help_share','live_share', 'group_share') and t.org_id =
1655
         #{orgId}
1657
         #{orgId}
1656
         <if test="personId != null and personId != ''">
1658
         <if test="personId != null and personId != ''">
1741
         </if>
1743
         </if>
1742
         ) as person
1744
         ) as person
1743
         LEFT JOIN (
1745
         LEFT JOIN (
1744
-        SELECT count(*) as visitPersonNum,t.share_person as person_id
1746
+        SELECT count(*) as visitPersonNum, ifnull(a.person_id,b.person_id) as person_id
1745
         FROM ta_share_person_from t
1747
         FROM ta_share_person_from t
1748
+        left join ta_person a on t.share_person = a.person_id
1749
+        left join ta_person b on t.share_person = b.user_id
1746
         where t.target_type in ('dynamic_share','h5_share','help_share','live_share', 'group_share') and t.org_id =
1750
         where t.target_type in ('dynamic_share','h5_share','help_share','live_share', 'group_share') and t.org_id =
1747
         #{orgId}
1751
         #{orgId}
1748
         <if test="personId != null and personId != ''">
1752
         <if test="personId != null and personId != ''">
1788
             and t.target_type = concat(#{activityType}, '_share')
1792
             and t.target_type = concat(#{activityType}, '_share')
1789
         </if>
1793
         </if>
1790
         <if test="personFrom != null and personFrom != ''">
1794
         <if test="personFrom != null and personFrom != ''">
1791
-            and b.scene_id = #{personFrom}
1795
+            and b.scene_type = #{personFrom}
1792
         </if>
1796
         </if>
1793
         <if test="buildingId != null and buildingId != ''">
1797
         <if test="buildingId != null and buildingId != ''">
1794
             and c.building_id = #{buildingId}
1798
             and c.building_id = #{buildingId}
1827
             and t.target_type = concat(#{activityType}, '_share')
1831
             and t.target_type = concat(#{activityType}, '_share')
1828
         </if>
1832
         </if>
1829
         <if test="personFrom != null and personFrom != ''">
1833
         <if test="personFrom != null and personFrom != ''">
1830
-            and b.scene_id = #{personFrom}
1834
+            and b.scene_type = #{personFrom}
1831
         </if>
1835
         </if>
1832
         <if test="buildingId != null and buildingId != ''">
1836
         <if test="buildingId != null and buildingId != ''">
1833
             and c.building_id = #{buildingId}
1837
             and c.building_id = #{buildingId}
1840
         a.nickname, a.phone,
1844
         a.nickname, a.phone,
1841
         if(a.gender = '1', '男', if(a.gender = '2', '女','未知') ) as gender,
1845
         if(a.gender = '1', '男', if(a.gender = '2', '女','未知') ) as gender,
1842
         a.province,
1846
         a.province,
1843
-        b1.scene_name as personFrom,
1844
-        d.user_name as realtyConsultant,
1845
-        d.phone as realtyConsultantPhone,
1847
+        b1.scene_alias as personFrom,
1848
+        GROUP_CONCAT(d.user_name) as realtyConsultant,
1849
+        GROUP_CONCAT(d.phone) as realtyConsultantPhone,
1850
+        e.nickname as sharePersonName,
1851
+        e.phone as sharePersonPhone,
1846
         t.visit_time as visitDate
1852
         t.visit_time as visitDate
1847
         From (
1853
         From (
1848
         SELECT
1854
         SELECT
1849
-        t.person_id, t.visit_time
1855
+        t.person_id, t.visit_time, t.share_person_id
1850
         FROM
1856
         FROM
1851
         ta_person_visit_record t
1857
         ta_person_visit_record t
1852
         WHERE
1858
         WHERE
1861
             and t.target_id = #{activityId}
1867
             and t.target_id = #{activityId}
1862
         </if>
1868
         </if>
1863
         <if test="activityType != null and activityType != ''">
1869
         <if test="activityType != null and activityType != ''">
1864
-            and t.target_type = #{activityType}
1870
+            and (case when #{activityType} = 'activity' then t.target_type = 'dynamic' else t.target_type = #{activityType}
1871
+            end)
1865
         </if>
1872
         </if>
1866
         <if test="buildingId != null and buildingId != ''">
1873
         <if test="buildingId != null and buildingId != ''">
1867
             and t.building_id = #{buildingId}
1874
             and t.building_id = #{buildingId}
1875
         left join td_wx_dict b1 on b.scene_id = b1.scene_id
1882
         left join td_wx_dict b1 on b.scene_id = b1.scene_id
1876
         LEFT JOIN ta_recommend_customer c on c.person_id = t.person_id
1883
         LEFT JOIN ta_recommend_customer c on c.person_id = t.person_id
1877
         left join ta_user d on c.realty_consultant = d.user_id
1884
         left join ta_user d on c.realty_consultant = d.user_id
1885
+        left join ta_person e on t.share_person_id = e.person_id
1878
         <where>
1886
         <where>
1879
             <if test="personFrom != null and personFrom != ''">
1887
             <if test="personFrom != null and personFrom != ''">
1880
-                and b.scene_id = #{personFrom}
1888
+                and b.scene_type = #{personFrom}
1881
             </if>
1889
             </if>
1882
             <if test="province != null and province != ''">
1890
             <if test="province != null and province != ''">
1883
-                and a.province = #{province}
1891
+                and a.province like concat('%', #{province}, '%')
1884
             </if>
1892
             </if>
1885
             <if test="realtyConsultant != null and realtyConsultant != ''">
1893
             <if test="realtyConsultant != null and realtyConsultant != ''">
1886
-                and d.name = #{realtyConsultant}
1894
+                and d.user_name like concat('%', #{realtyConsultant}, '%')
1887
             </if>
1895
             </if>
1888
             <if test="realtyConsultantPhone != null and realtyConsultantPhone != ''">
1896
             <if test="realtyConsultantPhone != null and realtyConsultantPhone != ''">
1889
-                and d.phone = #{realtyConsultantPhone}
1897
+                and d.phone like concat('%', #{realtyConsultantPhone}, '%')
1890
             </if>
1898
             </if>
1891
         </where>
1899
         </where>
1900
+        group by t.visit_time
1892
         order by t.visit_time desc
1901
         order by t.visit_time desc
1893
     </select>
1902
     </select>
1894
 
1903
 
1897
         a.nickname, a.phone,
1906
         a.nickname, a.phone,
1898
         if(a.gender = '1', '男', if(a.gender = '2', '女','未知') ) as gender,
1907
         if(a.gender = '1', '男', if(a.gender = '2', '女','未知') ) as gender,
1899
         a.province,
1908
         a.province,
1900
-        b1.scene_name as personFrom,
1901
-        d.user_name as realtyConsultant,
1902
-        d.phone as realtyConsultantPhone,
1909
+        b1.scene_alias as personFrom,
1910
+        GROUP_CONCAT(d.user_name) as realtyConsultant,
1911
+        GROUP_CONCAT(d.phone) as realtyConsultantPhone,
1912
+        e.nickname as sharePersonName,
1913
+        e.phone as sharePersonPhone,
1903
         t.visit_time as visitDate
1914
         t.visit_time as visitDate
1904
         From (
1915
         From (
1905
         SELECT
1916
         SELECT
1906
-        t.person_id, t.visit_time
1917
+        t.person_id, t.visit_time, t.share_person_id
1907
         FROM
1918
         FROM
1908
         ta_person_visit_record t
1919
         ta_person_visit_record t
1909
         WHERE
1920
         WHERE
1918
             and t.target_id = #{activityId}
1929
             and t.target_id = #{activityId}
1919
         </if>
1930
         </if>
1920
         <if test="activityType != null and activityType != ''">
1931
         <if test="activityType != null and activityType != ''">
1921
-            and t.target_type = #{activityType}
1932
+            and (case when #{activityType} = 'activity' then t.target_type = 'dynamic' else t.target_type = #{activityType}
1933
+            end)
1922
         </if>
1934
         </if>
1923
         <if test="buildingId != null and buildingId != ''">
1935
         <if test="buildingId != null and buildingId != ''">
1924
             and t.building_id = #{buildingId}
1936
             and t.building_id = #{buildingId}
1932
         left join td_wx_dict b1 on b.scene_id = b1.scene_id
1944
         left join td_wx_dict b1 on b.scene_id = b1.scene_id
1933
         LEFT JOIN ta_recommend_customer c on c.person_id = t.person_id
1945
         LEFT JOIN ta_recommend_customer c on c.person_id = t.person_id
1934
         left join ta_user d on c.realty_consultant = d.user_id
1946
         left join ta_user d on c.realty_consultant = d.user_id
1947
+        left join ta_person e on t.share_person_id = e.person_id
1935
         <where>
1948
         <where>
1936
             <if test="personFrom != null and personFrom != ''">
1949
             <if test="personFrom != null and personFrom != ''">
1937
-                and b.scene_id = #{personFrom}
1950
+                and b.scene_type = #{personFrom}
1938
             </if>
1951
             </if>
1939
             <if test="province != null and province != ''">
1952
             <if test="province != null and province != ''">
1940
-                and a.province = #{province}
1953
+                and a.province like concat('%', #{province}, '%')
1941
             </if>
1954
             </if>
1942
             <if test="realtyConsultant != null and realtyConsultant != ''">
1955
             <if test="realtyConsultant != null and realtyConsultant != ''">
1943
-                and d.name = #{realtyConsultant}
1956
+                and d.user_name like concat('%', #{realtyConsultant}, '%')
1944
             </if>
1957
             </if>
1945
             <if test="realtyConsultantPhone != null and realtyConsultantPhone != ''">
1958
             <if test="realtyConsultantPhone != null and realtyConsultantPhone != ''">
1946
-                and d.phone = #{realtyConsultantPhone}
1959
+                and d.phone like concat('%', #{realtyConsultantPhone}, '%')
1947
             </if>
1960
             </if>
1948
         </where>
1961
         </where>
1962
+        group by t.visit_time
1949
         order by t.visit_time desc
1963
         order by t.visit_time desc
1950
     </select>
1964
     </select>
1951
 
1965
 
1957
         a.province,
1971
         a.province,
1958
         b1.scene_alias as personFrom,
1972
         b1.scene_alias as personFrom,
1959
         GROUP_CONCAT(d.user_name) as realtyConsultant,
1973
         GROUP_CONCAT(d.user_name) as realtyConsultant,
1960
-        d.phone as realtyConsultantPhone,
1974
+        GROUP_CONCAT(d.phone) as realtyConsultantPhone,
1961
         t.create_date as visitDate,
1975
         t.create_date as visitDate,
1962
         ifnull(e.nickName, f.user_name) as sharePersonName,
1976
         ifnull(e.nickName, f.user_name) as sharePersonName,
1963
         t.visitNum
1977
         t.visitNum
1983
             and t.target_id = #{activityId}
1997
             and t.target_id = #{activityId}
1984
         </if>
1998
         </if>
1985
         <if test="activityType != null and activityType != ''">
1999
         <if test="activityType != null and activityType != ''">
1986
-            and t.target_type = #{activityType}
2000
+            and (case when #{activityType} = 'activity' then t.target_type = 'dynamic' else t.target_type = #{activityType}
2001
+            end)
1987
         </if>
2002
         </if>
1988
         <if test="buildingId != null and buildingId != ''">
2003
         <if test="buildingId != null and buildingId != ''">
1989
             and t.building_id = #{buildingId}
2004
             and t.building_id = #{buildingId}
1999
         left join ta_user f on f.user_id = c.recommend_person
2014
         left join ta_user f on f.user_id = c.recommend_person
2000
         <where>
2015
         <where>
2001
             <if test="personFrom != null and personFrom != ''">
2016
             <if test="personFrom != null and personFrom != ''">
2002
-                and b.scene_id = #{personFrom}
2017
+                and b.scene_type = #{personFrom}
2003
             </if>
2018
             </if>
2004
             <if test="province != null and province != ''">
2019
             <if test="province != null and province != ''">
2005
-                and a.province = #{province}
2020
+                and a.province like concat('%', #{province},'%')
2006
             </if>
2021
             </if>
2007
             <if test="realtyConsultant != null and realtyConsultant != ''">
2022
             <if test="realtyConsultant != null and realtyConsultant != ''">
2008
                 and d.user_name like concat('%', #{realtyConsultant},'%')
2023
                 and d.user_name like concat('%', #{realtyConsultant},'%')
2023
         a.province,
2038
         a.province,
2024
         b1.scene_alias as personFrom,
2039
         b1.scene_alias as personFrom,
2025
         GROUP_CONCAT(d.user_name) as realtyConsultant,
2040
         GROUP_CONCAT(d.user_name) as realtyConsultant,
2026
-        d.phone as realtyConsultantPhone,
2041
+        GROUP_CONCAT(d.phone) as realtyConsultantPhone,
2027
         t.create_date as visitDate,
2042
         t.create_date as visitDate,
2028
         ifnull(e.nickName, f.user_name) as sharePersonName,
2043
         ifnull(e.nickName, f.user_name) as sharePersonName,
2029
         t.visitNum
2044
         t.visitNum
2049
             and t.target_id = #{activityId}
2064
             and t.target_id = #{activityId}
2050
         </if>
2065
         </if>
2051
         <if test="activityType != null and activityType != ''">
2066
         <if test="activityType != null and activityType != ''">
2052
-            and t.target_type = #{activityType}
2067
+            and (case when #{activityType} = 'activity' then t.target_type = 'dynamic' else t.target_type = #{activityType}
2068
+            end)
2053
         </if>
2069
         </if>
2054
         <if test="buildingId != null and buildingId != ''">
2070
         <if test="buildingId != null and buildingId != ''">
2055
             and t.building_id = #{buildingId}
2071
             and t.building_id = #{buildingId}
2065
         left join ta_user f on f.user_id = c.recommend_person
2081
         left join ta_user f on f.user_id = c.recommend_person
2066
         <where>
2082
         <where>
2067
             <if test="personFrom != null and personFrom != ''">
2083
             <if test="personFrom != null and personFrom != ''">
2068
-                and b.scene_id = #{personFrom}
2084
+                and b.scene_type = #{personFrom}
2069
             </if>
2085
             </if>
2070
             <if test="province != null and province != ''">
2086
             <if test="province != null and province != ''">
2071
-                and a.province = #{province}
2087
+                and a.province like concat('%', #{province},'%')
2072
             </if>
2088
             </if>
2073
             <if test="realtyConsultant != null and realtyConsultant != ''">
2089
             <if test="realtyConsultant != null and realtyConsultant != ''">
2074
                 and d.user_name like concat('%', #{realtyConsultant},'%')
2090
                 and d.user_name like concat('%', #{realtyConsultant},'%')
2088
         if(a.gender = '1', '男', if(a.gender = '2', '女','未知') ) as gender,
2104
         if(a.gender = '1', '男', if(a.gender = '2', '女','未知') ) as gender,
2089
         a.province,
2105
         a.province,
2090
         b1.scene_alias as personFrom,
2106
         b1.scene_alias as personFrom,
2091
-        d.user_name as realtyConsultant,
2092
-        d.phone as realtyConsultantPhone,
2107
+        GROUP_CONCAT(d.user_name) as realtyConsultant,
2108
+        GROUP_CONCAT(d.phone) as realtyConsultantPhone,
2093
         t.create_date as visitDate,
2109
         t.create_date as visitDate,
2094
         ifnull(e.nickName, f.user_name) as sharePersonName,
2110
         ifnull(e.nickName, f.user_name) as sharePersonName,
2095
         t.visitNum
2111
         t.visitNum
2112
         left join ta_user d on c.realty_consultant = d.user_id
2128
         left join ta_user d on c.realty_consultant = d.user_id
2113
         left join ta_person e on e.person_id = c.recommend_person
2129
         left join ta_person e on e.person_id = c.recommend_person
2114
         left join ta_user f on f.user_id = c.recommend_person
2130
         left join ta_user f on f.user_id = c.recommend_person
2131
+        group by t.person_id
2115
     </select>
2132
     </select>
2116
 
2133
 
2117
     <select id="selectActivityVisitNumByPersonId" resultType="com.huiju.estateagents.excel.ActivityStatistics.VisitNum">
2134
     <select id="selectActivityVisitNumByPersonId" resultType="com.huiju.estateagents.excel.ActivityStatistics.VisitNum">
2122
         b1.scene_alias as personFrom,
2139
         b1.scene_alias as personFrom,
2123
         d.user_name as realtyConsultant,
2140
         d.user_name as realtyConsultant,
2124
         d.phone as realtyConsultantPhone,
2141
         d.phone as realtyConsultantPhone,
2125
-        t.create_date as visitDate
2142
+        t.create_date as visitDate,
2143
+        ifnull(e.nickname, f.user_name) as sharePersonName,
2144
+        ifnull(e.phone, f.phone) as sharePersonPhone
2126
         From (
2145
         From (
2127
-        SELECT t.person_id, t.create_date
2146
+        SELECT t.person_id, t.create_date, t.share_person
2128
         FROM ta_share_person_from t
2147
         FROM ta_share_person_from t
2129
         LEFT JOIN (
2148
         LEFT JOIN (
2130
         SELECT a.person_id, b.user_id
2149
         SELECT a.person_id, b.user_id
2135
         WHERE t.create_date >= DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%I:%S' ) and t.create_date &lt;=
2154
         WHERE t.create_date >= DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%I:%S' ) and t.create_date &lt;=
2136
         DATE_FORMAT(#{endDate}, '%Y-%m-%d %H:%I:%S' ) and t.target_type in
2155
         DATE_FORMAT(#{endDate}, '%Y-%m-%d %H:%I:%S' ) and t.target_type in
2137
         ('dynamic_share','h5_share','help_share','live_share', 'group_share')
2156
         ('dynamic_share','h5_share','help_share','live_share', 'group_share')
2138
-        and t.share_person = #{personId}
2157
+        and
2158
+        (t.share_person = (select b.user_id from ta_person t left join ta_user b on t.user_id = b.user_id where t.person_id = #{personId})
2159
+        or t.share_person = #{personId})
2139
         ) as t
2160
         ) as t
2140
 
2161
 
2141
         left join ta_person a on t.person_id = a.person_id
2162
         left join ta_person a on t.person_id = a.person_id
2143
         left join td_wx_dict b1 on b.scene_id = b1.scene_id
2164
         left join td_wx_dict b1 on b.scene_id = b1.scene_id
2144
         LEFT JOIN ta_recommend_customer c on c.person_id = t.person_id
2165
         LEFT JOIN ta_recommend_customer c on c.person_id = t.person_id
2145
         left join ta_user d on c.realty_consultant = d.user_id
2166
         left join ta_user d on c.realty_consultant = d.user_id
2167
+        left join ta_person e on t.share_person = e.person_id
2168
+        left join ta_user f on t.share_person = f.user_id
2169
+        group by t.create_date
2146
     </select>
2170
     </select>
2147
 
2171
 
2148
     <select id="selectActivityVisitPersonNumExportByPersonId"
2172
     <select id="selectActivityVisitPersonNumExportByPersonId"
2152
         if(a.gender = '1', '男', if(a.gender = '2', '女','未知') ) as gender,
2176
         if(a.gender = '1', '男', if(a.gender = '2', '女','未知') ) as gender,
2153
         a.province,
2177
         a.province,
2154
         b1.scene_alias as personFrom,
2178
         b1.scene_alias as personFrom,
2155
-        d.user_name as realtyConsultant,
2156
-        d.phone as realtyConsultantPhone,
2179
+        GROUP_CONCAT(d.user_name) as realtyConsultant,
2180
+        GROUP_CONCAT(d.phone) as realtyConsultantPhone,
2157
         t.create_date as visitDate,
2181
         t.create_date as visitDate,
2158
         ifnull(e.nickName, f.user_name) as sharePersonName,
2182
         ifnull(e.nickName, f.user_name) as sharePersonName,
2159
         t.visitNum
2183
         t.visitNum
2176
         left join ta_user d on c.realty_consultant = d.user_id
2200
         left join ta_user d on c.realty_consultant = d.user_id
2177
         left join ta_person e on e.person_id = c.recommend_person
2201
         left join ta_person e on e.person_id = c.recommend_person
2178
         left join ta_user f on f.user_id = c.recommend_person
2202
         left join ta_user f on f.user_id = c.recommend_person
2203
+        group by t.person_id
2179
     </select>
2204
     </select>
2180
 
2205
 
2181
     <select id="selectActivityVisitNumExportByPersonId"
2206
     <select id="selectActivityVisitNumExportByPersonId"
2187
         b1.scene_alias as personFrom,
2212
         b1.scene_alias as personFrom,
2188
         d.user_name as realtyConsultant,
2213
         d.user_name as realtyConsultant,
2189
         d.phone as realtyConsultantPhone,
2214
         d.phone as realtyConsultantPhone,
2190
-        t.create_date as visitDate
2215
+        t.create_date as visitDate,
2216
+        ifnull(e.nickname, f.user_name) as sharePersonName,
2217
+        ifnull(e.phone, f.phone) as sharePersonPhone
2191
         From (
2218
         From (
2192
         SELECT t.person_id, t.create_date
2219
         SELECT t.person_id, t.create_date
2193
         FROM ta_share_person_from t
2220
         FROM ta_share_person_from t
2194
         LEFT JOIN (
2221
         LEFT JOIN (
2195
-        SELECT a.person_id, b.user_id
2222
+        SELECT a.person_id, b.user_id, t.share_person
2196
         FROM ta_person a
2223
         FROM ta_person a
2197
         LEFT JOIN ta_user b
2224
         LEFT JOIN ta_user b
2198
         ON a.user_id = b.user_id
2225
         ON a.user_id = b.user_id
2200
         WHERE t.create_date >= DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%I:%S' ) and t.create_date &lt;=
2227
         WHERE t.create_date >= DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%I:%S' ) and t.create_date &lt;=
2201
         DATE_FORMAT(#{endDate}, '%Y-%m-%d %H:%I:%S' ) and t.target_type in
2228
         DATE_FORMAT(#{endDate}, '%Y-%m-%d %H:%I:%S' ) and t.target_type in
2202
         ('dynamic_share','h5_share','help_share','live_share', 'group_share')
2229
         ('dynamic_share','h5_share','help_share','live_share', 'group_share')
2203
-        and t.share_person = #{personId}
2230
+        and
2231
+        (t.share_person = (select b.user_id from ta_person t left join ta_user b on t.user_id = b.user_id where t.person_id = #{personId})
2232
+        or t.share_person = #{personId})
2204
         ) as t
2233
         ) as t
2205
 
2234
 
2206
         left join ta_person a on t.person_id = a.person_id
2235
         left join ta_person a on t.person_id = a.person_id
2208
         left join td_wx_dict b1 on b.scene_id = b1.scene_id
2237
         left join td_wx_dict b1 on b.scene_id = b1.scene_id
2209
         LEFT JOIN ta_recommend_customer c on c.person_id = t.person_id
2238
         LEFT JOIN ta_recommend_customer c on c.person_id = t.person_id
2210
         left join ta_user d on c.realty_consultant = d.user_id
2239
         left join ta_user d on c.realty_consultant = d.user_id
2240
+        left join ta_person e on t.share_person = e.person_id
2241
+        left join ta_user f on t.share_person = f.user_id
2242
+        group by t.create_date
2211
     </select>
2243
     </select>
2212
 </mapper>
2244
 </mapper>