|
@@ -326,9 +326,9 @@
|
|
|
|
|
|
<select id="getVideoGetByPhotoId" resultType="cn.com.ctop.kuaishou.modules.report.entity.VideoGetvo">
|
|
<select id="getVideoGetByPhotoId" resultType="cn.com.ctop.kuaishou.modules.report.entity.VideoGetvo">
|
|
select signature as 'signature', channel_type as 'channelType'
|
|
select signature as 'signature', channel_type as 'channelType'
|
|
- from ctop_kuaishou_video_get
|
|
|
|
|
|
+ from ctop_etl_kuaishou_video_base_info
|
|
where photo_id = #{photoId}
|
|
where photo_id = #{photoId}
|
|
- and signature is not null limit 1
|
|
|
|
|
|
+ and signature is not null limit 1
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
@@ -445,15 +445,16 @@
|
|
LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
INNER JOIN
|
|
INNER JOIN
|
|
(
|
|
(
|
|
- SELECT signature FROM ctop_kuaishou_video_get
|
|
|
|
- WHERE stat_date >= #{startTime}
|
|
|
|
- AND stat_date <= concat(#{endTime},' 23:59:59')
|
|
|
|
|
|
+ SELECT signature FROM ctop_kuaishou_video_get
|
|
|
|
+ WHERE stat_date >= #{startTime}
|
|
|
|
+ AND stat_date <= concat(#{endTime},' 23:59:59')
|
|
GROUP BY signature
|
|
GROUP BY signature
|
|
) t4 ON t4.signature= t1.`code`
|
|
) t4 ON t4.signature= t1.`code`
|
|
INNER JOIN(
|
|
INNER JOIN(
|
|
SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
|
|
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_user_role tt2 ON tt1.id = tt2.user_id
|
|
LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
|
|
+ LEFT JOIN user_company tt4 ON tt1.id = tt4.user_id
|
|
WHERE 1=1
|
|
WHERE 1=1
|
|
<if test="realname!=null">
|
|
<if test="realname!=null">
|
|
and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
@@ -461,6 +462,12 @@
|
|
<if test="roleCode!=null">
|
|
<if test="roleCode!=null">
|
|
AND tt3.role_code = #{roleCode}
|
|
AND tt3.role_code = #{roleCode}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="roleCode==null">
|
|
|
|
+ AND tt3.role_code in ('clip','shot','plan')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="companyId!=null">
|
|
|
|
+ AND tt4.company_id = #{companyId}
|
|
|
|
+ </if>
|
|
) t3 ON t3.id = t1.user_id
|
|
) t3 ON t3.id = t1.user_id
|
|
WHERE t2.parent_id in(60155,60156)
|
|
WHERE t2.parent_id in(60155,60156)
|
|
GROUP BY t1.user_id
|
|
GROUP BY t1.user_id
|
|
@@ -484,55 +491,69 @@
|
|
t3.realname,
|
|
t3.realname,
|
|
t3.role_name
|
|
t3.role_name
|
|
FROM ctop_material_tag_info t1
|
|
FROM ctop_material_tag_info t1
|
|
- LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
|
|
|
|
+ LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
INNER JOIN
|
|
INNER JOIN
|
|
(
|
|
(
|
|
- SELECT signature FROM ctop_kuaishou_video_get
|
|
|
|
- WHERE stat_date >= #{startTime}
|
|
|
|
- AND stat_date <= concat(#{endTime},' 23:59:59')
|
|
|
|
|
|
+ SELECT signature FROM ctop_kuaishou_video_get
|
|
|
|
+ WHERE stat_date >= #{startTime}
|
|
|
|
+ AND stat_date <= concat(#{endTime},' 23:59:59')
|
|
GROUP BY signature
|
|
GROUP BY signature
|
|
) t4 ON t4.signature= t1.`code`
|
|
) t4 ON t4.signature= t1.`code`
|
|
INNER JOIN(
|
|
INNER JOIN(
|
|
SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
|
|
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_user_role tt2 ON tt1.id = tt2.user_id
|
|
LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
|
|
+ LEFT JOIN user_company tt4 ON tt1.id = tt4.user_id
|
|
WHERE 1=1
|
|
WHERE 1=1
|
|
|
|
+ <if test="companyId!=null">
|
|
|
|
+ AND tt4.company_id = #{companyId}
|
|
|
|
+ </if>
|
|
<if test="realname!=null">
|
|
<if test="realname!=null">
|
|
and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
</if>
|
|
</if>
|
|
<if test="roleCode!=null">
|
|
<if test="roleCode!=null">
|
|
AND tt3.role_code = #{roleCode}
|
|
AND tt3.role_code = #{roleCode}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="roleCode==null">
|
|
|
|
+ AND tt3.role_code in ('clip','shot','plan')
|
|
|
|
+ </if>
|
|
) t3 ON t3.id = t1.user_id
|
|
) t3 ON t3.id = t1.user_id
|
|
WHERE t2.parent_id in(60155,60156)
|
|
WHERE t2.parent_id in(60155,60156)
|
|
GROUP BY t1.user_id
|
|
GROUP BY t1.user_id
|
|
) k
|
|
) k
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
(
|
|
(
|
|
- SELECT
|
|
|
|
|
|
+ SELECT
|
|
t1.user_id, SUM(t5.charge) 'zhenren_charge'
|
|
t1.user_id, SUM(t5.charge) 'zhenren_charge'
|
|
FROM ctop_material_tag_info t1
|
|
FROM ctop_material_tag_info t1
|
|
- LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
|
|
|
|
+ LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
INNER JOIN
|
|
INNER JOIN
|
|
(
|
|
(
|
|
- SELECT signature FROM ctop_kuaishou_video_get
|
|
|
|
- WHERE stat_date >= #{startTime}
|
|
|
|
- AND stat_date <= concat(#{endTime},' 23:59:59')
|
|
|
|
|
|
+ SELECT signature FROM ctop_kuaishou_video_get
|
|
|
|
+ WHERE stat_date >= #{startTime}
|
|
|
|
+ AND stat_date <= concat(#{endTime},' 23:59:59')
|
|
GROUP BY signature
|
|
GROUP BY signature
|
|
) t4 ON t4.signature= t1.`code`
|
|
) t4 ON t4.signature= t1.`code`
|
|
INNER JOIN(
|
|
INNER JOIN(
|
|
SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
|
|
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_user_role tt2 ON tt1.id = tt2.user_id
|
|
LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
|
|
+ LEFT JOIN user_company tt4 ON tt1.id = tt4.user_id
|
|
WHERE 1=1
|
|
WHERE 1=1
|
|
|
|
+ <if test="companyId!=null">
|
|
|
|
+ AND tt4.company_id = #{companyId}
|
|
|
|
+ </if>
|
|
<if test="realname!=null">
|
|
<if test="realname!=null">
|
|
and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
</if>
|
|
</if>
|
|
<if test="roleCode!=null">
|
|
<if test="roleCode!=null">
|
|
AND tt3.role_code = #{roleCode}
|
|
AND tt3.role_code = #{roleCode}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="roleCode==null">
|
|
|
|
+ AND tt3.role_code in ('clip','shot','plan')
|
|
|
|
+ </if>
|
|
) t3 ON t3.id = t1.user_id
|
|
) t3 ON t3.id = t1.user_id
|
|
- LEFT JOIN ctop_kuaishou_report_daily_material t5 ON t1.`code` = t5.signature
|
|
|
|
|
|
+ LEFT JOIN ctop_kuaishou_report_daily_material t5 ON t1.`code` = t5.signature
|
|
WHERE t2.parent_id = 60155
|
|
WHERE t2.parent_id = 60155
|
|
GROUP BY t1.user_id
|
|
GROUP BY t1.user_id
|
|
) k1 ON k1.user_id =k.user_id
|
|
) k1 ON k1.user_id =k.user_id
|
|
@@ -541,25 +562,32 @@
|
|
SELECT
|
|
SELECT
|
|
t1.user_id,t4.signature
|
|
t1.user_id,t4.signature
|
|
FROM ctop_material_tag_info t1
|
|
FROM ctop_material_tag_info t1
|
|
- LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
|
|
|
|
+ LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
INNER JOIN
|
|
INNER JOIN
|
|
(
|
|
(
|
|
- SELECT signature FROM ctop_kuaishou_video_get
|
|
|
|
- WHERE stat_date >= #{startTime}
|
|
|
|
- AND stat_date <= concat(#{endTime},' 23:59:59')
|
|
|
|
|
|
+ SELECT signature FROM ctop_kuaishou_video_get
|
|
|
|
+ WHERE stat_date >= #{startTime}
|
|
|
|
+ AND stat_date <= concat(#{endTime},' 23:59:59')
|
|
GROUP BY signature
|
|
GROUP BY signature
|
|
) t4 ON t4.signature= t1.`code`
|
|
) t4 ON t4.signature= t1.`code`
|
|
INNER JOIN(
|
|
INNER JOIN(
|
|
SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
|
|
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_user_role tt2 ON tt1.id = tt2.user_id
|
|
LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
|
|
+ LEFT JOIN user_company tt4 ON tt1.id = tt4.user_id
|
|
WHERE 1=1
|
|
WHERE 1=1
|
|
|
|
+ <if test="companyId!=null">
|
|
|
|
+ AND tt4.company_id = #{companyId}
|
|
|
|
+ </if>
|
|
<if test="realname!=null">
|
|
<if test="realname!=null">
|
|
and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
</if>
|
|
</if>
|
|
<if test="roleCode!=null">
|
|
<if test="roleCode!=null">
|
|
AND tt3.role_code = #{roleCode}
|
|
AND tt3.role_code = #{roleCode}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="roleCode==null">
|
|
|
|
+ AND tt3.role_code in ('clip','shot','plan')
|
|
|
|
+ </if>
|
|
) t3 ON t3.id = t1.user_id
|
|
) t3 ON t3.id = t1.user_id
|
|
WHERE t2.parent_id = 60155
|
|
WHERE t2.parent_id = 60155
|
|
GROUP BY t1.user_id,t1.`code`
|
|
GROUP BY t1.user_id,t1.`code`
|
|
@@ -571,27 +599,34 @@
|
|
SELECT
|
|
SELECT
|
|
t1.user_id, SUM(t5.charge) 'zhizuo_charge'
|
|
t1.user_id, SUM(t5.charge) 'zhizuo_charge'
|
|
FROM ctop_material_tag_info t1
|
|
FROM ctop_material_tag_info t1
|
|
- LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
|
|
|
|
+ LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
INNER JOIN
|
|
INNER JOIN
|
|
(
|
|
(
|
|
- SELECT signature FROM ctop_kuaishou_video_get
|
|
|
|
- WHERE stat_date >= #{startTime}
|
|
|
|
- AND stat_date <= concat(#{endTime},' 23:59:59')
|
|
|
|
|
|
+ SELECT signature FROM ctop_kuaishou_video_get
|
|
|
|
+ WHERE stat_date >= #{startTime}
|
|
|
|
+ AND stat_date <= concat(#{endTime},' 23:59:59')
|
|
GROUP BY signature
|
|
GROUP BY signature
|
|
) t4 ON t4.signature= t1.`code`
|
|
) t4 ON t4.signature= t1.`code`
|
|
INNER JOIN(
|
|
INNER JOIN(
|
|
SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
|
|
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_user_role tt2 ON tt1.id = tt2.user_id
|
|
LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
|
|
+ LEFT JOIN user_company tt4 ON tt1.id = tt4.user_id
|
|
WHERE 1=1
|
|
WHERE 1=1
|
|
|
|
+ <if test="companyId!=null">
|
|
|
|
+ AND tt4.company_id = #{companyId}
|
|
|
|
+ </if>
|
|
<if test="realname!=null">
|
|
<if test="realname!=null">
|
|
and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
</if>
|
|
</if>
|
|
<if test="roleCode!=null">
|
|
<if test="roleCode!=null">
|
|
AND tt3.role_code = #{roleCode}
|
|
AND tt3.role_code = #{roleCode}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="roleCode==null">
|
|
|
|
+ AND tt3.role_code in ('clip','shot','plan')
|
|
|
|
+ </if>
|
|
) t3 ON t3.id = t1.user_id
|
|
) t3 ON t3.id = t1.user_id
|
|
- LEFT JOIN ctop_kuaishou_report_daily_material t5 ON t1.`code` = t5.signature
|
|
|
|
|
|
+ LEFT JOIN ctop_kuaishou_report_daily_material t5 ON t1.`code` = t5.signature
|
|
WHERE t2.parent_id = 60156
|
|
WHERE t2.parent_id = 60156
|
|
GROUP BY t1.user_id
|
|
GROUP BY t1.user_id
|
|
)k3 ON k3.user_id =k.user_id
|
|
)k3 ON k3.user_id =k.user_id
|
|
@@ -600,27 +635,34 @@
|
|
SELECT
|
|
SELECT
|
|
t1.user_id,t4.signature
|
|
t1.user_id,t4.signature
|
|
FROM ctop_material_tag_info t1
|
|
FROM ctop_material_tag_info t1
|
|
- LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
|
|
|
|
+ LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
INNER JOIN
|
|
INNER JOIN
|
|
(
|
|
(
|
|
- SELECT signature FROM ctop_kuaishou_video_get
|
|
|
|
- WHERE stat_date >= #{startTime}
|
|
|
|
- AND stat_date <= concat(#{endTime},' 23:59:59')
|
|
|
|
|
|
+ SELECT signature FROM ctop_kuaishou_video_get
|
|
|
|
+ WHERE stat_date >= #{startTime}
|
|
|
|
+ AND stat_date <= concat(#{endTime},' 23:59:59')
|
|
GROUP BY signature
|
|
GROUP BY signature
|
|
) t4 ON t4.signature= t1.`code`
|
|
) t4 ON t4.signature= t1.`code`
|
|
INNER JOIN(
|
|
INNER JOIN(
|
|
SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
|
|
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_user_role tt2 ON tt1.id = tt2.user_id
|
|
LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
|
|
+ LEFT JOIN user_company tt4 ON tt1.id = tt4.user_id
|
|
WHERE 1=1
|
|
WHERE 1=1
|
|
|
|
+ <if test="companyId!=null">
|
|
|
|
+ AND tt4.company_id = #{companyId}
|
|
|
|
+ </if>
|
|
<if test="realname!=null">
|
|
<if test="realname!=null">
|
|
and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
</if>
|
|
</if>
|
|
<if test="roleCode!=null">
|
|
<if test="roleCode!=null">
|
|
AND tt3.role_code = #{roleCode}
|
|
AND tt3.role_code = #{roleCode}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="roleCode==null">
|
|
|
|
+ AND tt3.role_code in ('clip','shot','plan')
|
|
|
|
+ </if>
|
|
) t3 ON t3.id = t1.user_id
|
|
) t3 ON t3.id = t1.user_id
|
|
- WHERE t2.parent_id = 60156
|
|
|
|
|
|
+ WHERE t2.parent_id = 60156
|
|
GROUP BY t1.user_id,t1.`code`
|
|
GROUP BY t1.user_id,t1.`code`
|
|
) t
|
|
) t
|
|
GROUP BY user_id
|
|
GROUP BY user_id
|
|
@@ -651,25 +693,32 @@
|
|
t3.realname,
|
|
t3.realname,
|
|
t3.role_name
|
|
t3.role_name
|
|
FROM ctop_material_tag_info t1
|
|
FROM ctop_material_tag_info t1
|
|
- LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
|
|
|
|
+ LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
INNER JOIN
|
|
INNER JOIN
|
|
(
|
|
(
|
|
- SELECT signature FROM ctop_kuaishou_video_get
|
|
|
|
- WHERE stat_date >= #{startTime}
|
|
|
|
- AND stat_date <= concat(#{endTime},' 23:59:59')
|
|
|
|
|
|
+ SELECT signature FROM ctop_kuaishou_video_get
|
|
|
|
+ WHERE stat_date >= #{startTime}
|
|
|
|
+ AND stat_date <= concat(#{endTime},' 23:59:59')
|
|
GROUP BY signature
|
|
GROUP BY signature
|
|
) t4 ON t4.signature= t1.`code`
|
|
) t4 ON t4.signature= t1.`code`
|
|
INNER JOIN(
|
|
INNER JOIN(
|
|
SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
|
|
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_user_role tt2 ON tt1.id = tt2.user_id
|
|
LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
|
|
+ LEFT JOIN user_company tt4 ON tt1.id = tt4.user_id
|
|
WHERE 1=1
|
|
WHERE 1=1
|
|
|
|
+ <if test="companyId!=null">
|
|
|
|
+ AND tt4.company_id = #{companyId}
|
|
|
|
+ </if>
|
|
<if test="realname!=null">
|
|
<if test="realname!=null">
|
|
and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
</if>
|
|
</if>
|
|
<if test="roleCode!=null">
|
|
<if test="roleCode!=null">
|
|
AND tt3.role_code = #{roleCode}
|
|
AND tt3.role_code = #{roleCode}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="roleCode==null">
|
|
|
|
+ AND tt3.role_code in ('clip','shot','plan')
|
|
|
|
+ </if>
|
|
) t3 ON t3.id = t1.user_id
|
|
) t3 ON t3.id = t1.user_id
|
|
WHERE t2.parent_id in(60155,60156)
|
|
WHERE t2.parent_id in(60155,60156)
|
|
GROUP BY t1.user_id
|
|
GROUP BY t1.user_id
|
|
@@ -679,12 +728,12 @@
|
|
SELECT
|
|
SELECT
|
|
t1.user_id, SUM(t5.charge) 'zhenren_charge'
|
|
t1.user_id, SUM(t5.charge) 'zhenren_charge'
|
|
FROM ctop_material_tag_info t1
|
|
FROM ctop_material_tag_info t1
|
|
- LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
|
|
|
|
+ LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
INNER JOIN
|
|
INNER JOIN
|
|
(
|
|
(
|
|
- SELECT signature FROM ctop_kuaishou_video_get
|
|
|
|
- WHERE stat_date >= #{startTime}
|
|
|
|
- AND stat_date <= concat(#{endTime},' 23:59:59')
|
|
|
|
|
|
+ SELECT signature FROM ctop_kuaishou_video_get
|
|
|
|
+ WHERE stat_date >= #{startTime}
|
|
|
|
+ AND stat_date <= concat(#{endTime},' 23:59:59')
|
|
GROUP BY signature
|
|
GROUP BY signature
|
|
) t4 ON t4.signature= t1.`code`
|
|
) t4 ON t4.signature= t1.`code`
|
|
INNER JOIN
|
|
INNER JOIN
|
|
@@ -692,15 +741,22 @@
|
|
SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
|
|
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_user_role tt2 ON tt1.id = tt2.user_id
|
|
LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
|
|
+ LEFT JOIN user_company tt4 ON tt1.id = tt4.user_id
|
|
WHERE 1=1
|
|
WHERE 1=1
|
|
|
|
+ <if test="companyId!=null">
|
|
|
|
+ AND tt4.company_id = #{companyId}
|
|
|
|
+ </if>
|
|
<if test="realname!=null">
|
|
<if test="realname!=null">
|
|
and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
</if>
|
|
</if>
|
|
<if test="roleCode!=null">
|
|
<if test="roleCode!=null">
|
|
AND tt3.role_code = #{roleCode}
|
|
AND tt3.role_code = #{roleCode}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="roleCode==null">
|
|
|
|
+ AND tt3.role_code in ('clip','shot','plan')
|
|
|
|
+ </if>
|
|
) t3 ON t3.id = t1.user_id
|
|
) t3 ON t3.id = t1.user_id
|
|
- LEFT JOIN ctop_kuaishou_report_daily_material t5 ON t1.`code` = t5.signature
|
|
|
|
|
|
+ LEFT JOIN ctop_kuaishou_report_daily_material t5 ON t1.`code` = t5.signature
|
|
WHERE t2.parent_id = 60155
|
|
WHERE t2.parent_id = 60155
|
|
GROUP BY t1.user_id
|
|
GROUP BY t1.user_id
|
|
)k1 ON k1.user_id =k.user_id
|
|
)k1 ON k1.user_id =k.user_id
|
|
@@ -709,25 +765,32 @@
|
|
SELECT
|
|
SELECT
|
|
t1.user_id,t4.signature
|
|
t1.user_id,t4.signature
|
|
FROM ctop_material_tag_info t1
|
|
FROM ctop_material_tag_info t1
|
|
- LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
|
|
|
|
+ LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
INNER JOIN
|
|
INNER JOIN
|
|
(
|
|
(
|
|
- SELECT signature FROM ctop_kuaishou_video_get
|
|
|
|
- WHERE stat_date >= #{startTime}
|
|
|
|
- AND stat_date <= concat(#{endTime},' 23:59:59')
|
|
|
|
|
|
+ SELECT signature FROM ctop_kuaishou_video_get
|
|
|
|
+ WHERE stat_date >= #{startTime}
|
|
|
|
+ AND stat_date <= concat(#{endTime},' 23:59:59')
|
|
GROUP BY signature
|
|
GROUP BY signature
|
|
) t4 ON t4.signature= t1.`code`
|
|
) t4 ON t4.signature= t1.`code`
|
|
INNER JOIN(
|
|
INNER JOIN(
|
|
SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
|
|
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_user_role tt2 ON tt1.id = tt2.user_id
|
|
LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
|
|
+ LEFT JOIN user_company tt4 ON tt1.id = tt4.user_id
|
|
WHERE 1=1
|
|
WHERE 1=1
|
|
|
|
+ <if test="companyId!=null">
|
|
|
|
+ AND tt4.company_id = #{companyId}
|
|
|
|
+ </if>
|
|
<if test="realname!=null">
|
|
<if test="realname!=null">
|
|
and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
</if>
|
|
</if>
|
|
<if test="roleCode!=null">
|
|
<if test="roleCode!=null">
|
|
AND tt3.role_code = #{roleCode}
|
|
AND tt3.role_code = #{roleCode}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="roleCode==null">
|
|
|
|
+ AND tt3.role_code in ('clip','shot','plan')
|
|
|
|
+ </if>
|
|
) t3 ON t3.id = t1.user_id
|
|
) t3 ON t3.id = t1.user_id
|
|
WHERE t2.parent_id = 60155
|
|
WHERE t2.parent_id = 60155
|
|
GROUP BY t1.user_id,t1.`code`
|
|
GROUP BY t1.user_id,t1.`code`
|
|
@@ -739,27 +802,34 @@
|
|
SELECT
|
|
SELECT
|
|
t1.user_id, SUM(t5.charge) 'zhizuo_charge'
|
|
t1.user_id, SUM(t5.charge) 'zhizuo_charge'
|
|
FROM ctop_material_tag_info t1
|
|
FROM ctop_material_tag_info t1
|
|
- LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
|
|
|
|
+ LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
INNER JOIN
|
|
INNER JOIN
|
|
(
|
|
(
|
|
- SELECT signature FROM ctop_kuaishou_video_get
|
|
|
|
- WHERE stat_date >= #{startTime}
|
|
|
|
- AND stat_date <= concat(#{endTime},' 23:59:59')
|
|
|
|
|
|
+ SELECT signature FROM ctop_kuaishou_video_get
|
|
|
|
+ WHERE stat_date >= #{startTime}
|
|
|
|
+ AND stat_date <= concat(#{endTime},' 23:59:59')
|
|
GROUP BY signature
|
|
GROUP BY signature
|
|
) t4 ON t4.signature= t1.`code`
|
|
) t4 ON t4.signature= t1.`code`
|
|
INNER JOIN(
|
|
INNER JOIN(
|
|
SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
|
|
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_user_role tt2 ON tt1.id = tt2.user_id
|
|
LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
|
|
+ LEFT JOIN user_company tt4 ON tt1.id = tt4.user_id
|
|
WHERE 1=1
|
|
WHERE 1=1
|
|
|
|
+ <if test="companyId!=null">
|
|
|
|
+ AND tt4.company_id = #{companyId}
|
|
|
|
+ </if>
|
|
<if test="realname!=null">
|
|
<if test="realname!=null">
|
|
and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
</if>
|
|
</if>
|
|
<if test="roleCode!=null">
|
|
<if test="roleCode!=null">
|
|
AND tt3.role_code = #{roleCode}
|
|
AND tt3.role_code = #{roleCode}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="roleCode==null">
|
|
|
|
+ AND tt3.role_code in ('clip','shot','plan')
|
|
|
|
+ </if>
|
|
) t3 ON t3.id = t1.user_id
|
|
) t3 ON t3.id = t1.user_id
|
|
- LEFT JOIN ctop_kuaishou_report_daily_material t5 ON t1.`code` = t5.signature
|
|
|
|
|
|
+ LEFT JOIN ctop_kuaishou_report_daily_material t5 ON t1.`code` = t5.signature
|
|
WHERE t2.parent_id = 60156
|
|
WHERE t2.parent_id = 60156
|
|
GROUP BY t1.user_id
|
|
GROUP BY t1.user_id
|
|
)k3 ON k3.user_id =k.user_id
|
|
)k3 ON k3.user_id =k.user_id
|
|
@@ -768,25 +838,32 @@
|
|
SELECT
|
|
SELECT
|
|
t1.user_id,t4.signature
|
|
t1.user_id,t4.signature
|
|
FROM ctop_material_tag_info t1
|
|
FROM ctop_material_tag_info t1
|
|
- LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
|
|
|
|
+ LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
|
|
INNER JOIN
|
|
INNER JOIN
|
|
(
|
|
(
|
|
- SELECT signature FROM ctop_kuaishou_video_get
|
|
|
|
- WHERE stat_date >= #{startTime}
|
|
|
|
- AND stat_date <= concat(#{endTime},' 23:59:59')
|
|
|
|
|
|
+ SELECT signature FROM ctop_kuaishou_video_get
|
|
|
|
+ WHERE stat_date >= #{startTime}
|
|
|
|
+ AND stat_date <= concat(#{endTime},' 23:59:59')
|
|
GROUP BY signature
|
|
GROUP BY signature
|
|
) t4 ON t4.signature= t1.`code`
|
|
) t4 ON t4.signature= t1.`code`
|
|
INNER JOIN(
|
|
INNER JOIN(
|
|
SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
|
|
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_user_role tt2 ON tt1.id = tt2.user_id
|
|
LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
|
|
|
|
+ LEFT JOIN user_company tt4 ON tt1.id = tt4.user_id
|
|
WHERE 1=1
|
|
WHERE 1=1
|
|
|
|
+ <if test="companyId!=null">
|
|
|
|
+ AND tt4.company_id = #{companyId}
|
|
|
|
+ </if>
|
|
<if test="realname!=null">
|
|
<if test="realname!=null">
|
|
and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
and tt1.realname LIKE CONCAT('%',#{realname},'%')
|
|
</if>
|
|
</if>
|
|
<if test="roleCode!=null">
|
|
<if test="roleCode!=null">
|
|
AND tt3.role_code = #{roleCode}
|
|
AND tt3.role_code = #{roleCode}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="roleCode==null">
|
|
|
|
+ AND tt3.role_code in ('clip','shot','plan')
|
|
|
|
+ </if>
|
|
) t3 ON t3.id = t1.user_id
|
|
) t3 ON t3.id = t1.user_id
|
|
WHERE t2.parent_id = 60156
|
|
WHERE t2.parent_id = 60156
|
|
GROUP BY t1.user_id,t1.`code`
|
|
GROUP BY t1.user_id,t1.`code`
|