浏览代码

意向用户 首页

魏熙美 5 年前
父节点
当前提交
52c0861a3a

+ 13
- 3
src/main/java/com/huiju/estateagents/controller/StatisticalController.java 查看文件

@@ -61,12 +61,12 @@ public class StatisticalController {
61 61
      * @return
62 62
      */
63 63
     @GetMapping(value = "/admin/selectUserBehavior")
64
-    public ResponseBean selectUserBehavior(@RequestParam(required = false) Integer pageNum,
65
-                                           @RequestParam(required = false) Integer pageCode,
64
+    public ResponseBean selectUserBehavior(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
65
+                                           @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
66 66
                                            @RequestParam(value = "startDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDate startDate,
67 67
                                            @RequestParam(value = "endDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)  LocalDate endDate,
68 68
                                            @RequestParam(value = "buildingId", required = false) String buildingId) {
69
-        return iStatisticalService.selectUserBehavior(pageNum, pageCode, startDate, endDate, buildingId);
69
+        return iStatisticalService.selectUserBehavior(pageNum, pageSize, startDate, endDate, buildingId);
70 70
     }
71 71
 
72 72
     /**
@@ -138,5 +138,15 @@ public class StatisticalController {
138 138
         return iStatisticalService.selectCityUser();
139 139
     }
140 140
 
141
+    /**
142
+     * 意向用户  首页
143
+     * @return
144
+     */
145
+    @GetMapping(value = "/admin/selectIntentionUser")
146
+    public ResponseBean selectIntentionUser(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
147
+                                            @RequestParam(value = "pageSize", defaultValue = "2") Integer pageSize,
148
+                                            @RequestParam(value = "buildingId", required = false) String buildingId) {
149
+        return iStatisticalService.selectIntentionUser(pageNum, pageSize, buildingId);
150
+    }
141 151
 
142 152
 }

+ 10
- 0
src/main/java/com/huiju/estateagents/mapper/TaPersonIntentionRecordMapper.java 查看文件

@@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 5
 import com.baomidou.mybatisplus.core.metadata.IPage;
6 6
 import com.huiju.estateagents.entity.TaPersonIntentionRecord;
7 7
 import org.apache.ibatis.annotations.Mapper;
8
+import org.apache.ibatis.annotations.Param;
9
+
10
+import java.util.Map;
8 11
 
9 12
 /**
10 13
  * <p>
@@ -20,4 +23,11 @@ public interface TaPersonIntentionRecordMapper extends BaseMapper<TaPersonIntent
20 23
 
21 24
     IPage<TaPersonIntentionRecord> selectAll(IPage<TaPersonIntentionRecord> page);
22 25
 
26
+    /**
27
+     * 意向用户, 首页统计的 意向用户
28
+     * @param page
29
+     * @param buildingId
30
+     * @return
31
+     */
32
+    IPage<Map<String, Object>> selectIntentionUser(IPage<Map<String, Object>> page, @Param("buildingId") String buildingId);
23 33
 }

+ 6
- 0
src/main/java/com/huiju/estateagents/service/IStatisticalService.java 查看文件

@@ -92,4 +92,10 @@ public interface IStatisticalService {
92 92
      */
93 93
     ResponseBean selectUserResource(LocalDate startDate, LocalDate endDate, String registeredType);
94 94
 
95
+    /**
96
+     * 意向用户 首页
97
+     * @param buildingId
98
+     * @return
99
+     */
100
+    ResponseBean selectIntentionUser(Integer pageNum, Integer pageSize, String buildingId);
95 101
 }

+ 13
- 0
src/main/java/com/huiju/estateagents/service/impl/StatisticalServiceImpl.java 查看文件

@@ -41,6 +41,8 @@ public class StatisticalServiceImpl implements IStatisticalService {
41 41
     @Autowired
42 42
     private TaNewsMapper taNewsMapper;
43 43
 
44
+    @Autowired
45
+    private TaPersonIntentionRecordMapper taPersonIntentionRecordMapper;
44 46
 
45 47
 
46 48
     @Override
@@ -338,4 +340,15 @@ public class StatisticalServiceImpl implements IStatisticalService {
338 340
         responseBean.addSuccess(map);
339 341
         return responseBean;
340 342
     }
343
+
344
+    @Override
345
+    public ResponseBean selectIntentionUser(Integer pageNum, Integer pageSize, String buildingId) {
346
+        ResponseBean responseBean = new ResponseBean();
347
+
348
+        IPage<Map<String,Object>> pg = new Page<>(pageNum, pageSize);
349
+        IPage<Map<String, Object>> page = taPersonIntentionRecordMapper.selectIntentionUser(pg, buildingId);
350
+
351
+        responseBean.addSuccess(page);
352
+        return responseBean;
353
+    }
341 354
 }

+ 18
- 0
src/main/resources/mapper/TaPersonIntentionRecordMapper.xml 查看文件

@@ -13,4 +13,22 @@
13 13
             GROUP BY tpir.person_id
14 14
     </select>
15 15
 
16
+
17
+    <select id="selectIntentionUser" resultType="map">
18
+        SELECT
19
+            tpir.person_name as  personName,
20
+            tp.phone as phone,
21
+            GROUP_CONCAT(tpir.building_name) as buildingName,
22
+            SUM(tpir.intention) as intention
23
+        FROM
24
+            ta_person_intention_record tpir
25
+            LEFT JOIN ta_person tp on tpir.person_id = tp.person_id
26
+            <where>
27
+                <if test="buildingId != null and buildingId != ''">
28
+                    tpir.building_id = #{buildingId}
29
+                </if>
30
+            </where>
31
+        GROUP BY
32
+            tpir.person_id
33
+    </select>
16 34
 </mapper>