|
@@ -157,7 +157,15 @@
|
|
|
'image' as materialType
|
|
|
from ctop_bytedance_image_info image
|
|
|
where account_id = #{accountId}
|
|
|
- and image.type = #{imageMode}
|
|
|
+ <if test="imageMode = '1'">
|
|
|
+ and image.type = '1'
|
|
|
+ </if>
|
|
|
+ <if test="imageMode = '2'">
|
|
|
+ and (image.type = '2' or image.type = '4')
|
|
|
+ </if>
|
|
|
+ <if test="imageMode = '3'">
|
|
|
+ and (image.type = '3' or image.type = '4')
|
|
|
+ </if>
|
|
|
and image.create_time >= #{startTime}
|
|
|
and image.create_time <= #{endTime}
|
|
|
having creativeCnt <= #{creativeCnt}
|
|
@@ -188,7 +196,16 @@
|
|
|
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_image_info a where a.account_id = #{accountId} and a.type = #{imageMode})as image
|
|
|
+ left join (select distinct a.* from ctop_bytedance_image_info a where 1 = 1 and a.account_id = #{accountId}
|
|
|
+ <if test="imageMode = '1'">
|
|
|
+ and a.type = '1'
|
|
|
+ </if>
|
|
|
+ <if test="imageMode = '2'">
|
|
|
+ and (a.type = '2' or a.type = '4')
|
|
|
+ </if>
|
|
|
+ <if test="imageMode = '3'">
|
|
|
+ and (a.type = '3' or a.type = '4')
|
|
|
+ </if>)as image
|
|
|
on a.material_id = image.material_id
|
|
|
where 1=1
|
|
|
and a.totalCost > 500
|
|
@@ -221,7 +238,16 @@
|
|
|
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_image_info a where a.account_id =#{accountId} and a.type = #{imageMode}) as image
|
|
|
+ left join (select distinct a.* from ctop_bytedance_image_info a where 1 = 1 and a.account_id =#{accountId}
|
|
|
+ <if test="imageMode = '1'">
|
|
|
+ and a.type = '1'
|
|
|
+ </if>
|
|
|
+ <if test="imageMode = '2'">
|
|
|
+ and (a.type = '2' or a.type = '4')
|
|
|
+ </if>
|
|
|
+ <if test="imageMode = '3'">
|
|
|
+ and (a.type = '3' or a.type = '4')
|
|
|
+ </if>) as image
|
|
|
on a.material_id = image.material_id
|
|
|
where 1=1
|
|
|
and a.totalCost <= 100
|