Browse Source

王垒、李娜效果报表修改

hcst_sunzhen 4 years ago
parent
commit
7c83ba4c22

+ 3 - 5
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyAccountMapper.java

@@ -40,13 +40,11 @@ public interface KuaishouReportDailyAccountMapper extends BaseMapper<KuaishouRep
 
     KuaishouVideoInfoDTO getVideoUrl(@Param("photoId")Long photoId);
 
-    List<Long> getUserProjectAccountIds(@Param("userId")String userId);
+    List<Long> getUserProjectAccountIds(@Param("userId")String userId, @Param("yn")Integer yn);
 
-    List<Long> getUserProjectAccountIdsByAdmin();
+    List<Long> getUserProjectAccountIdsByAdmin(@Param("yn")Integer yn);
 
-
-
-    List<Long> getSaleProjectAccountIds(@Param("userId")String userId);
+    List<Long> getSaleProjectAccountIds(@Param("userId")String userId, @Param("yn")Integer yn);
 
 
 }

+ 11 - 10
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyAccountMapper.xml

@@ -876,17 +876,10 @@
 
     <select id="queryProjectMemberByUserId" resultType="long">
         select
-        distinct a.project_id as projectId
-       -- a.project_name as projectName,
-       -- a.advertiser_name as advertiserName,
-       -- c.responsible_name as responsibleName,
-       -- c.design_responsible_name as designResponsibleName
+        distinct c.id as projectId
         from
-        ctop_user_allocation a
-        left join ctop_project_member b on a.project_id = b.project_id
-        left join ctop_project c on a.project_id = c.id
+        ctop_project_member b
+        left join ctop_project c on b.project_id = c.id
         where b.user_id = #{userId}
         and a.media_id in
         <foreach collection="mediaIds" item="item" separator=","
@@ -947,7 +940,7 @@
         where a.user_id = #{userId}
     </select>
 
-    <!-- 设计师展示所有自己的角色下制作的视频 -->
+    <!-- 管理员所在项目 -->
     <select id="queryProjectMemberByAdmins" resultType="long">
         select
         id as projectId
@@ -1078,7 +1071,9 @@
         where
         and a.media_id in (2,4)
         order by a.create_time desc
+        <if test="yn==1">
         limit 50
+        </if>
     </select>
 
     <select id="getUserProjectAccountIdsByAdmin" resultType="long">
@@ -1089,7 +1084,9 @@
         left join ctop_project b on a.project_id = b.id
         where
         b.media_id in (2,4)
+        <if test="yn==1">
         limit 50
+        </if>
     </select>
 
     <select id="getSaleProjectAccountIds" resultType="long">
@@ -1100,9 +1097,11 @@
         left join ctop_project b on a.project_id=b.id
         where
         b.sale_id = #{userId}
-        and b.media_id in (1,3)
+        and b.media_id in (2,4)
         order by a.create_time desc
+        <if test="yn==1">
         limit 50
+        </if>
     </select>
 
 </mapper>

+ 10 - 11
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouReportDailyAccountServiceImpl.java

@@ -74,7 +74,6 @@ public class KuaishouReportDailyAccountServiceImpl extends ServiceImpl<KuaishouR
             if("admin".equals(roleCode)){
                 projectList = dailyAccountMapper.queryProjectMemberByAdmins(mediaIds);
             }else{
-
                 projectList = dailyAccountMapper.queryProjectInfoBySaleId(userId,mediaIds);
             }
         }
@@ -93,9 +92,9 @@ public class KuaishouReportDailyAccountServiceImpl extends ServiceImpl<KuaishouR
         List<Long> accountIds = null;
         if(projectId == null){
             if("admin".equals(roleCode)){
-                accountIds = dailyAccountMapper.getUserProjectAccountIdsByAdmin();
+                accountIds = dailyAccountMapper.getUserProjectAccountIdsByAdmin(0);
             }else {
-                accountIds = dailyAccountMapper.getSaleProjectAccountIds(userId);
+                accountIds = dailyAccountMapper.getSaleProjectAccountIds(userId,0);
             }
         }
 
@@ -114,9 +113,9 @@ public class KuaishouReportDailyAccountServiceImpl extends ServiceImpl<KuaishouR
         List<Long> accountIds = null;
         if(projectId == null){
             if("admin".equals(roleCode)){
-                accountIds = dailyAccountMapper.getUserProjectAccountIdsByAdmin();
+                accountIds = dailyAccountMapper.getUserProjectAccountIdsByAdmin(0);
             }else {
-                accountIds = dailyAccountMapper.getUserProjectAccountIds(userId);
+                accountIds = dailyAccountMapper.getUserProjectAccountIds(userId,0);
             }
         }
 
@@ -134,9 +133,9 @@ public class KuaishouReportDailyAccountServiceImpl extends ServiceImpl<KuaishouR
         List<Long> accountIds = null;
         if(accountId == null){
             if("admin".equals(roleCode)){
-                accountIds = dailyAccountMapper.getUserProjectAccountIdsByAdmin();
+                accountIds = dailyAccountMapper.getUserProjectAccountIdsByAdmin(1);
             }else {
-                accountIds = dailyAccountMapper.getUserProjectAccountIds(userId);
+                accountIds = dailyAccountMapper.getUserProjectAccountIds(userId,1);
             }
         }
 
@@ -155,9 +154,9 @@ public class KuaishouReportDailyAccountServiceImpl extends ServiceImpl<KuaishouR
         List<Long> accountIds = null;
         if(campaignId == null){
             if("admin".equals(roleCode)){
-                accountIds = dailyAccountMapper.getUserProjectAccountIdsByAdmin();
+                accountIds = dailyAccountMapper.getUserProjectAccountIdsByAdmin(1);
             }else {
-                accountIds = dailyAccountMapper.getUserProjectAccountIds(userId);
+                accountIds = dailyAccountMapper.getUserProjectAccountIds(userId,1);
             }
         }
 
@@ -175,9 +174,9 @@ public class KuaishouReportDailyAccountServiceImpl extends ServiceImpl<KuaishouR
         List<Long> accountIds = null;
         if(unitId == null){
             if("admin".equals(roleCode)){
-                accountIds = dailyAccountMapper.getUserProjectAccountIdsByAdmin();
+                accountIds = dailyAccountMapper.getUserProjectAccountIdsByAdmin(1);
             }else {
-                accountIds = dailyAccountMapper.getUserProjectAccountIds(userId);
+                accountIds = dailyAccountMapper.getUserProjectAccountIds(userId,1);
             }
         }
 

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceAccountReportMapper.xml

@@ -455,7 +455,7 @@
         b.sale_id = #{userId}
         and b.media_id in (1,3)
         order by a.create_time desc
-        limit 50
+
     </select>
 
     <select id="getUserProjectAccountIdsByAdmin" resultType="long">
@@ -466,7 +466,7 @@
         left join ctop_project b on a.project_id = b.id
         where
         b.media_id in (1,3)
-        limit 50
+
     </select>
 
 </mapper>