|
@@ -70,7 +70,7 @@
|
|
|
resultType="org.jeecg.modules.bytedance.advertise.entity.ByteDanceVideoInfo">
|
|
|
select distinct video.*,
|
|
|
(select count(1) from ctop_bytedance_ai_video_creative_log l where l.video_code = video.signature and l.account_id = video.account_id and l.state_date = #{now}) as creativeNum,
|
|
|
- (select count(1) from ctop_bytedance_creative c where c.video_id = video.vid and c.account_id = #{accountId}) as creativeCnt,
|
|
|
+ (select count(1) from ctop_bytedance_creative c where c.video_id = video.vid and c.account_id = '${accountId}') as creativeCnt,
|
|
|
(select count(1) from ctop_bytedance_video_slogen_info s where s.video_code = video.signature) as slogens,
|
|
|
'video' As materialType
|
|
|
from ctop_bytedance_video_info video
|
|
@@ -78,7 +78,7 @@
|
|
|
<if test="projectId !=null and projectId != ''">
|
|
|
and cmi.project_id = #{projectId}
|
|
|
</if>
|
|
|
- where account_id = '${accountId}'
|
|
|
+ where account_id = #{accountId}
|
|
|
and cmi.code is not null
|
|
|
and cmi.status = 1
|
|
|
and cmi.offline_flag = 0
|
|
@@ -94,18 +94,18 @@
|
|
|
select distinct video.*,
|
|
|
a.totalCost,
|
|
|
(select count(1) from ctop_bytedance_ai_video_creative_log l where l.video_code = video.signature and l.account_id = video.account_id and l.state_date = #{now}) as creativeNum,
|
|
|
- (select count(1) from ctop_bytedance_creative c where c.video_id = video.vid and c.account_id = #{accountId}) as creativeCnt,
|
|
|
+ (select count(1) from ctop_bytedance_creative c where c.video_id = video.vid and c.account_id = '${accountId}') as creativeCnt,
|
|
|
(select count(1) from ctop_bytedance_video_slogen_info s where s.video_code = video.signature ) as slogens,
|
|
|
'video' As materialType
|
|
|
from (select report.material_id, sum(cost) as totalCost
|
|
|
from ctop_bytedance_report_material_daily report
|
|
|
left join ctop_user_allocation cua on report.account_id = cua.account_id
|
|
|
- where cua.account_id = '${accountId}'
|
|
|
+ where cua.account_id = #{accountId}
|
|
|
and report.stat_datetime >= #{startTime}
|
|
|
and report.stat_datetime <= #{endTime}
|
|
|
group by report.material_id
|
|
|
order by sum(report.cost) desc ) a
|
|
|
- left join (select distinct a.* from ctop_bytedance_video_info a where a.account_id = '${accountId}' and a.type = #{imageMode} and a.status = 1)as video
|
|
|
+ left join (select distinct a.* from ctop_bytedance_video_info a where a.account_id = #{accountId} and a.type = #{imageMode} and a.status = 1)as video
|
|
|
on a.material_id = video.material_id
|
|
|
left join ctop_material_info cmi on cmi.code = video.signature
|
|
|
<if test="projectId !=null and projectId != ''">
|
|
@@ -126,18 +126,18 @@
|
|
|
select distinct video.*,
|
|
|
a.totalCost,
|
|
|
(select count(1) from ctop_bytedance_ai_video_creative_log l where l.video_code = video.signature and l.account_id = video.account_id and l.state_date = #{now}) as creativeNum,
|
|
|
- (select count(1) from ctop_bytedance_creative c where c.video_id = video.vid and c.account_id = #{accountId}) as creativeCnt,
|
|
|
+ (select count(1) from ctop_bytedance_creative c where c.video_id = video.vid and c.account_id = '${accountId}') as creativeCnt,
|
|
|
(select count(1) from ctop_bytedance_video_slogen_info s where s.video_code = video.signature) as slogens,
|
|
|
'video' As materialType
|
|
|
from (select report.material_id, sum(cost) as totalCost
|
|
|
from ctop_bytedance_report_material_daily report
|
|
|
left join ctop_user_allocation cua on report.account_id = cua.account_id
|
|
|
- where cua.account_id = '${accountId}'
|
|
|
+ where cua.account_id = #{accountId}
|
|
|
and report.stat_datetime >= #{startTime}
|
|
|
and report.stat_datetime <= #{endTime}
|
|
|
group by report.material_id
|
|
|
order by sum(report.cost) desc ) a
|
|
|
- left join (select distinct a.* from ctop_bytedance_video_info a where a.account_id = '${accountId}' and a.type = #{imageMode} and a.status = 1)as video
|
|
|
+ left join (select distinct a.* from ctop_bytedance_video_info a where a.account_id = #{accountId} and a.type = #{imageMode} and a.status = 1)as video
|
|
|
on a.material_id = video.material_id
|
|
|
left join ctop_material_info cmi on cmi.code = video.signature
|
|
|
<if test="projectId !=null and projectId != ''">
|
|
@@ -157,15 +157,14 @@
|
|
|
|
|
|
<!-- 图片 上新 遗漏 -->
|
|
|
<select id="imageListByParams" resultType="org.jeecg.modules.bytedance.advertise.entity.ByteDanceVideoInfo">
|
|
|
- select distinct image.*,
|
|
|
+ select distinct image.*,'image' as materialType,
|
|
|
(select count(1) from ctop_bytedance_ai_video_creative_log l
|
|
|
where l.video_code = image.signature
|
|
|
and l.account_id = image.account_id
|
|
|
and l.state_date = #{now}) as creativeNum,
|
|
|
(select count(1) from ctop_bytedance_creative c
|
|
|
where SUBSTRING_INDEX(SUBSTRING_INDEX(image_ids,'["',-1),'"]',1) in(image.id)
|
|
|
- and c.account_id = '${accountId}') as creativeCnt,
|
|
|
- 'image' as materialType
|
|
|
+ and c.account_id = '${accountId}') as creativeCnt
|
|
|
from ctop_bytedance_image_info image
|
|
|
where account_id = #{accountId}
|
|
|
<if test="imageMode == '1'.toString()">
|
|
@@ -177,6 +176,7 @@
|
|
|
<if test="imageMode == '3'.toString()">
|
|
|
and image.type = '3'
|
|
|
</if>
|
|
|
+ and account_id is NOT NULL
|
|
|
and image.image_create_time >= #{startTime}
|
|
|
and image.image_create_time <= #{endTime}
|
|
|
having creativeCnt <= #{creativeCnt}
|
|
@@ -189,7 +189,7 @@
|
|
|
<!-- 图片 跑量-->
|
|
|
<select id="imageTopMatByParams" resultType="org.jeecg.modules.bytedance.advertise.entity.ByteDanceVideoInfo">
|
|
|
select distinct image.*,
|
|
|
- a.totalCost,
|
|
|
+ a.totalCost,'image' as materialType,
|
|
|
(select count(1) from ctop_bytedance_ai_video_creative_log l
|
|
|
where l.video_code = image.signature
|
|
|
and l.account_id = image.account_id
|
|
@@ -198,8 +198,7 @@
|
|
|
from ctop_bytedance_creative c
|
|
|
where SUBSTRING_INDEX(SUBSTRING_INDEX(image_ids,'["',-1),'"]',1) in(image.id)
|
|
|
and c.account_id = '${accountId}') as creativeCnt
|
|
|
- from (select report.material_id, sum(cost) as totalCost,
|
|
|
- 'image' as materialType
|
|
|
+ from (select report.material_id, sum(cost) as totalCost
|
|
|
from ctop_bytedance_report_image_daily report
|
|
|
left join ctop_user_allocation cua on report.account_id = cua.account_id
|
|
|
where cua.account_id = #{accountId}
|
|
@@ -219,6 +218,7 @@
|
|
|
</if>)as image
|
|
|
on a.material_id = image.material_id
|
|
|
where 1=1
|
|
|
+ and account_id is NOT NULL
|
|
|
and a.totalCost > 500
|
|
|
having creativeCnt <= 100
|
|
|
and creativeNum = 0
|
|
@@ -230,7 +230,7 @@
|
|
|
<!-- 图片 打捞-->
|
|
|
<select id="imageHistoryMatByParams" resultType="org.jeecg.modules.bytedance.advertise.entity.ByteDanceVideoInfo">
|
|
|
select distinct image.*,
|
|
|
- a.totalCost,
|
|
|
+ a.totalCost,'image' as materialType,
|
|
|
(select count(1)
|
|
|
from ctop_bytedance_ai_video_creative_log l
|
|
|
where l.video_code = image.signature
|
|
@@ -240,8 +240,7 @@
|
|
|
from ctop_bytedance_creative c
|
|
|
where SUBSTRING_INDEX(SUBSTRING_INDEX(image_ids,'["',-1),'"]',1) in(image.id)
|
|
|
and c.account_id = '${accountId}') as creativeCnt
|
|
|
- from (select report.material_id, sum(cost) as totalCost,
|
|
|
- 'image' as materialType
|
|
|
+ from (select report.material_id, sum(cost) as totalCost
|
|
|
from ctop_bytedance_report_image_daily report
|
|
|
left join ctop_user_allocation cua on report.account_id = cua.account_id
|
|
|
where cua.account_id = #{accountId}
|
|
@@ -261,6 +260,7 @@
|
|
|
</if>) as image
|
|
|
on a.material_id = image.material_id
|
|
|
where 1=1
|
|
|
+ and account_id is NOT NULL
|
|
|
and a.totalCost <= 100
|
|
|
having creativeCnt < 20
|
|
|
and creativeNum = 0
|