魏熙美 пре 5 година
родитељ
комит
c6dc424c82

+ 3
- 0
src/main/java/com/huiju/estateagents/mapper/TaPersonVisitRecordMapper.java Прегледај датотеку

@@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.Param;
10 10
 import org.apache.ibatis.annotations.ResultType;
11 11
 import org.apache.ibatis.annotations.Select;
12 12
 
13
+import java.time.LocalDate;
13 14
 import java.util.List;
14 15
 
15 16
 /**
@@ -31,6 +32,8 @@ public interface TaPersonVisitRecordMapper extends BaseMapper<TaPersonVisitRecor
31 32
      * @return
32 33
      */
33 34
     IPage<TaPersonVisitRecord> selectAll(IPage<TaPersonVisitRecord> page,
35
+                                         @Param("startDate") LocalDate startDate,
36
+                                         @Param("endDate")LocalDate endDate,
34 37
                                          @Param("buildingId") String buildingId,
35 38
                                          @Param("eventType") String eventType,
36 39
                                          @Param("event") String event,

+ 1
- 1
src/main/java/com/huiju/estateagents/service/impl/StatisticalServiceImpl.java Прегледај датотеку

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

+ 6
- 0
src/main/resources/mapper/TaPersonVisitRecordMapper.xml Прегледај датотеку

@@ -13,6 +13,9 @@
13 13
             tpvr.person_type as personType,
14 14
             tpvr.building_id as buildingId,
15 15
             tpvr.activity as activity,
16
+            tpvr.event as event,
17
+            tpvr.event_type as eventType,
18
+            tpvr.visit_duration as visitDuration,
16 19
             (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,
17 20
             (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,
18 21
             ifnull(tp.name, tp.nickname) as userName,
@@ -23,6 +26,9 @@
23 26
             LEFT JOIN ta_person tp ON tpvr.person_id = tp.person_id
24 27
             LEFT JOIN td_biz_event tbe on tpvr.event = tbe.event_code
25 28
             <trim prefix="where" prefixOverrides="and | or">
29
+                <if test="startDate != null and endDate != null">
30
+                    and tpvr.visit_time between #{startDate} and #{endDate}
31
+                </if>
26 32
                 <if test="buildingId != null and buildingId != ''">
27 33
                     and tpvr.building_id = #{buildingId}
28 34
                 </if>