|
@@ -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 >= #{startDate}
|
|
|
and stat_datetime <= #{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 >= #{startDate}
|
|
|
and stat_datetime <= #{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 >= #{startDate}
|
|
|
and stat_datetime <= #{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 >= #{startDate}
|
|
|
and stat_datetime <= #{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 >= #{startDate}
|
|
|
and stat_datetime <= #{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 >= #{startDate}
|
|
|
and stat_datetime <= #{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>
|