|
@@ -136,17 +136,37 @@
|
|
|
|
|
|
|
|
|
<insert id="loadMaterialDailyReport">
|
|
|
- LOAD DATA local INFILE #{localPath}
|
|
|
- INTO TABLE ctop_kuaishou_report_daily_material
|
|
|
- FIELDS TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n'
|
|
|
- IGNORE 1 LINES
|
|
|
- (photo_id,
|
|
|
- image_token,
|
|
|
- cover_url,
|
|
|
- photo_url,
|
|
|
- @photo_caption,
|
|
|
- @creative_material_type_string,
|
|
|
- @ad_scene,
|
|
|
+ LOAD
|
|
|
+ DATA local INFILE
|
|
|
+ #{localPath}
|
|
|
+ INTO
|
|
|
+ TABLE
|
|
|
+ ctop_kuaishou_report_daily_material
|
|
|
+ FIELDS
|
|
|
+ TERMINATED
|
|
|
+ BY
|
|
|
+ ','
|
|
|
+ enclosed
|
|
|
+ by
|
|
|
+ '"'
|
|
|
+ LINES
|
|
|
+ TERMINATED
|
|
|
+ BY
|
|
|
+ '\n'
|
|
|
+ IGNORE
|
|
|
+ 1
|
|
|
+ LINES
|
|
|
+ (
|
|
|
+ photo_id,
|
|
|
+ image_token,
|
|
|
+ cover_url,
|
|
|
+ photo_url,
|
|
|
+ @
|
|
|
+ photo_caption,
|
|
|
+ @
|
|
|
+ creative_material_type_string,
|
|
|
+ @
|
|
|
+ ad_scene,
|
|
|
charge,
|
|
|
photo_show,
|
|
|
aclick,
|
|
@@ -164,13 +184,15 @@
|
|
|
activation,
|
|
|
submit,
|
|
|
stat_date,
|
|
|
- @stat_hour,
|
|
|
+ @
|
|
|
+ stat_hour,
|
|
|
photo_click,
|
|
|
photo_click_ratio,
|
|
|
action_ratio,
|
|
|
impression_1k_cost,
|
|
|
photo_click_cost,
|
|
|
- @click_1k_cost,
|
|
|
+ @
|
|
|
+ click_1k_cost,
|
|
|
action_cost,
|
|
|
event_pay_first_day,
|
|
|
event_pay_purchase_amount_first_day,
|
|
@@ -201,43 +223,81 @@
|
|
|
event_next_day_stay_ratio,
|
|
|
event_next_day_stay,
|
|
|
play_3s_ratio,
|
|
|
- @event_valid_clues,
|
|
|
- @event_valid_clues_cost,
|
|
|
- @ad_product_cnt,
|
|
|
- @event_goods_view,
|
|
|
- @merchant_reco_fans,
|
|
|
- @event_order_amount_roi,
|
|
|
- @event_goods_view_cost,
|
|
|
- @merchant_reco_fans_cost,
|
|
|
- @event_new_user_pay,
|
|
|
- @event_new_user_pay_cost,
|
|
|
- @event_new_user_pay_ratio,
|
|
|
- @event_button_click,
|
|
|
- @event_button_click_cost,
|
|
|
- @event_button_click_ratio,
|
|
|
- @play_5s_ratio,
|
|
|
- @play_end_ratio,
|
|
|
- @event_order_paid_roi,
|
|
|
- @event_new_user_jinjian_app,
|
|
|
- @event_new_user_jinjian_app_cost,
|
|
|
- @event_new_user_jinjian_app_roi,
|
|
|
- @event_new_user_credit_grant_app,
|
|
|
- @event_new_user_credit_grant_app_cost,
|
|
|
- @event_new_user_credit_grant_app_roi,
|
|
|
- @event_new_user_jinjian_page,
|
|
|
- @event_new_user_jinjian_page_cost,
|
|
|
- @event_new_user_jinjian_page_roi,
|
|
|
- @event_new_user_credit_grant_page,
|
|
|
- @event_new_user_credit_grant_page_cost,
|
|
|
- @event_new_user_credit_grant_page_roi,
|
|
|
- @event_appoint_form,
|
|
|
- @event_appoint_form_cost,
|
|
|
- @event_appoint_form_ratio,
|
|
|
- @event_appoint_jump_click,
|
|
|
- @event_appoint_jump_click_cost,
|
|
|
- @event_appoint_jump_click_ratio
|
|
|
+ @
|
|
|
+ event_valid_clues,
|
|
|
+ @
|
|
|
+ event_valid_clues_cost,
|
|
|
+ @
|
|
|
+ ad_product_cnt,
|
|
|
+ @
|
|
|
+ event_goods_view,
|
|
|
+ @
|
|
|
+ merchant_reco_fans,
|
|
|
+ @
|
|
|
+ event_order_amount_roi,
|
|
|
+ @
|
|
|
+ event_goods_view_cost,
|
|
|
+ @
|
|
|
+ merchant_reco_fans_cost,
|
|
|
+ @
|
|
|
+ event_new_user_pay,
|
|
|
+ @
|
|
|
+ event_new_user_pay_cost,
|
|
|
+ @
|
|
|
+ event_new_user_pay_ratio,
|
|
|
+ @
|
|
|
+ event_button_click,
|
|
|
+ @
|
|
|
+ event_button_click_cost,
|
|
|
+ @
|
|
|
+ event_button_click_ratio,
|
|
|
+ @
|
|
|
+ play_5s_ratio,
|
|
|
+ @
|
|
|
+ play_end_ratio,
|
|
|
+ @
|
|
|
+ event_order_paid_roi,
|
|
|
+ @
|
|
|
+ event_new_user_jinjian_app,
|
|
|
+ @
|
|
|
+ event_new_user_jinjian_app_cost,
|
|
|
+ @
|
|
|
+ event_new_user_jinjian_app_roi,
|
|
|
+ @
|
|
|
+ event_new_user_credit_grant_app,
|
|
|
+ @
|
|
|
+ event_new_user_credit_grant_app_cost,
|
|
|
+ @
|
|
|
+ event_new_user_credit_grant_app_roi,
|
|
|
+ @
|
|
|
+ event_new_user_jinjian_page,
|
|
|
+ @
|
|
|
+ event_new_user_jinjian_page_cost,
|
|
|
+ @
|
|
|
+ event_new_user_jinjian_page_roi,
|
|
|
+ @
|
|
|
+ event_new_user_credit_grant_page,
|
|
|
+ @
|
|
|
+ event_new_user_credit_grant_page_cost,
|
|
|
+ @
|
|
|
+ event_new_user_credit_grant_page_roi,
|
|
|
+ @
|
|
|
+ event_appoint_form,
|
|
|
+ @
|
|
|
+ event_appoint_form_cost,
|
|
|
+ @
|
|
|
+ event_appoint_form_ratio,
|
|
|
+ @
|
|
|
+ event_appoint_jump_click,
|
|
|
+ @
|
|
|
+ event_appoint_jump_click_cost,
|
|
|
+ @
|
|
|
+ event_appoint_jump_click_ratio
|
|
|
)
|
|
|
- set account_id = #{accountId}
|
|
|
+ set
|
|
|
+ account_id
|
|
|
+ =
|
|
|
+ #{accountId}
|
|
|
</insert>
|
|
|
|
|
|
<select id="getPhotoList" resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterialVo">
|
|
@@ -256,24 +316,19 @@
|
|
|
|
|
|
<select id="getPhotoListByDate"
|
|
|
resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterialVo">
|
|
|
- select
|
|
|
- id as id,
|
|
|
- photo_id as photoId
|
|
|
- from
|
|
|
- ctop_kuaishou_report_daily_material
|
|
|
+ select id as id,
|
|
|
+ photo_id as photoId
|
|
|
+ from ctop_kuaishou_report_daily_material
|
|
|
WHERE stat_date = #{statDate}
|
|
|
- and signature is null
|
|
|
+ and signature is null
|
|
|
group by photo_id
|
|
|
</select>
|
|
|
|
|
|
<select id="getVideoGetByPhotoId" resultType="cn.com.ctop.kuaishou.modules.report.entity.VideoGetvo">
|
|
|
- select
|
|
|
- signature as 'signature',
|
|
|
- channel_type as 'channelType'
|
|
|
- from ctop_kuaishou_video_get
|
|
|
- where photo_id = #{photoId}
|
|
|
- and signature is not null
|
|
|
- limit 1
|
|
|
+ select signature as 'signature', channel_type as 'channelType'
|
|
|
+ from ctop_kuaishou_video_get
|
|
|
+ where photo_id = #{photoId}
|
|
|
+ and signature is not null limit 1
|
|
|
</select>
|
|
|
|
|
|
|
|
@@ -348,28 +403,21 @@
|
|
|
</select>
|
|
|
<select id="getSignatureByDate"
|
|
|
resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial">
|
|
|
- select
|
|
|
- distinct signature
|
|
|
- from
|
|
|
- ctop_kuaishou_report_daily_material
|
|
|
- where
|
|
|
- signature is not null
|
|
|
- and
|
|
|
- signature != ''
|
|
|
+ select distinct signature
|
|
|
+ from ctop_kuaishou_report_daily_material
|
|
|
+ where signature is not null
|
|
|
+ and signature != ''
|
|
|
and
|
|
|
stat_date = #{date}
|
|
|
</select>
|
|
|
<select id="getSignatureByDateGroupByProjectId"
|
|
|
resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial">
|
|
|
- select
|
|
|
- distinct signature,project_id
|
|
|
-from
|
|
|
- ctop_kuaishou_report_daily_material report
|
|
|
- left join ctop_user_allocation allocation on report.account_id = allocation.account_id
|
|
|
-where
|
|
|
- signature is not null
|
|
|
- and
|
|
|
- signature != ''
|
|
|
+ select distinct signature,
|
|
|
+ project_id
|
|
|
+ from ctop_kuaishou_report_daily_material report
|
|
|
+ left join ctop_user_allocation allocation on report.account_id = allocation.account_id
|
|
|
+ where signature is not null
|
|
|
+ and signature != ''
|
|
|
and
|
|
|
stat_date = #{date}
|
|
|
</select>
|
|
@@ -387,5 +435,329 @@ where
|
|
|
and signature is not null
|
|
|
group by photo_id
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="labelMaterialListTotal" resultType="java.lang.Long">
|
|
|
+ SELECT IFNULL(COUNT(1),0) FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ t1.user_id
|
|
|
+ FROM ctop_material_tag_info t1
|
|
|
+ LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
|
+ LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.code
|
|
|
+ INNER JOIN(
|
|
|
+ SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
|
|
|
+ LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
|
|
|
+ LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="realname!=null">
|
|
|
+ and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
|
+ </if>
|
|
|
+ <if test="roleCode!=null">
|
|
|
+ AND tt3.role_code = #{roleCode}
|
|
|
+ </if>
|
|
|
+ ) t3 ON t3.id = t1.user_id
|
|
|
+ WHERE t2.parent_id in(60155,60156)
|
|
|
+ AND t4.stat_date >= #{startTime}
|
|
|
+ AND t4.stat_date <= concat(#{endTime},' 23:59:59')
|
|
|
+ GROUP BY t1.user_id
|
|
|
+ ) t
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="labelMaterialList" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
+ SELECT
|
|
|
+ k.user_id,
|
|
|
+ k.realname,
|
|
|
+ k.role_name 'roleName',
|
|
|
+ IFNULL(k1.zhenren_charge,0)as 'zhenrenCharge',
|
|
|
+ IFNULL(k2.zhenren_number,0)as 'zhenrenNumber',
|
|
|
+ IFNULL(ROUND(k1.zhenren_charge/k2.zhenren_number,2),0) as 'zhenrenCost',
|
|
|
+ IFNULL(k3.zhizuo_charge,0)as 'zhizuoCharge',
|
|
|
+ IFNULL(k4.zhizuo_number,0)as 'zhizuoNumber',
|
|
|
+ IFNULL(ROUND(k3.zhizuo_charge/k4.zhizuo_number,2),0) as 'zhizuoCost'
|
|
|
+ FROM
|
|
|
+ (SELECT
|
|
|
+ t1.user_id,
|
|
|
+ t3.realname,
|
|
|
+ t3.role_name
|
|
|
+ FROM ctop_material_tag_info t1
|
|
|
+ LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
|
+ LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.code
|
|
|
+ INNER JOIN(
|
|
|
+ SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
|
|
|
+ LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
|
|
|
+ LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="realname!=null">
|
|
|
+ and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
|
+ </if>
|
|
|
+ <if test="roleCode!=null">
|
|
|
+ AND tt3.role_code = #{roleCode}
|
|
|
+ </if>
|
|
|
+ ) t3 ON t3.id = t1.user_id
|
|
|
+ WHERE t2.parent_id in(60155,60156)
|
|
|
+ AND t4.stat_date >= #{startTime}
|
|
|
+ AND t4.stat_date <= concat(#{endTime},' 23:59:59')
|
|
|
+ GROUP BY t1.user_id
|
|
|
+ ) k
|
|
|
+ LEFT JOIN
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ t1.user_id, SUM(t5.charge) 'zhenren_charge'
|
|
|
+ FROM ctop_material_tag_info t1
|
|
|
+ LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
|
+ LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
|
|
|
+ INNER JOIN(
|
|
|
+ SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
|
|
|
+ LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
|
|
|
+ LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="realname!=null">
|
|
|
+ and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
|
+ </if>
|
|
|
+ <if test="roleCode!=null">
|
|
|
+ AND tt3.role_code = #{roleCode}
|
|
|
+ </if>
|
|
|
+ ) t3 ON t3.id = t1.user_id
|
|
|
+ LEFT JOIN ctop_kuaishou_report_daily_material t5 ON t1.`code` = t5.signature
|
|
|
+ WHERE 1=1
|
|
|
+ AND t4.stat_date >= #{startTime}
|
|
|
+ AND t4.stat_date <= concat(#{endTime},' 23:59:59')
|
|
|
+ AND t2.parent_id = 60155
|
|
|
+ GROUP BY t1.user_id
|
|
|
+ ) k1 ON k1.user_id =k.user_id
|
|
|
+ LEFT JOIN
|
|
|
+ (SELECT user_id, COUNT(1) 'zhenren_number' FROM (
|
|
|
+ SELECT
|
|
|
+ t1.user_id,t4.signature
|
|
|
+ FROM ctop_material_tag_info t1
|
|
|
+ LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
|
+ LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
|
|
|
+ INNER JOIN(
|
|
|
+ SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
|
|
|
+ LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
|
|
|
+ LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="realname!=null">
|
|
|
+ and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
|
+ </if>
|
|
|
+ <if test="roleCode!=null">
|
|
|
+ AND tt3.role_code = #{roleCode}
|
|
|
+ </if>
|
|
|
+ ) t3 ON t3.id = t1.user_id
|
|
|
+ WHERE 1=1
|
|
|
+ AND t4.stat_date >= #{startTime}
|
|
|
+ AND t4.stat_date <= concat(#{endTime},' 23:59:59')
|
|
|
+ AND t2.parent_id = 60155
|
|
|
+ GROUP BY t1.user_id,t1.`code`
|
|
|
+ ) t
|
|
|
+ GROUP BY user_id
|
|
|
+ )k2 ON k.user_id = k2.user_id
|
|
|
+ LEFT JOIN
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ t1.user_id, SUM(t5.charge) 'zhizuo_charge'
|
|
|
+ FROM ctop_material_tag_info t1
|
|
|
+ LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
|
+ LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
|
|
|
+ INNER JOIN(
|
|
|
+ SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
|
|
|
+ LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
|
|
|
+ LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="realname!=null">
|
|
|
+ and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
|
+ </if>
|
|
|
+ <if test="roleCode!=null">
|
|
|
+ AND tt3.role_code = #{roleCode}
|
|
|
+ </if>
|
|
|
+ ) t3 ON t3.id = t1.user_id
|
|
|
+ LEFT JOIN ctop_kuaishou_report_daily_material t5 ON t1.`code` = t5.signature
|
|
|
+ WHERE 1=1
|
|
|
+ AND t4.stat_date >= #{startTime}
|
|
|
+ AND t4.stat_date <= concat(#{endTime},' 23:59:59')
|
|
|
+ AND t2.parent_id = 60156
|
|
|
+ GROUP BY t1.user_id
|
|
|
+ )k3 ON k3.user_id =k.user_id
|
|
|
+ LEFT JOIN
|
|
|
+ (SELECT user_id, COUNT(1) 'zhizuo_number' FROM (
|
|
|
+ SELECT
|
|
|
+ t1.user_id,t4.signature
|
|
|
+ FROM ctop_material_tag_info t1
|
|
|
+ LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
|
+ LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
|
|
|
+ INNER JOIN(
|
|
|
+ SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
|
|
|
+ LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
|
|
|
+ LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="realname!=null">
|
|
|
+ and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
|
+ </if>
|
|
|
+ <if test="roleCode!=null">
|
|
|
+ AND tt3.role_code = #{roleCode}
|
|
|
+ </if>
|
|
|
+ ) t3 ON t3.id = t1.user_id
|
|
|
+ WHERE 1=1
|
|
|
+ AND t4.stat_date >= #{startTime}
|
|
|
+ AND t4.stat_date <= concat(#{endTime},' 23:59:59')
|
|
|
+ AND t2.parent_id = 60156
|
|
|
+ GROUP BY t1.user_id,t1.`code`
|
|
|
+ ) t
|
|
|
+ GROUP BY user_id
|
|
|
+ )k4 ON k4.user_id = k.user_id
|
|
|
+ ORDER BY k1.zhenren_charge DESC,k3.zhizuo_charge DESC
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="labelMaterialAll" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
+ SELECT
|
|
|
+ '总计' as 'realname',
|
|
|
+ '-' as 'roleName',
|
|
|
+ IFNULL(SUM(t.zhenren_charge),0) as 'zhenrenCharge',
|
|
|
+ IFNULL(SUM(t.zhenren_number),0) as 'zhenrenNumber',
|
|
|
+ IFNULL(ROUND(SUM(t.zhenren_charge)/SUM(t.zhenren_number),2),0) as 'zhenrenCost',
|
|
|
+ IFNULL(SUM(t.zhizuo_charge),0) as 'zhizuoCharge',
|
|
|
+ IFNULL(SUM(t.zhizuo_number),0) as 'zhizuoNumber',
|
|
|
+ IFNULL(ROUND(SUM(t.zhizuo_charge)/SUM(t.zhizuo_number),2),0) as 'zhizuoCost'
|
|
|
+ FROM
|
|
|
+ (SELECT
|
|
|
+ IFNULL(k1.zhenren_charge,0)as 'zhenren_charge',
|
|
|
+ IFNULL(k2.zhenren_number,0)as 'zhenren_number',
|
|
|
+ IFNULL(k3.zhizuo_charge,0)as 'zhizuo_charge',
|
|
|
+ IFNULL(k4.zhizuo_number,0)as 'zhizuo_number'
|
|
|
+ FROM
|
|
|
+ (SELECT
|
|
|
+ t1.user_id,
|
|
|
+ t3.realname,
|
|
|
+ t3.role_name
|
|
|
+ FROM ctop_material_tag_info t1
|
|
|
+ LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
|
+ LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.code
|
|
|
+ INNER JOIN(
|
|
|
+ SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
|
|
|
+ LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
|
|
|
+ LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="realname!=null">
|
|
|
+ and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
|
+ </if>
|
|
|
+ <if test="roleCode!=null">
|
|
|
+ AND tt3.role_code = #{roleCode}
|
|
|
+ </if>
|
|
|
+ ) t3 ON t3.id = t1.user_id
|
|
|
+ WHERE t2.parent_id in(60155,60156)
|
|
|
+ AND t4.stat_date >= #{startTime}
|
|
|
+ AND t4.stat_date <= concat(#{endTime},' 23:59:59')
|
|
|
+ GROUP BY t1.user_id
|
|
|
+ ) k
|
|
|
+ LEFT JOIN
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ t1.user_id, SUM(t5.charge) 'zhenren_charge'
|
|
|
+ FROM ctop_material_tag_info t1
|
|
|
+ LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
|
+ LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
|
|
|
+ INNER JOIN(
|
|
|
+ SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
|
|
|
+ LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
|
|
|
+ LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="realname!=null">
|
|
|
+ and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
|
+ </if>
|
|
|
+ <if test="roleCode!=null">
|
|
|
+ AND tt3.role_code = #{roleCode}
|
|
|
+ </if>
|
|
|
+ ) t3 ON t3.id = t1.user_id
|
|
|
+ LEFT JOIN ctop_kuaishou_report_daily_material t5 ON t1.`code` = t5.signature
|
|
|
+ WHERE 1=1
|
|
|
+ AND t4.stat_date >= #{startTime}
|
|
|
+ AND t4.stat_date <= concat(#{endTime},' 23:59:59')
|
|
|
+ AND t2.parent_id = 60155
|
|
|
+ GROUP BY t1.user_id
|
|
|
+ )k1 ON k1.user_id =k.user_id
|
|
|
+ LEFT JOIN
|
|
|
+ (SELECT user_id, COUNT(1) 'zhenren_number' FROM (
|
|
|
+ SELECT
|
|
|
+ t1.user_id,t4.signature
|
|
|
+ FROM ctop_material_tag_info t1
|
|
|
+ LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
|
+ LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
|
|
|
+ INNER JOIN(
|
|
|
+ SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
|
|
|
+ LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
|
|
|
+ LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="realname!=null">
|
|
|
+ and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
|
+ </if>
|
|
|
+ <if test="roleCode!=null">
|
|
|
+ AND tt3.role_code = #{roleCode}
|
|
|
+ </if>
|
|
|
+ ) t3 ON t3.id = t1.user_id
|
|
|
+ WHERE 1=1
|
|
|
+ AND t4.stat_date >= #{startTime}
|
|
|
+ AND t4.stat_date <= concat(#{endTime},' 23:59:59')
|
|
|
+ AND t2.parent_id = 60155
|
|
|
+ GROUP BY t1.user_id,t1.`code`
|
|
|
+ ) t
|
|
|
+ GROUP BY user_id
|
|
|
+ )k2 ON k.user_id = k2.user_id
|
|
|
+ LEFT JOIN
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ t1.user_id, SUM(t5.charge) 'zhizuo_charge'
|
|
|
+ FROM ctop_material_tag_info t1
|
|
|
+ LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
|
+ LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
|
|
|
+ INNER JOIN(
|
|
|
+ SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
|
|
|
+ LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
|
|
|
+ LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="realname!=null">
|
|
|
+ and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
|
+ </if>
|
|
|
+ <if test="roleCode!=null">
|
|
|
+ AND tt3.role_code = #{roleCode}
|
|
|
+ </if>
|
|
|
+ ) t3 ON t3.id = t1.user_id
|
|
|
+ LEFT JOIN ctop_kuaishou_report_daily_material t5 ON t1.`code` = t5.signature
|
|
|
+ WHERE 1=1
|
|
|
+ AND t4.stat_date >= #{startTime}
|
|
|
+ AND t4.stat_date <= concat(#{endTime},' 23:59:59')
|
|
|
+ AND t2.parent_id = 60156
|
|
|
+ GROUP BY t1.user_id
|
|
|
+ )k3 ON k3.user_id =k.user_id
|
|
|
+ LEFT JOIN
|
|
|
+ (SELECT user_id, COUNT(1) 'zhizuo_number' FROM (
|
|
|
+ SELECT
|
|
|
+ t1.user_id,t4.signature
|
|
|
+ FROM ctop_material_tag_info t1
|
|
|
+ LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
|
+ LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
|
|
|
+ INNER JOIN(
|
|
|
+ SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
|
|
|
+ LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
|
|
|
+ LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="realname!=null">
|
|
|
+ and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
|
+ </if>
|
|
|
+ <if test="roleCode!=null">
|
|
|
+ AND tt3.role_code = #{roleCode}
|
|
|
+ </if>
|
|
|
+ ) t3 ON t3.id = t1.user_id
|
|
|
+ WHERE 1=1
|
|
|
+ AND t4.stat_date >= #{startTime}
|
|
|
+ AND t4.stat_date <= concat(#{endTime},' 23:59:59')
|
|
|
+ AND t2.parent_id = 60156
|
|
|
+ GROUP BY t1.user_id,t1.`code`
|
|
|
+ ) t
|
|
|
+ GROUP BY user_id
|
|
|
+ )k4 ON k4.user_id = k.user_id
|
|
|
+ ORDER BY k1.zhenren_charge DESC,k3.zhizuo_charge DESC
|
|
|
+ )t
|
|
|
+ </select>
|
|
|
</mapper>
|
|
|
|