|
|
@@ -7,6 +7,55 @@
|
|
|
expire_time = #{expireTime}
|
|
|
where uuid = #{uuid}
|
|
|
</update>
|
|
|
+ <update id="updateRunStatus">
|
|
|
+ replace into deepthink.bytedance_advertiser_task
|
|
|
+ (id, task_id, task_name, task_status, task_type, advertiser_id, advertiser_name, advertiser_name_update, template_value_name, advertiser_avatar_url, avatar_signature, media_type, app_id, app_name, instance_id, stat_date, site_id, movie_id, distributor_id, recharge_template_id, recharge_template_name, callback_id, callback_name, user_id, lift_assistant, rewarded_ad, remark, `index`, create_time, update_time, run_status, fail_reason, movie_name)
|
|
|
+ select id, task_id, task_name, task_status, task_type, advertiser_id, advertiser_name, advertiser_name_update, template_value_name, advertiser_avatar_url, avatar_signature, media_type, app_id, app_name, instance_id, stat_date, site_id, movie_id, distributor_id, recharge_template_id, recharge_template_name, callback_id, callback_name, user_id, lift_assistant, rewarded_ad, remark, `index`, create_time, update_time,
|
|
|
+ case when plat_type=7 and ('AUDIT_PASS' = avatar_status and 'STATUS_ENABLE' = advertiser_status) then 1
|
|
|
+ when plat_type=7 and ('FAIL' = advertiser_status or 'STATUS_CONFIRM_FAIL_END' = advertiser_status or 'AUDIT_REJECT' = avatar_status or 'FAIL' = avatar_status) then -1
|
|
|
+ when plat_type=7 then 0
|
|
|
+ when media_type=1 and (('AUDIT_ACCEPTED' = app_status or 'ADD_LINK_SUCCESS' = app_status or 'SHARE_SUCCESS' = app_status) and 'AUDIT_ACCEPTED' = site_status and (avatar_status is null or 'AUDIT_PASS'= avatar_status) and (advertiser_status is null or 'STATUS_ENABLE' = advertiser_status)) then 1
|
|
|
+ when media_type=1 and (app_status is null or 'AUDIT_REJECTED' = app_status or 'FAIL' = app_status or 'ADD_LINK_FAIL' = app_status or 'SHARE_FAIL' = app_status or site_status is null or 'AUDIT_REJECTED' = site_status or 'AUDIT_REJECT' = avatar_status or 'FAIL' = avatar_status or 'FAIL' = advertiser_status or 'STATUS_CONFIRM_FAIL_END' = advertiser_status) then -1
|
|
|
+ when media_type=1 then 0
|
|
|
+ when media_type=3 and ('ENABLE' = site_status or 'AUDIT_ACCEPTED' = site_status) AND '1'=link_status then 1
|
|
|
+ when media_type=3 and ('CREATE_FAILED' = site_status OR 'AUDIT_REJECTED' = site_status) then -1
|
|
|
+ else 0 end as run_status,
|
|
|
+ concat(
|
|
|
+ case when plat_type=7 and ( 'FAIL' = advertiser_status or 'STATUS_CONFIRM_FAIL_END' = advertiser_status) then '账户 '
|
|
|
+ when plat_type != 7 and media_type=1 and ('FAIL' = advertiser_status or 'STATUS_CONFIRM_FAIL_END' = advertiser_status) then '账户 '
|
|
|
+ else '' end,
|
|
|
+ case when plat_type=7 and ( 'AUDIT_REJECT' = avatar_status or 'FAIL' = avatar_status) then '头像 '
|
|
|
+ when plat_type != 7 and media_type=1 and ('AUDIT_REJECT' = avatar_status or 'FAIL' = avatar_status) then '头像 '
|
|
|
+ else '' end,
|
|
|
+ case when plat_type != 7 and media_type=1 and (app_status is null or 'AUDIT_REJECTED' = app_status or 'FAIL' = app_status or 'ADD_LINK_FAIL' = app_status or 'SHARE_FAIL' = app_status) then '小程序 '
|
|
|
+ else '' end,
|
|
|
+ case when plat_type != 7 and media_type=1 and (site_status is null or 'AUDIT_REJECTED' = site_status) then '落地页 '
|
|
|
+ when plat_type != 7 and media_type=3 and ('CREATE_FAILED' = site_status OR 'AUDIT_REJECTED' = site_status) then '落地页 '
|
|
|
+ else '' end
|
|
|
+ ) as fail_reason, standard_movie_name
|
|
|
+ from (select t1.*, t7.standard_movie_name,
|
|
|
+ t2.audit_status as 'app_status',
|
|
|
+ t3.`status` as 'site_status',
|
|
|
+ t4.avatar_status as 'avatar_status',
|
|
|
+ t5.advertiser_status as 'advertiser_status',
|
|
|
+ t6.status as 'link_status',
|
|
|
+ app.plat_type
|
|
|
+ from (select * from deepthink.bytedance_advertiser_task where create_time >= #{startTime} and create_time <= #{endTime}) t1
|
|
|
+ left join deepthink.mini_app_info app on t1.app_id = app.app_id
|
|
|
+ LEFT JOIN (select * from deepthink.advertiser_app_list where create_time >= #{startTime} and create_time <= #{endTime}) t2
|
|
|
+ ON t1.instance_id = t2.instance_id AND t1.advertiser_id = t2.advertiser_id and t1.task_id = t2.task_id
|
|
|
+ LEFT JOIN (select * from deepthink.advertiser_tools_site where create_time >= #{startTime} and create_time <= #{endTime}) t3
|
|
|
+ ON t1.site_id = t3.site_id AND t1.advertiser_id = t3.advertiser_id
|
|
|
+ LEFT JOIN (select * from deepthink.advertiser_avatar where create_time >= #{startTime} and create_time <= #{endTime}) t4
|
|
|
+ ON t1.advertiser_id = t4.advertiser_id
|
|
|
+ LEFT JOIN (select * from deepthink.advertiser_name_info where create_time >= #{startTime} and create_time <= #{endTime}) t5
|
|
|
+ ON t1.advertiser_id = t5.advertiser_id
|
|
|
+ LEFT JOIN (select * from deepthink.bytedance_advertiser_task_link where create_time >= #{startTime} and create_time <= #{endTime}) t6
|
|
|
+ ON t1.task_id = t6.task_id AND t1.advertiser_id = t6.advertiser_id
|
|
|
+ LEFT JOIN (select standard_movie_id, standard_movie_name from deepthink.all_moive group by standard_movie_id, standard_movie_name) t7
|
|
|
+ on t1.movie_id = t7.standard_movie_id
|
|
|
+ ) t
|
|
|
+ </update>
|
|
|
|
|
|
|
|
|
<select id="refreshList" resultType="com.alibaba.fastjson.JSONObject">
|