|
@@ -744,6 +744,110 @@
|
|
and r.role_code in ('plan','clip','shot')
|
|
and r.role_code in ('plan','clip','shot')
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+ <!-- 获取北京快手运营部所有优化师得信息 -->
|
|
|
|
+ <select id="getKuaishouYunyingDepartUserInfo" resultType="cn.com.ctop.userefficientvideomap.entity.UserDto2">
|
|
|
|
+ select u.id as userId,
|
|
|
|
+ u.realname as realname,
|
|
|
|
+ r.role_name as roleName,
|
|
|
|
+ r.role_code as roleCode,
|
|
|
|
+ r.id as roleId
|
|
|
|
+ FROM sys_user_depart ud
|
|
|
|
+ left join sys_depart b on ud.dep_id = b.id
|
|
|
|
+ left join sys_user u on ud.user_id = u.id
|
|
|
|
+ left join sys_user_role ur on u.id = ur.user_id
|
|
|
|
+ left join sys_role r on ur.role_id = r.id
|
|
|
|
+ WHERE b.parent_id = '0dd29c09d2c94f98ae91902094c6cf68' <!-- 快手运营部 -->
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <!-- 获取北京快手运营部所有优化师得信息 -->
|
|
|
|
+ <select id="getToutiaoYunyingDepartUserInfo" resultType="cn.com.ctop.userefficientvideomap.entity.UserDto2">
|
|
|
|
+ select u.id as userId,
|
|
|
|
+ u.realname as realname,
|
|
|
|
+ r.role_name as roleName,
|
|
|
|
+ r.role_code as roleCode,
|
|
|
|
+ r.id as roleId
|
|
|
|
+ FROM sys_user_depart ud
|
|
|
|
+ left join sys_depart b on ud.dep_id = b.id
|
|
|
|
+ left join sys_user u on ud.user_id = u.id
|
|
|
|
+ left join sys_user_role ur on u.id = ur.user_id
|
|
|
|
+ left join sys_role r on ur.role_id = r.id
|
|
|
|
+ WHERE b.parent_id = '989799ba602e40fcb03f522d5284b705' <!-- 头条运营部 -->
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <!-- 获取快手单个优化师当前账户下的总消耗 -->
|
|
|
|
+ <select id="getKuaishouYunyingTotalCost" resultType="java.math.BigDecimal">
|
|
|
|
+ SELECT
|
|
|
|
+ SUM(dailiAccount.charge) as totalCost
|
|
|
|
+ FROM
|
|
|
|
+ ctop_kuaishou_report_daily_account dailiAccount
|
|
|
|
+ LEFT JOIN
|
|
|
|
+ ctop_user_allocation allocation ON dailiAccount.account_id = allocation.account_id
|
|
|
|
+ WHERE
|
|
|
|
+ allocation.user_id = #{userId}
|
|
|
|
+ AND
|
|
|
|
+ dailiAccount.stat_date >= #{startDate}
|
|
|
|
+ AND
|
|
|
|
+ dailiAccount.stat_date < #{endDate}
|
|
|
|
+ AND
|
|
|
|
+ allocation.media_id = #{appType}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <!-- 获取头条单个优化师当前账户下的总消耗 -->
|
|
|
|
+ <select id="getToutiaoYunyingTotalCost" resultType="java.math.BigDecimal">
|
|
|
|
+ SELECT
|
|
|
|
+ SUM(dailiAccount.charge) as totalCost
|
|
|
|
+ FROM
|
|
|
|
+ ctop_bytedance_report_advertiser_daily dailiAccount
|
|
|
|
+ LEFT JOIN
|
|
|
|
+ ctop_user_allocation allocation ON dailiAccount.advertiser_id = allocation.account_id
|
|
|
|
+ WHERE
|
|
|
|
+ allocation.user_id = #{userId}
|
|
|
|
+ AND
|
|
|
|
+ dailiAccount.stat_datetime >= #{startDate}
|
|
|
|
+ AND
|
|
|
|
+ dailiAccount.stat_datetime < #{endDate}
|
|
|
|
+ AND
|
|
|
|
+ allocation.media_id = #{appType}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <!-- 获取头条单个优化师其下所有的账户下当前的消耗 -->
|
|
|
|
+ <select id="getToutiaoAccountTotalCost" resultType="java.math.BigDecimal">
|
|
|
|
+ select
|
|
|
|
+ SUM(dailiAccount.charge) as totalCost
|
|
|
|
+ ctop_bytedance_report_advertiser_daily dailiAccount
|
|
|
|
+ LEFT JOIN
|
|
|
|
+ ctop_user_allocation allocation ON dailiAccount.advertiser_id = allocation.account_id
|
|
|
|
+ WHERE
|
|
|
|
+ allocation.user_id = #{userId}
|
|
|
|
+ AND
|
|
|
|
+ dailiAccount.stat_datetime >= #{startDate}
|
|
|
|
+ AND
|
|
|
|
+ dailiAccount.stat_datetime < #{endDate}
|
|
|
|
+ AND
|
|
|
|
+ allocation.media_id = #{appType}
|
|
|
|
+ group by dailiAccount.advertiser_id
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <!-- 获取快手单个优化师其下所有账户下当前的消耗 -->
|
|
|
|
+ <select id="getKuaishouAccountTotalCost" resultType="java.math.BigDecimal">
|
|
|
|
+ SELECT
|
|
|
|
+
|
|
|
|
+ SUM(dailiAccount.charge) as totalCost
|
|
|
|
+ FROM
|
|
|
|
+ ctop_kuaishou_report_daily_account dailiAccount
|
|
|
|
+ LEFT JOIN
|
|
|
|
+ ctop_user_allocation allocation ON dailiAccount.account_id = allocation.account_id
|
|
|
|
+ WHERE
|
|
|
|
+ allocation.user_id = #{userId}
|
|
|
|
+ AND
|
|
|
|
+ dailiAccount.stat_date >= #{startDate}
|
|
|
|
+ AND
|
|
|
|
+ dailiAccount.stat_date < #{endDate}
|
|
|
|
+ AND
|
|
|
|
+ allocation.media_id = #{appType}
|
|
|
|
+ group by dailiAccount.account_id
|
|
|
|
+ </select>
|
|
|
|
+
|
|
<!-- 根据天数的区间获取userId获取有效视频数量 -->
|
|
<!-- 根据天数的区间获取userId获取有效视频数量 -->
|
|
<select id="getEffiVideoCountByCalcDate" resultType="java.lang.Integer">
|
|
<select id="getEffiVideoCountByCalcDate" resultType="java.lang.Integer">
|
|
select
|
|
select
|