魏熙美 hace 5 años
padre
commit
a1087a40eb

+ 2
- 1
src/main/java/com/huiju/estateagents/mapper/TaPersonVisitRecordMapper.java Ver fichero

@@ -37,7 +37,8 @@ public interface TaPersonVisitRecordMapper extends BaseMapper<TaPersonVisitRecor
37 37
                                          @Param("buildingId") String buildingId,
38 38
                                          @Param("eventType") String eventType,
39 39
                                          @Param("event") String event,
40
-                                         @Param("activity") String activity);
40
+                                         @Param("activity") String activity,
41
+                                         @Param("orgId") Integer orgId);
41 42
 
42 43
 
43 44
     /**

+ 1
- 1
src/main/java/com/huiju/estateagents/service/impl/StatisticalServiceImpl.java Ver fichero

@@ -178,7 +178,7 @@ public class StatisticalServiceImpl implements IStatisticalService {
178 178
         List<PersonPO> selectUserBehavior = taPersonMapper.selectUserBehavior(orgId, CommConstant.PERSON_REALTY_CONSULTANT, startDate, endDate, buildingId, eventType, event, activity);
179 179
 
180 180
         IPage<TaPersonVisitRecord> page = new Page<>(pageNum, pageSize);
181
-        IPage<TaPersonVisitRecord> visitRecordIPage = taPersonVisitRecordMapper.selectAll(page, startDate, endDate, buildingId, eventType, event, activity);
181
+        IPage<TaPersonVisitRecord> visitRecordIPage = taPersonVisitRecordMapper.selectAll(page, startDate, endDate, buildingId, eventType, event, activity, orgId);
182 182
 
183 183
         Map<String, Object> map = new HashMap<>();
184 184
         map.put("selectUserBehavior", selectUserBehavior);

+ 4
- 2
src/main/resources/mapper/TaPersonVisitRecordMapper.xml Ver fichero

@@ -17,8 +17,8 @@
17 17
             tpvr.event as event,
18 18
             tpvr.event_type as eventType,
19 19
             tpvr.visit_duration as visitDuration,
20
-            (SELECT MIN(t.visit_time) FROM ta_person_visit_record t WHERE t.person_id = tpvr.person_id and t.event = tpvr.event ) as visitTime,
21
-            (SELECT MAX(t.leave_time) FROM ta_person_visit_record t WHERE t.person_id = tpvr.person_id and t.event = tpvr.event ) as leaveTime,
20
+            (SELECT MIN(t.visit_time) FROM ta_person_visit_record t WHERE t.person_id = tpvr.person_id and t.event = tpvr.event and t.org_id = #{orgId} ) as visitTime,
21
+            (SELECT MAX(t.leave_time) FROM ta_person_visit_record t WHERE t.person_id = tpvr.person_id and t.event = tpvr.event and t.org_id = #{orgId} ) as leaveTime,
22 22
             ifnull(tp.name, tp.nickname) as userName,
23 23
             tbe.event_name as eventName,
24 24
             COUNT(1) as accessCount
@@ -27,6 +27,8 @@
27 27
             LEFT JOIN ta_person tp ON tpvr.person_id = tp.person_id
28 28
             LEFT JOIN td_biz_event tbe on tpvr.event = tbe.event_code
29 29
             <trim prefix="where" prefixOverrides="and | or">
30
+                tpvr.org_id = #{orgId}
31
+                and tp.org_id = #{orgId}
30 32
                 <if test="startDate != null and endDate != null">
31 33
                     and tpvr.visit_time between #{startDate} and #{endDate}
32 34
                 </if>