魏熙美 5 vuotta sitten
vanhempi
commit
a1087a40eb

+ 2
- 1
src/main/java/com/huiju/estateagents/mapper/TaPersonVisitRecordMapper.java Näytä tiedosto

37
                                          @Param("buildingId") String buildingId,
37
                                          @Param("buildingId") String buildingId,
38
                                          @Param("eventType") String eventType,
38
                                          @Param("eventType") String eventType,
39
                                          @Param("event") String event,
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 Näytä tiedosto

178
         List<PersonPO> selectUserBehavior = taPersonMapper.selectUserBehavior(orgId, CommConstant.PERSON_REALTY_CONSULTANT, startDate, endDate, buildingId, eventType, event, activity);
178
         List<PersonPO> selectUserBehavior = taPersonMapper.selectUserBehavior(orgId, CommConstant.PERSON_REALTY_CONSULTANT, startDate, endDate, buildingId, eventType, event, activity);
179
 
179
 
180
         IPage<TaPersonVisitRecord> page = new Page<>(pageNum, pageSize);
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
         Map<String, Object> map = new HashMap<>();
183
         Map<String, Object> map = new HashMap<>();
184
         map.put("selectUserBehavior", selectUserBehavior);
184
         map.put("selectUserBehavior", selectUserBehavior);

+ 4
- 2
src/main/resources/mapper/TaPersonVisitRecordMapper.xml Näytä tiedosto

17
             tpvr.event as event,
17
             tpvr.event as event,
18
             tpvr.event_type as eventType,
18
             tpvr.event_type as eventType,
19
             tpvr.visit_duration as visitDuration,
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
             ifnull(tp.name, tp.nickname) as userName,
22
             ifnull(tp.name, tp.nickname) as userName,
23
             tbe.event_name as eventName,
23
             tbe.event_name as eventName,
24
             COUNT(1) as accessCount
24
             COUNT(1) as accessCount
27
             LEFT JOIN ta_person tp ON tpvr.person_id = tp.person_id
27
             LEFT JOIN ta_person tp ON tpvr.person_id = tp.person_id
28
             LEFT JOIN td_biz_event tbe on tpvr.event = tbe.event_code
28
             LEFT JOIN td_biz_event tbe on tpvr.event = tbe.event_code
29
             <trim prefix="where" prefixOverrides="and | or">
29
             <trim prefix="where" prefixOverrides="and | or">
30
+                tpvr.org_id = #{orgId}
31
+                and tp.org_id = #{orgId}
30
                 <if test="startDate != null and endDate != null">
32
                 <if test="startDate != null and endDate != null">
31
                     and tpvr.visit_time between #{startDate} and #{endDate}
33
                     and tpvr.visit_time between #{startDate} and #{endDate}
32
                 </if>
34
                 </if>