Pārlūkot izejas kodu

Merge branch 'master' of http://git.ycjcjy.com/zhiyuxing/estateagents

胡轶钦 5 gadus atpakaļ
vecāks
revīzija
72de2ad224

+ 2
- 3
src/main/java/com/huiju/estateagents/controller/StatisticalController.java Parādīt failu

86
      */
86
      */
87
     @GetMapping(value = "/admin/selectUserResource")
87
     @GetMapping(value = "/admin/selectUserResource")
88
     public ResponseBean selectUserResource(@RequestParam(value = "startDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDate startDate,
88
     public ResponseBean selectUserResource(@RequestParam(value = "startDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDate startDate,
89
-                                           @RequestParam(value = "endDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)  LocalDate endDate,
90
-                                           @RequestParam(value = "registeredType", required = false) String registeredType) {
91
-        return iStatisticalService.selectUserResource(startDate, endDate, registeredType);
89
+                                           @RequestParam(value = "endDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)  LocalDate endDate) {
90
+        return iStatisticalService.selectUserResource(startDate, endDate);
92
     }
91
     }
93
 
92
 
94
 
93
 

+ 1
- 1
src/main/java/com/huiju/estateagents/mapper/TaPersonMapper.java Parādīt failu

145
     /**
145
     /**
146
      * 用户来源 数据列表
146
      * 用户来源 数据列表
147
      */
147
      */
148
-    List<Map<String,Object>> selectUserSourceData(@Param("personType") String personType, @Param("startDate")LocalDate startDate, @Param("endDate")LocalDate endDate, @Param("registeredType") String registeredType);
148
+    List<Map<String,Object>> selectUserSourceData(@Param("personType") String personType, @Param("startDate")LocalDate startDate, @Param("endDate")LocalDate endDate);
149
 
149
 
150
     // ------------- 用户来源 end ------------
150
     // ------------- 用户来源 end ------------
151
 
151
 

+ 1
- 1
src/main/java/com/huiju/estateagents/service/IStatisticalService.java Parādīt failu

90
      * 用户来源 首页
90
      * 用户来源 首页
91
      * @return
91
      * @return
92
      */
92
      */
93
-    ResponseBean selectUserResource(LocalDate startDate, LocalDate endDate, String registeredType);
93
+    ResponseBean selectUserResource(LocalDate startDate, LocalDate endDate);
94
 
94
 
95
     /**
95
     /**
96
      * 意向用户 首页
96
      * 意向用户 首页

+ 2
- 2
src/main/java/com/huiju/estateagents/service/impl/StatisticalServiceImpl.java Parādīt failu

244
 
244
 
245
 
245
 
246
     @Override
246
     @Override
247
-    public ResponseBean selectUserResource(LocalDate startDate, LocalDate endDate, String registeredType) {
247
+    public ResponseBean selectUserResource(LocalDate startDate, LocalDate endDate) {
248
         ResponseBean responseBean = new ResponseBean();
248
         ResponseBean responseBean = new ResponseBean();
249
         // 用户来源 柱状
249
         // 用户来源 柱状
250
         List<Map<String, Object>> mapList = taPersonMapper.selectUserSourceColumnar(CommConstant.PERSON_REALTY_CONSULTANT, startDate, endDate);
250
         List<Map<String, Object>> mapList = taPersonMapper.selectUserSourceColumnar(CommConstant.PERSON_REALTY_CONSULTANT, startDate, endDate);
260
         map.put("person_null", person_null);
260
         map.put("person_null", person_null);
261
 
261
 
262
         // 用户来源 数据列表
262
         // 用户来源 数据列表
263
-        List<Map<String, Object>> selectUserSourceData = taPersonMapper.selectUserSourceData(CommConstant.PERSON_ESTATE_AGENT, startDate, endDate, registeredType);
263
+        List<Map<String, Object>> selectUserSourceData = taPersonMapper.selectUserSourceData(CommConstant.PERSON_ESTATE_AGENT, startDate, endDate);
264
 
264
 
265
         Map<String, Object> result = new HashMap<>();
265
         Map<String, Object> result = new HashMap<>();
266
         result.put("columnar", mapList);
266
         result.put("columnar", mapList);

+ 34
- 16
src/main/resources/mapper/TaPersonMapper.xml Parādīt failu

366
     </select>
366
     </select>
367
 
367
 
368
     <select id="selectUserSourceData" resultType="map">
368
     <select id="selectUserSourceData" resultType="map">
369
+
369
         select
370
         select
370
             temp_date.date AS date,
371
             temp_date.date AS date,
371
             temp_date.from_name as from_name,
372
             temp_date.from_name as from_name,
372
             temp_date.from_code as from_code,
373
             temp_date.from_code as from_code,
373
             IFNULL(user_count.count, 0) as count,
374
             IFNULL(user_count.count, 0) as count,
375
+            IFNULL(registered_count.count,0) as registered,
374
             user_count.create_date as create_date
376
             user_count.create_date as create_date
375
         FROM
377
         FROM
376
         (
378
         (
377
             SELECT
379
             SELECT
378
-                DATE_FORMAT( DATE_SUB( now( ), INTERVAL a.rownum DAY ), '%Y-%m-%d' ) AS date,
379
-                tempf.from_name as from_name,
380
-                tempf.from_code as from_code
380
+            DATE_FORMAT( DATE_SUB( now( ), INTERVAL a.rownum DAY ), '%Y-%m-%d' ) AS date,
381
+            tempf.from_name as from_name,
382
+            tempf.from_code as from_code
381
             FROM
383
             FROM
382
-                sequence a
383
-                ,
384
-                td_person_from tempf
384
+            sequence a
385
+            ,
386
+            td_person_from tempf
385
             WHERE
387
             WHERE
386
-            <if test="startDate == null or endDate == null">
387
-                a.rownum <![CDATA[ <= ]]> 7
388
-            </if>
389
-            <if test="startDate != null or endDate != null">
390
-                a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
391
-            </if>
388
+
389
+                <if test="startDate == null or endDate == null">
390
+                    a.rownum <![CDATA[ <= ]]> 7
391
+                </if>
392
+                <if test="startDate != null or endDate != null">
393
+                    a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
394
+                </if>
392
 
395
 
393
         ) AS temp_date
396
         ) AS temp_date
394
 
397
 
403
             LEFT JOIN td_person_from tpfs
406
             LEFT JOIN td_person_from tpfs
404
             ON tps.from_code = tpfs.from_code
407
             ON tps.from_code = tpfs.from_code
405
             WHERE tpfs.from_code = tps.from_code
408
             WHERE tpfs.from_code = tps.from_code
406
-            and ifnull(tps.person_type, '') != #{personType}
407
-            <if test="registeredType == 'registered' and registeredType != ''">
408
-                and tps.phone is not null
409
-            </if>
409
+            and ifnull(tps.person_type, '') != 'Realty Consultant'
410
+
410
             GROUP BY tpfs.from_code
411
             GROUP BY tpfs.from_code
411
         ) as user_count
412
         ) as user_count
412
         ON DATE_FORMAT(user_count.create_date,'%Y-%m-%d') =  temp_date.date and temp_date.from_code = user_count.from_code
413
         ON DATE_FORMAT(user_count.create_date,'%Y-%m-%d') =  temp_date.date and temp_date.from_code = user_count.from_code
414
+        LEFT JOIN
415
+        (
416
+            SELECT
417
+                ifnull(COUNT(1), 0) as count,
418
+                tps.create_date as create_date,
419
+                tpfs.from_code as from_code,
420
+                tpfs.from_name as from_name
421
+            FROM ta_person tps
422
+            LEFT JOIN td_person_from tpfs
423
+            ON tps.from_code = tpfs.from_code
424
+            WHERE tpfs.from_code = tps.from_code
425
+                and ifnull(tps.person_type, '') != 'Realty Consultant'
426
+                and tps.phone is not null
427
+            GROUP BY tpfs.from_code
428
+        ) as registered_count
429
+        ON DATE_FORMAT(user_count.create_date,'%Y-%m-%d') =  temp_date.date and temp_date.from_code = registered_count.from_code
430
+        order by temp_date.date DESC
413
     </select>
431
     </select>
414
 
432
 
415
 </mapper>
433
 </mapper>