|
@@ -673,11 +673,28 @@
|
|
|
|
|
|
|
|
|
<insert id="loadAccountDailyReport">
|
|
|
- LOAD DATA local INFILE #{localPath}
|
|
|
- INTO TABLE ctop_kuaishou_report_daily_account
|
|
|
- FIELDS TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n'
|
|
|
- IGNORE 1 LINES
|
|
|
- (ad_scene,
|
|
|
+ LOAD
|
|
|
+ DATA local INFILE
|
|
|
+ #{localPath}
|
|
|
+ INTO
|
|
|
+ TABLE
|
|
|
+ ctop_kuaishou_report_daily_account
|
|
|
+ FIELDS
|
|
|
+ TERMINATED
|
|
|
+ BY
|
|
|
+ ','
|
|
|
+ enclosed
|
|
|
+ by
|
|
|
+ '"'
|
|
|
+ LINES
|
|
|
+ TERMINATED
|
|
|
+ BY
|
|
|
+ '\n'
|
|
|
+ IGNORE
|
|
|
+ 1
|
|
|
+ LINES
|
|
|
+ (
|
|
|
+ ad_scene,
|
|
|
charge,
|
|
|
photo_show,
|
|
|
aclick,
|
|
@@ -768,14 +785,16 @@
|
|
|
event_appoint_jump_click_cost,
|
|
|
event_appoint_jump_click_ratio
|
|
|
)
|
|
|
- set account_id = #{accountId}
|
|
|
+ set
|
|
|
+ account_id
|
|
|
+ =
|
|
|
+ #{accountId}
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
<select id="selectCost" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
- select
|
|
|
- sum(charge) cost,
|
|
|
- stat_date statDate
|
|
|
+ select sum(charge) cost,
|
|
|
+ stat_date statDate
|
|
|
from ctop_kuaishou_report_daily_account
|
|
|
where account_id = #{accountId}
|
|
|
and stat_date >= #{startDate}
|
|
@@ -1189,11 +1208,9 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getRoleCodeByUserId" resultType="string">
|
|
|
- select
|
|
|
- role_code
|
|
|
- from
|
|
|
- sys_user_role a
|
|
|
- left join sys_role b on a.role_id = b.id
|
|
|
+ select role_code
|
|
|
+ from sys_user_role a
|
|
|
+ left join sys_role b on a.role_id = b.id
|
|
|
where a.user_id = #{userId}
|
|
|
</select>
|
|
|
|
|
@@ -1311,13 +1328,10 @@
|
|
|
|
|
|
|
|
|
<select id="getVideoUrl" resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaishouVideoInfoDTO">
|
|
|
- select
|
|
|
- url as url,
|
|
|
- cover_url as coverUrl
|
|
|
- from
|
|
|
- ctop_kuaishou_video_get
|
|
|
- where photo_id = #{photoId}
|
|
|
- limit 1
|
|
|
+ select url as url,
|
|
|
+ cover_url as coverUrl
|
|
|
+ from ctop_kuaishou_video_get
|
|
|
+ where photo_id = #{photoId} limit 1
|
|
|
</select>
|
|
|
|
|
|
<select id="getUserProjectAccountIds" resultType="long">
|
|
@@ -1453,47 +1467,48 @@
|
|
|
|
|
|
<select id="queryEveryDayDataForAccount"
|
|
|
resultType="cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouReportAccountHourly">
|
|
|
- SELECT stat_date,
|
|
|
- account_id,
|
|
|
- SUM(charge) as 'charge',
|
|
|
- SUM(photo_show) as 'photoShow',
|
|
|
- SUM(photo_click) as 'photoClick',
|
|
|
- SUM(aclick) as 'aclick',
|
|
|
- SUM(bclick) as 'bclick',
|
|
|
- SUM(photo_share) as 'photoShare',
|
|
|
- SUM(photo_comment) as 'photoComment',
|
|
|
- SUM(photo_like) as 'photoLike',
|
|
|
- SUM(follow) as 'follow',
|
|
|
- SUM(cancel_follow) as 'cancelFollow',
|
|
|
- SUM(report) as 'report',
|
|
|
- SUM(block) as 'block',
|
|
|
- SUM(negative) as 'negative',
|
|
|
- SUM(download_started) as 'downloadStarted',
|
|
|
- SUM(download_completed) as 'downloadCompleted',
|
|
|
- SUM(activation) as 'activation',
|
|
|
- SUM(submit) as 'submit',
|
|
|
- SUM(event_pay_first_day) as 'eventPayFirstDay',
|
|
|
- SUM(event_pay_purchase_amount_first_day) as 'eventPayPurchaseAmountFirstDay',
|
|
|
- SUM(event_pay) as 'eventPay',
|
|
|
- SUM(event_pay_purchase_amount) as 'eventPayPurchaseAmount',
|
|
|
- SUM(event_register) as 'eventRegister',
|
|
|
- SUM(event_jin_jian_app) as 'eventJinJianApp',
|
|
|
- SUM(event_credit_grant_app) as 'eventCreditGrantApp',
|
|
|
- SUM(event_order_paid) as 'eventOrderPaid',
|
|
|
- SUM(event_order_paid_purchase_amount) as 'eventOrderPaidPurchaseAmount',
|
|
|
- SUM(event_jin_jian_landing_page) as 'eventJinJianLandingPage',
|
|
|
- SUM(event_credit_grant_landing_page) as 'eventCreditGrantLandingPage',
|
|
|
- SUM(event_next_day_stay) as 'eventNextDayStay',
|
|
|
- SUM(form_count) as 'formCount',
|
|
|
- ROUND(SUM(play_3s_ratio * photo_show)) as 'play3sCount'
|
|
|
- FROM ctop_kuaishou_report_daily_account
|
|
|
- WHERE stat_date = DATE_FORMAT(date_sub(now(), interval 1 day), '%Y-%m-%d')
|
|
|
- GROUP BY account_id
|
|
|
+ SELECT stat_date,
|
|
|
+ account_id,
|
|
|
+ SUM(charge) as 'charge',
|
|
|
+ SUM(photo_show) as 'photoShow',
|
|
|
+ SUM(photo_click) as 'photoClick',
|
|
|
+ SUM(aclick) as 'aclick',
|
|
|
+ SUM(bclick) as 'bclick',
|
|
|
+ SUM(photo_share) as 'photoShare',
|
|
|
+ SUM(photo_comment) as 'photoComment',
|
|
|
+ SUM(photo_like) as 'photoLike',
|
|
|
+ SUM(follow) as 'follow',
|
|
|
+ SUM(cancel_follow) as 'cancelFollow',
|
|
|
+ SUM(report) as 'report',
|
|
|
+ SUM(block) as 'block',
|
|
|
+ SUM(negative) as 'negative',
|
|
|
+ SUM(download_started) as 'downloadStarted',
|
|
|
+ SUM(download_completed) as 'downloadCompleted',
|
|
|
+ SUM(activation) as 'activation',
|
|
|
+ SUM(submit) as 'submit',
|
|
|
+ SUM(event_pay_first_day) as 'eventPayFirstDay',
|
|
|
+ SUM(event_pay_purchase_amount_first_day) as 'eventPayPurchaseAmountFirstDay',
|
|
|
+ SUM(event_pay) as 'eventPay',
|
|
|
+ SUM(event_pay_purchase_amount) as 'eventPayPurchaseAmount',
|
|
|
+ SUM(event_register) as 'eventRegister',
|
|
|
+ SUM(event_jin_jian_app) as 'eventJinJianApp',
|
|
|
+ SUM(event_credit_grant_app) as 'eventCreditGrantApp',
|
|
|
+ SUM(event_order_paid) as 'eventOrderPaid',
|
|
|
+ SUM(event_order_paid_purchase_amount) as 'eventOrderPaidPurchaseAmount',
|
|
|
+ SUM(event_jin_jian_landing_page) as 'eventJinJianLandingPage',
|
|
|
+ SUM(event_credit_grant_landing_page) as 'eventCreditGrantLandingPage',
|
|
|
+ SUM(event_next_day_stay) as 'eventNextDayStay',
|
|
|
+ SUM(form_count) as 'formCount',
|
|
|
+ SUM(play_3s_ratio * aclick) as 'play3sCount'
|
|
|
+ FROM ctop_kuaishou_report_daily_account
|
|
|
+ WHERE stat_date = DATE_FORMAT(date_sub(now(), interval 1 day), '%Y-%m-%d')
|
|
|
+ GROUP BY account_id
|
|
|
</select>
|
|
|
<select id="getSumChargeByAccountIdAndStatDate" resultType="java.math.BigDecimal">
|
|
|
- select sum(charge) from ctop_kuaishou_report_daily_account
|
|
|
+ select sum(charge)
|
|
|
+ from ctop_kuaishou_report_daily_account
|
|
|
where account_id = #{accountId}
|
|
|
- and stat_date = #{statDate}
|
|
|
+ and stat_date = #{statDate}
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|