傅行帆 5 лет назад
Родитель
Сommit
6d0ce13d4f

+ 5
- 1
src/main/java/com/huiju/estateagents/service/impl/TsConsultantKpiServiceImpl.java Просмотреть файл

@@ -106,8 +106,12 @@ public class TsConsultantKpiServiceImpl extends ServiceImpl<TsConsultantKpiMappe
106 106
 
107 107
     @Override
108 108
     public IPage<TaRecommendCustomer> getCustomerListOfConsultant(IPage<TaRecommendCustomer> page, Integer orgId, String userId, String buildingId, LocalDateTime startDate, LocalDateTime endDate) {
109
+        String personId = null;
109 110
         TaPerson taPerson = taPersonMapper.selectOne(new QueryWrapper<TaPerson>().eq("user_id", userId).eq("org_id", orgId));
110
-        return taRecommendCustomerMapper.getCustomerListOfConsultant(page, orgId, userId, buildingId, startDate, endDate, taPerson.getPersonId());
111
+        if (null != taPerson){
112
+            personId = taPerson.getPersonId();
113
+        }
114
+        return taRecommendCustomerMapper.getCustomerListOfConsultant(page, orgId, userId, buildingId, startDate, endDate, personId);
111 115
     }
112 116
 
113 117
     @Override

+ 5
- 1
src/main/resources/mapper/TaRecommendCustomerMapper.xml Просмотреть файл

@@ -842,7 +842,11 @@ FROM
842 842
         from ta_recommend_customer s
843 843
         left join ta_person t on t.person_id = s.person_id
844 844
         where s.org_id = #{orgId}
845
-        and (s.realty_consultant = #{userId} or s.realty_consultant = #{personId})
845
+        and (s.realty_consultant = #{userId}
846
+        <if test="personId != null">
847
+            or s.realty_consultant = #{personId}
848
+        </if>
849
+        )
846 850
         <if test="startDate != null">
847 851
             and s.create_date BETWEEN #{startDate} and #{endDate}
848 852
         </if>