|
@@ -143,6 +143,27 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <!-- 查看 快手 有效 计划 组-->
|
|
|
+ <select id="getKuaiShouAccountBaseByUserId" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
+ SELECT abi.account_id ,
|
|
|
+ SUM(abi.new_effect_num) as newEffectNum,
|
|
|
+ SUM(abi.new_campaign_num) as newCampaignNum,
|
|
|
+ SUM(abi.new_unit_num) as newUnitNum,
|
|
|
+ SUM( abi.new_video_num ) AS newVideoNum,
|
|
|
+ SUM( abi.new_hot_num ) AS newHotNum
|
|
|
+ from application.app_kuaishou_account_base_info_d abi,
|
|
|
+ `jeecg-boot`.ctop_user_allocation u
|
|
|
+ WHERE abi.account_id = u.account_id
|
|
|
+ and u.account_status = 0
|
|
|
+ and abi.user_id = #{userId}
|
|
|
+ <if test="startDate != null and startDate != '' ">
|
|
|
+ and abi.stat_date >= #{startDate}
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null and endDate != '' ">
|
|
|
+ and abi.stat_date <= #{endDate}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
|
|
|
|
|
|
<!-- 快手 快手-查询账户数据信息 -->
|
|
@@ -151,32 +172,13 @@
|
|
|
SUM( d.charge ) totalCost,
|
|
|
COUNT(DISTINCT d.account_id) accountNum,
|
|
|
d.user_id as userId,
|
|
|
- (SELECT u.realname from `jeecg-boot`.sys_user u where u.id = d.user_id) as userName,
|
|
|
- IFNULL(m.newEffectNum,0) as newEffectNum,
|
|
|
- IFNULL(m.newCampaignNum,0) as newCampaignNum,
|
|
|
- IFNULL(m.newUnitNum,0) as newUnitNum
|
|
|
+ (SELECT u.realname from `jeecg-boot`.sys_user u where u.id = d.user_id) as userName
|
|
|
FROM
|
|
|
application.kuaishou_account_report_daily_dw d
|
|
|
- LEFT JOIN
|
|
|
- (
|
|
|
- SELECT abi.account_id ,
|
|
|
- SUM(abi.new_effect_num) as newEffectNum,
|
|
|
- SUM(abi.new_campaign_num) as newCampaignNum,
|
|
|
- SUM(abi.new_unit_num) as newUnitNum
|
|
|
- from application.app_kuaishou_account_base_info_d abi
|
|
|
- <where>
|
|
|
- <if test="startDate != null and startDate != '' ">
|
|
|
- and abi.stat_date >= #{startDate}
|
|
|
- </if>
|
|
|
- <if test="endDate != null and endDate != '' ">
|
|
|
- and abi.stat_date <= #{endDate}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- GROUP BY abi.account_id
|
|
|
- ) m
|
|
|
- on d.account_id = m.account_id
|
|
|
+ LEFT JOIN `jeecg-boot`.ctop_user_allocation u on d.account_id = u.account_id
|
|
|
WHERE
|
|
|
d.charge > 0
|
|
|
+ and u.account_status = 0
|
|
|
<if test="startDate != null and startDate != '' ">
|
|
|
and d.stat_date >= #{startDate}
|
|
|
</if>
|
|
@@ -201,6 +203,7 @@
|
|
|
COUNT( DISTINCT d.account_id ) AS accountNum,
|
|
|
d.project_id AS projectId,
|
|
|
d.project_name AS projectName,
|
|
|
+ d.user_id AS userId,
|
|
|
COUNT( DISTINCT d.user_id ) AS userNum,
|
|
|
IFNULL(SUM( d.activation ),0) AS activation,
|
|
|
IF(SUM( d.charge ) / SUM( d.activation ) > 0.0001,ROUND( SUM( d.charge ) / SUM( d.activation ), 2 ),0) AS activationPrice,
|
|
@@ -221,33 +224,13 @@
|
|
|
IFNULL(SUM( d.event_pay_purchase_amount_first_day ),0) AS eventPayPurchaseAmountFirstDay,
|
|
|
IFNULL(SUM( d.event_pay_first_day_roi ),0) AS eventPayFirstDayRoi,
|
|
|
IFNULL(SUM( d.form_count ),0) AS formCount,
|
|
|
- IFNULL(ROUND( SUM( d.charge ) / SUM( d.form_count ), 2 ),0) AS formCountPrice,
|
|
|
- IFNULL(m.newEffectNum,0) AS newEffectNum,
|
|
|
- IFNULL(m.newVideoNum,0) AS newVideoNum,
|
|
|
- IFNULL(m.newHotNum,0) AS newHotNum
|
|
|
+ IFNULL(ROUND( SUM( d.charge ) / SUM( d.form_count ), 2 ),0) AS formCountPrice
|
|
|
FROM
|
|
|
application.kuaishou_account_report_daily_dw d
|
|
|
- LEFT JOIN (
|
|
|
- SELECT
|
|
|
- abi.account_id,
|
|
|
- SUM( abi.new_effect_num ) AS newEffectNum,
|
|
|
- SUM( abi.new_video_num ) AS newVideoNum,
|
|
|
- SUM( abi.new_hot_num ) AS newHotNum
|
|
|
- FROM
|
|
|
- application.app_kuaishou_account_base_info_d abi
|
|
|
- <where>
|
|
|
- <if test="startDate != null and startDate != '' ">
|
|
|
- and abi.stat_date >= #{startDate}
|
|
|
- </if>
|
|
|
- <if test="endDate != null and endDate != '' ">
|
|
|
- and abi.stat_date <= #{endDate}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- GROUP BY abi.account_id
|
|
|
- ) m
|
|
|
- on d.account_id = m.account_id
|
|
|
+ LEFT JOIN `jeecg-boot`.ctop_user_allocation u on d.account_id = u.account_id
|
|
|
WHERE
|
|
|
d.charge > 0
|
|
|
+ and u.account_status = 0
|
|
|
<if test="startDate != null and startDate != '' ">
|
|
|
and d.stat_date >= #{startDate}
|
|
|
</if>
|
|
@@ -278,6 +261,7 @@
|
|
|
d.account_name as accountName,
|
|
|
d.project_id AS projectId,
|
|
|
d.project_name AS projectName,
|
|
|
+ d.user_id AS userId,
|
|
|
COUNT( DISTINCT d.user_id ) AS userNum,
|
|
|
( SELECT u.realname FROM `jeecg-boot`.sys_user u WHERE u.id = d.user_id ) AS userName,
|
|
|
(SELECT u.warning_amount FROM `jeecg-boot`.ctop_user_allocation u where u.account_id = d.account_id) as warningAmount,
|
|
@@ -303,33 +287,13 @@
|
|
|
IFNULL(SUM( d.form_count ),0) AS formCount,
|
|
|
IFNULL(ROUND( SUM( d.charge ) / SUM( d.form_count ), 2 ),0) AS formCountPrice,
|
|
|
IFNULL(SUM(d.`show`),0) as photoShow,
|
|
|
- IFNULL(SUM(d.photo_click),0) as photoClick,
|
|
|
- IFNULL(m.newEffectNum,0) AS newEffectNum,
|
|
|
- IFNULL(m.newVideoNum,0) AS newVideoNum,
|
|
|
- IFNULL(m.newHotNum,0) AS newHotNum
|
|
|
+ IFNULL(SUM(d.photo_click),0) as photoClick
|
|
|
FROM
|
|
|
application.kuaishou_account_report_daily_dw d
|
|
|
- LEFT JOIN (
|
|
|
- SELECT
|
|
|
- abi.account_id,
|
|
|
- SUM( abi.new_effect_num ) AS newEffectNum,
|
|
|
- SUM( abi.new_video_num ) AS newVideoNum,
|
|
|
- SUM( abi.new_hot_num ) AS newHotNum
|
|
|
- FROM
|
|
|
- application.app_kuaishou_account_base_info_d abi
|
|
|
- <where>
|
|
|
- <if test="startDate != null and startDate != '' ">
|
|
|
- and abi.stat_date >= #{startDate}
|
|
|
- </if>
|
|
|
- <if test="endDate != null and endDate != '' ">
|
|
|
- and abi.stat_date <= #{endDate}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- GROUP BY abi.account_id
|
|
|
- ) m
|
|
|
- on d.account_id = m.account_id
|
|
|
+ LEFT JOIN `jeecg-boot`.ctop_user_allocation u on d.account_id = u.account_id
|
|
|
WHERE
|
|
|
d.charge > 0
|
|
|
+ and u.account_status = 0
|
|
|
<if test="startDate != null and startDate != '' ">
|
|
|
and d.stat_date >= #{startDate}
|
|
|
</if>
|