傅行帆 5 anos atrás
pai
commit
8d9b6b138e

+ 2
- 0
src/main/java/com/huiju/estateagents/mapper/TaPersonMapper.java Ver arquivo

@@ -221,4 +221,6 @@ public interface TaPersonMapper extends BaseMapper<TaPerson> {
221 221
     Integer judgeBindStatusByCondition(@Param("userId") Integer userId, @Param("orgId") Integer orgId, @Param("phone") String phone);
222 222
 
223 223
     IPage<TaPerson> selectDriftCustomerPageList(IPage<TaPerson> page,@Param("buildingId") String buildingId,@Param("orgId") Integer orgId,@Param("personEstateDrift") String personEstateDrift,@Param("sceneType") String sceneType);
224
+
225
+    int selectFromNum(@Param("orgId") Integer orgId,@Param("personType") String personType);
224 226
 }

+ 5
- 4
src/main/java/com/huiju/estateagents/service/impl/StatisticalServiceImpl.java Ver arquivo

@@ -216,10 +216,11 @@ public class StatisticalServiceImpl implements IStatisticalService {
216 216
         List<Map<String, Object>> mapList = taPersonMapper.selectUserSourceColumnar(orgId, CommConstant.PERSON_REALTY_CONSULTANT, startDate, endDate);
217 217
 
218 218
         // 用户来源饼状
219
-        // 来源置业顾问, 来源全民经纪人,自由进入
220
-        Integer person_realty_consultant = taPersonMapper.selectUserSourcePie(orgId, CommConstant.PERSON_REALTY_CONSULTANT, CommConstant.PERSON_REALTY_CONSULTANT);
221
-        Integer person_estate_agent = taPersonMapper.selectUserSourcePie(orgId, CommConstant.PERSON_ESTATE_AGENT, CommConstant.PERSON_REALTY_CONSULTANT);
222
-        Integer person_null = taPersonMapper.selectUserSourcePie(orgId, null, CommConstant.PERSON_REALTY_CONSULTANT);
219
+        // 来源置业顾问, 来源客户,其他
220
+        Integer total = taPersonMapper.selectFromNum(orgId, null) ;
221
+        Integer person_realty_consultant = taPersonMapper.selectFromNum(orgId, CommConstant.PERSON_REALTY_CONSULTANT);
222
+        Integer person_estate_agent = taPersonMapper.selectFromNum(orgId, CommConstant.PERSON_ESTATE_CUSTOMER);
223
+        Integer person_null = total - person_realty_consultant - person_estate_agent;
223 224
         Map<String, Object> map = new HashMap<>();
224 225
         map.put("person_realty_consultant", person_realty_consultant);
225 226
         map.put("person_estate_agent", person_estate_agent);

+ 19
- 0
src/main/resources/mapper/TaPersonMapper.xml Ver arquivo

@@ -575,4 +575,23 @@ FROM
575 575
         </if>
576 576
         order by t.create_date desc
577 577
     </select>
578
+
579
+    <select id="selectFromNum" resultType="java.lang.Integer">
580
+        SELECT
581
+            count( 1 )
582
+        FROM
583
+        (
584
+            SELECT
585
+                t.from_record_id,
586
+                t.person_id
587
+            FROM
588
+                ta_person_from_record t
589
+                LEFT JOIN ta_person p ON t.share_person_id = p.person_id
590
+                WHERE t.is_first_time = 1
591
+            and t.org_id = #{orgId}
592
+            <if test="personType !=null and personType !=''">
593
+                and p.person_type = #{personType}
594
+            </if>
595
+                GROUP BY t.person_id) d
596
+    </select>
578 597
 </mapper>