wangyunpeng 1 周之前
父节点
当前提交
6f4340ac58

+ 5 - 5
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformDataStatMapperExt.java

@@ -17,28 +17,28 @@ public interface ContentPlatformDataStatMapperExt {
                                                                @Param("offset") int offset,
                                                                @Param("pageSize") Integer pageSize);
 
-    int getGzhTotalDatastatCount(@Param("param") GzhDatastatListParam param, @Param("createAccountId") Long createAccountId);
+    Integer getGzhTotalDatastatCount(@Param("param") GzhDatastatListParam param, @Param("createAccountId") Long createAccountId);
 
     List<ContentPlatformGzhDataStat> getGzhTotalDatastatList(@Param("param") GzhDatastatListParam param,
                                                              @Param("createAccountId") Long createAccountId,
                                                              @Param("offset") int offset,
                                                              @Param("pageSize") Integer pageSize);
 
-    int getQwRootSourceIdDatastatCount(@Param("param") QwDatastatListParam param, @Param("createAccountId") Long createAccountId);
+    Integer getQwRootSourceIdDatastatCount(@Param("param") QwDatastatListParam param, @Param("createAccountId") Long createAccountId);
 
     List<ContentPlatformQwDataStat> getQwRootSourceIdDatastatList(@Param("param") QwDatastatListParam param,
                                                                   @Param("createAccountId") Long createAccountId,
                                                                   @Param("offset") int offset,
                                                                   @Param("pageSize") Integer pageSize);
 
-    int getQwTotalDatastatCount(@Param("param") QwDatastatListParam param, @Param("createAccountId") Long createAccountId);
+    Integer getQwTotalDatastatCount(@Param("param") QwDatastatListParam param, @Param("createAccountId") Long createAccountId);
 
     List<ContentPlatformQwDataStat> getQwTotalDatastatList(@Param("param") QwDatastatListParam param,
                                                            @Param("createAccountId") Long createAccountId,
                                                            @Param("offset") int offset,
                                                            @Param("pageSize") Integer pageSize);
 
-    int getQwSceneDatastatCount(@Param("param") QwDatastatListParam param,
+    Integer getQwSceneDatastatCount(@Param("param") QwDatastatListParam param,
                                 @Param("scene") Integer scene,
                                 @Param("createAccountId") Long createAccountId);
 
@@ -48,7 +48,7 @@ public interface ContentPlatformDataStatMapperExt {
                                                            @Param("offset") int offset,
                                                            @Param("pageSize") Integer pageSize);
 
-    int getQwReplyDatastatCount(@Param("param") QwDatastatListParam param, @Param("createAccountId") Long createAccountId);
+    Integer getQwReplyDatastatCount(@Param("param") QwDatastatListParam param, @Param("createAccountId") Long createAccountId);
 
     List<ContentPlatformQwDataStat> getReplyDatastatList(@Param("param") QwDatastatListParam param,
                                                          @Param("createAccountId") Long createAccountId,

+ 16 - 12
api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformDataStatMapperExt.xml

@@ -27,10 +27,11 @@
 
     <select id="getGzhTotalDatastatCount" resultType="java.lang.Integer">
         select count(1)
+        from (select cpgd.date_str
         from content_platform_gzh_datastat cpgd
-                 join content_platform_gzh_account cpgza on cpgd.account_id = cpgza.id
+         join content_platform_gzh_account cpgza on cpgd.account_id = cpgza.id
         where cpgza.create_account_id = #{createAccountId}
-        group by cpgd.date_str
+        group by cpgd.date_str) t
     </select>
 
     <select id="getGzhTotalDatastatList"
@@ -40,7 +41,7 @@
                sum(first_level_count)   as first_level_count,
                avg(score)               as score
         from content_platform_gzh_datastat cpgd
-                 join content_platform_gzh_account cpgza on cpgd.account_id = cpgza.id
+         join content_platform_gzh_account cpgza on cpgd.account_id = cpgza.id
         where cpgza.create_account_id = #{createAccountId}
         group by cpgd.date_str
         order by cpgd.date_str desc
@@ -66,17 +67,18 @@
 
     <select id="getQwTotalDatastatCount" resultType="java.lang.Integer">
         select count(1)
+        from (select cpqd.date_str
         from content_platform_qw_datastat cpqd
-                 join content_platform_qw_plan cpqp on cpqp.root_source_id = cpqd.root_source_id
+         join content_platform_qw_plan cpqp on cpqp.root_source_id = cpqd.root_source_id
         where cpqp.create_account_id = #{createAccountId}
-        group by cpqd.date_str
+        group by cpqd.date_str) t
     </select>
 
     <select id="getQwTotalDatastatList"
             resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwDataStat">
         select cpqd.date_str, sum(cpqd.first_level_count) as first_level_count, avg(cpqd.score) as score
         from content_platform_qw_datastat cpqd
-                 join content_platform_qw_plan cpqp on cpqp.root_source_id = cpqd.root_source_id
+         join content_platform_qw_plan cpqp on cpqp.root_source_id = cpqd.root_source_id
         where cpqp.create_account_id = #{createAccountId}
         group by cpqd.date_str
         order by cpqd.date_str desc
@@ -85,18 +87,19 @@
 
     <select id="getQwSceneDatastatCount" resultType="java.lang.Integer">
         select count(1)
+        from (select cpqd.date_str
         from content_platform_qw_datastat cpqd
-                 join content_platform_qw_plan cpqp on cpqp.root_source_id = cpqd.root_source_id
+         join content_platform_qw_plan cpqp on cpqp.root_source_id = cpqd.root_source_id
         where cpqp.create_account_id = #{createAccountId}
           and cpqp.scene = #{scene}
-        group by cpqd.date_str
+        group by cpqd.date_str) t
     </select>
 
     <select id="getQwSceneDatastatList"
             resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwDataStat">
         select cpqd.date_str, sum(cpqd.first_level_count) as first_level_count, avg(cpqd.score) as score
         from content_platform_qw_datastat cpqd
-                 join content_platform_qw_plan cpqp on cpqp.root_source_id = cpqd.root_source_id
+         join content_platform_qw_plan cpqp on cpqp.root_source_id = cpqd.root_source_id
         where cpqp.create_account_id = #{createAccountId}
           and cpqp.scene = #{scene}
         group by cpqd.date_str
@@ -106,18 +109,19 @@
 
     <select id="getQwReplyDatastatCount" resultType="java.lang.Integer">
         select count(1)
+        from (select cpqd.date_str
         from content_platform_qw_datastat cpqd
-                 join content_platform_qw_plan cpqp on cpqp.root_source_id = cpqd.root_source_id
+         join content_platform_qw_plan cpqp on cpqp.root_source_id = cpqd.root_source_id
         where cpqp.create_account_id = #{createAccountId}
           and cpqp.type = 0
-        group by cpqd.date_str
+        group by cpqd.date_str) t
     </select>
 
     <select id="getReplyDatastatList"
             resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwDataStat">
         select cpqd.date_str, sum(cpqd.first_level_count) as first_level_count, avg(cpqd.score) as score
         from content_platform_qw_datastat cpqd
-                 join content_platform_qw_plan cpqp on cpqp.root_source_id = cpqd.root_source_id
+         join content_platform_qw_plan cpqp on cpqp.root_source_id = cpqd.root_source_id
         where cpqp.create_account_id = #{createAccountId}
           and cpqp.type = 0
         group by cpqd.date_str