Ver Fonte

头条视频报表——我参与的项目

hcst_sunzhen há 5 anos atrás
pai
commit
37ec79d4bc

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectMemberServiceImpl.java

@@ -80,7 +80,7 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
             projectMemberList = memberMapper.operationProjects(userId, mediaId);
         }
 
-        return null;
+        return projectMemberList;
     }
 
 

+ 12 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/DTO/AccountVideoDTO.java

@@ -0,0 +1,12 @@
+package cn.com.ctop.toutiao.modules.report.DTO;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+@Data
+public class AccountVideoDTO implements Serializable {
+    private Long accountId;
+    private String signature;
+}

+ 23 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/ByteDanceVideoReportDailyMapper.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.toutiao.modules.report.mapper;
 
+import cn.com.ctop.toutiao.modules.report.DTO.AccountVideoDTO;
 import cn.com.ctop.toutiao.modules.report.entity.ByteDanceVideoReportDaily;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
@@ -38,4 +39,26 @@ public interface ByteDanceVideoReportDailyMapper extends BaseMapper<ByteDanceVid
 
     List<ByteDanceVideoReportDaily> bytedanceVideoInfoList(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("role") String role, @Param("userId") String userId, @Param("signature") String signature, @Param("companyId") String companyId, @Param("cost") BigDecimal cost);
 
+    List<AccountVideoDTO> accountVideoMap();
+
+    void replaceIntoAccountVideoMapBatch(@Param("accountVideoDTOList")List<AccountVideoDTO> accountVideoDTOList);
+
+    //admin角色查询视频报表
+    List<ByteDanceVideoReportDaily> videoInfoListGroupAdmin(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("accountIds") List<Long> accountIds, @Param("signature") String signature, @Param("cost") BigDecimal cost);
+
+    //teamLeader角色查询视频报表
+    List<ByteDanceVideoReportDaily> videoInfoListGroupdesignTeamLeader(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("companyId")String companyId, @Param("accountIds") List<Long> accountIds, @Param("signature") String signature, @Param("cost") BigDecimal cost);
+
+    //平面设计角色查询视频报表
+    List<ByteDanceVideoReportDaily> videoInfoListGroupPlaneAndPlaneLeader(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("companyId")String companyId, @Param("userId")String userId, @Param("accountIds") List<Long> accountIds, @Param("signature") String signature, @Param("cost") BigDecimal cost);
+
+    //编导角色查询视频报表
+    List<ByteDanceVideoReportDaily> videoInfoListGroupPlan(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("companyId")String companyId, @Param("userId")String userId, @Param("accountIds") List<Long> accountIds, @Param("signature") String signature, @Param("cost") BigDecimal cost);
+
+    //剪辑角色查询视频报表
+    List<ByteDanceVideoReportDaily> videoInfoListGroupClip(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("companyId")String companyId, @Param("userId")String userId, @Param("accountIds") List<Long> accountIds, @Param("signature") String signature, @Param("cost") BigDecimal cost);
+
+    //拍摄
+    List<ByteDanceVideoReportDaily> videoInfoListGroupShot(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("companyId")String companyId, @Param("userId")String userId, @Param("accountIds") List<Long> accountIds, @Param("signature") String signature, @Param("cost") BigDecimal cost);
+
 }

+ 76 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/ByteDanceVideoReportDailyMapper.xml

@@ -467,9 +467,17 @@
             <include refid="selectSql"></include>
         from ctop_bytedance_video_report_daily a
         left join (select material_id,clip_id,shot_id,plan_id,plane_id from ctop_material_ascription group by material_id) f on a.signature = f.material_id
+        left join ctop_bytedance_account_video_map p on a.signature = p.signature
         where stat_datetime &gt;= #{startDate}
         and stat_datetime &lt;= #{endDate}
         and f.material_id is not null
+        <if test="accountIds != null">
+        and p.account_id in
+        <foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
+         #{item}
+        </foreach>
+        </if>
+
         <if test="signature != null and signature != '' ">
             and a.signature = #{signature}
         </if>
@@ -485,10 +493,19 @@
         <include refid="selectSql"></include>
         from ctop_bytedance_video_report_daily a
         left join (select material_id,clip_id,shot_id,plan_id,plane_id from ctop_material_ascription group by material_id) f on a.signature = f.material_id
+        left join ctop_bytedance_account_video_map p on a.signature = p.signature
         where stat_datetime &gt;= #{startDate}
         and stat_datetime &lt;= #{endDate}
         and a.company_id = #{companyId}
         and f.material_id is not null
+
+        <if test="accountIds != null">
+        and p.account_id in
+        <foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+        </if>
+
         <if test="signature != null and signature != '' ">
             and a.signature = #{signature}
         </if>
@@ -504,11 +521,19 @@
         <include refid="selectSql"></include>
         from ctop_bytedance_video_report_daily a
         left join (select material_id,clip_id,shot_id,plan_id,plane_id from ctop_material_ascription group by material_id) f on a.signature = f.material_id
+        left join ctop_bytedance_account_video_map p on a.signature = p.signature
         where stat_datetime &gt;= #{startDate}
         and stat_datetime &lt;= #{endDate}
         and a.company_id = #{companyId}
         and f.material_id is not null
         and f.plane = #{userId}
+        and f.material_id is not null
+        <if test="accountIds != null">
+        and p.account_id in
+        <foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+        </if>
         <if test="signature != null and signature != '' ">
             and a.signature = #{signature}
         </if>
@@ -524,11 +549,19 @@
         <include refid="selectSql"></include>
         from ctop_bytedance_video_report_daily a
         left join (select material_id,clip_id,shot_id,plan_id,plane_id from ctop_material_ascription group by material_id) f on a.signature = f.material_id
+        left join ctop_bytedance_account_video_map p on a.signature = p.signature
         where stat_datetime &gt;= #{startDate}
         and stat_datetime &lt;= #{endDate}
         and a.company_id = #{companyId}
         and f.material_id is not null
         and f.plan = #{userId}
+        and f.material_id is not null
+        <if test="accountIds != null">
+        and p.account_id in
+        <foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+        </if>
         <if test="signature != null and signature != '' ">
             and a.signature = #{signature}
         </if>
@@ -544,11 +577,18 @@
         <include refid="selectSql"></include>
         from ctop_bytedance_video_report_daily a
         left join (select material_id,clip_id,shot_id,plan_id,plane_id from ctop_material_ascription group by material_id) f on a.signature = f.material_id
+        left join ctop_bytedance_account_video_map p on a.signature = p.signature
         where stat_datetime &gt;= #{startDate}
         and stat_datetime &lt;= #{endDate}
         and a.company_id = #{companyId}
         and f.material_id is not null
         and f.clip = #{userId}
+        <if test="accountIds != null">
+        and p.account_id in
+        <foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+        </if>
         <if test="signature != null and signature != '' ">
             and a.signature = #{signature}
         </if>
@@ -564,11 +604,18 @@
         <include refid="selectSql"></include>
         from ctop_bytedance_video_report_daily a
         left join (select material_id,clip_id,shot_id,plan_id,plane_id from ctop_material_ascription group by material_id) f on a.signature = f.material_id
+        left join ctop_bytedance_account_video_map p on a.signature = p.signature
         where stat_datetime &gt;= #{startDate}
         and stat_datetime &lt;= #{endDate}
         and a.company_id = #{companyId}
         and f.material_id is not null
         and f.shot = #{userId}
+        <if test="accountIds != null">
+        and p.account_id in
+        <foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+        </if>
         <if test="signature != null and signature != '' ">
             and a.signature = #{signature}
         </if>
@@ -812,5 +859,34 @@
         </if>
     </select>
 
+    <select id="accountVideoMap" resultType="cn.com.ctop.toutiao.modules.report.DTO.AccountVideoDTO">
+            select
+            a.account_id,b.signature
+        FROM
+        ctop_bytedance_report_material_daily a
+        left join ctop_bytedance_video_info b on a.material_id = b.material_id
+        where a.image_mode in ('CREATIVE_IMAGE_MODE_VIDEO','CREATIVE_IMAGE_MODE_VIDEO_VERTICAL')
+        and b.signature is not null
+        group by a.account_id,b.signature
+    </select>
+
+    <insert id="replaceIntoAccountVideoMapBatch">
+        replace into
+        ctop_bytedance_account_video_map
+        (
+            account_id,
+            signature
+        )
+        values
+        <foreach collection="accountVideoDTOList" item="accountVideo" separator=",">
+        (
+            #{accountVideo.accountId},
+            #{accountVideo.signature}
+        )
+        </foreach>
+    </insert>
+
+
+
 
 </mapper>

+ 4 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/ByteDanceVideoReportDailyServiceImpl.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.toutiao.modules.report.service.impl;
 
+import cn.com.ctop.toutiao.modules.report.DTO.AccountVideoDTO;
 import cn.com.ctop.toutiao.modules.report.entity.ByteDanceVideoReportDaily;
 import cn.com.ctop.toutiao.modules.report.mapper.ByteDanceVideoReportDailyMapper;
 import cn.com.ctop.toutiao.modules.report.service.IByteDanceVideoReportDailyService;
@@ -247,5 +248,8 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
         }
     }
 
+    public void accountVideoMap(){
+        List<AccountVideoDTO> accountVideoDTOList = byteDanceVideoReportDailyMapper.accountVideoMap();
+    }
 
 }