傅行帆 5 年前
父节点
当前提交
f2a90f8440

+ 2
- 0
src/main/java/com/huiju/estateagents/entity/TdWxDict.java 查看文件

@@ -1,11 +1,13 @@
1 1
 package com.huiju.estateagents.entity;
2 2
 
3 3
 import com.baomidou.mybatisplus.annotation.TableField;
4
+import com.huiju.estateagents.statistic.entity.TsPersonFromStatistic;
4 5
 import lombok.Data;
5 6
 import lombok.EqualsAndHashCode;
6 7
 import lombok.experimental.Accessors;
7 8
 
8 9
 import java.io.Serializable;
10
+import java.util.List;
9 11
 
10 12
 /**
11 13
  * <p>

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

@@ -339,8 +339,11 @@ public class StatisticalServiceImpl implements IStatisticalService {
339 339
             e.setFromData(fromSum);
340 340
             e.setRegisterSum(registerSum);
341 341
         });
342
-
343
-        responseBean.addSuccess(tdWxDicts);
342
+        Map<String,Object> map = new HashMap<>();
343
+        map.put("tdWxDicts",tdWxDicts);
344
+        List<TsPersonFromStatistic> tableList = tsPersonFromStatisticMapper.selectPersonFromGroupByData(orgId,startDate,endDate);
345
+        map.put("list",tableList);
346
+        responseBean.addSuccess(map);
344 347
         return responseBean;
345 348
     }
346 349
 

+ 2
- 0
src/main/java/com/huiju/estateagents/statistic/mapper/TsPersonFromStatisticMapper.java 查看文件

@@ -23,4 +23,6 @@ public interface TsPersonFromStatisticMapper extends BaseMapper<TsPersonFromStat
23 23
     List<TsPersonFromStatistic> selectPersonFrom(Integer orgId, LocalDate startDate, LocalDate endDate);
24 24
 
25 25
     List<TsPersonFromStatistic> selectPersonFromGroupByDay(Integer orgId, LocalDate startDate, LocalDate endDate);
26
+
27
+    List<TsPersonFromStatistic> selectPersonFromGroupByData(Integer orgId, LocalDate startDate, LocalDate endDate);
26 28
 }

+ 22
- 0
src/main/resources/mapper/statistic/TsPersonFromStatisticMapper.xml 查看文件

@@ -21,6 +21,7 @@
21 21
         <if test="startDate == null or endDate == null">
22 22
             AND tp.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
23 23
         </if>
24
+
24 25
     </select>
25 26
     <select id="selectPersonFromGroupByDay"
26 27
             resultType="com.huiju.estateagents.statistic.entity.TsPersonFromStatistic">
@@ -41,4 +42,25 @@
41 42
         GROUP BY
42 43
             DATE_FORMAT( tp.create_date, '%Y-%m-%d' )
43 44
     </select>
45
+    <select id="selectPersonFromGroupByData"
46
+            resultType="com.huiju.estateagents.statistic.entity.TsPersonFromStatistic">
47
+        SELECT
48
+        sum( tp.from_num ) AS from_num,
49
+        sum( tp.registered_num ) AS registered_num,
50
+        DATE_FORMAT( tp.create_date, '%Y-%m-%d' ) AS create_time,
51
+        tp.scene_type
52
+        FROM
53
+        ts_person_from_statistic tp
54
+        WHERE
55
+        tp.org_id = #{orgId}
56
+        <if test="startDate != null or endDate != null">
57
+            AND  tp.create_date BETWEEN #{startDate} and #{endDate}
58
+        </if>
59
+        <if test="startDate == null or endDate == null">
60
+            AND tp.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
61
+        </if>
62
+        GROUP BY
63
+        DATE_FORMAT( tp.create_date, '%Y-%m-%d' ),
64
+        tp.scene_type
65
+    </select>
44 66
 </mapper>