hcst_sunzhen 5 rokov pred
rodič
commit
f79938943d

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/PerformanceServiceImpl2.java

@@ -1812,8 +1812,8 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
         String startTime = timeMap.get("startDate");
         String endTime = timeMap.get("endDate");
 
-        //1 获取快手下所有人
-        List<UserDto2> userDto2List = userEfficientVideoMapMapper.getKuaishouDepartUserInfo();
+        //1 获取头条下所有人
+        List<UserDto2> userDto2List = userEfficientVideoMapMapper.getToutiaoDepartUserInfo();
         //2 循环所有人,并查询出每个人的有效视频数、总视频数、总消耗
         for (UserDto2 userDto : userDto2List) {
             //String roleCode = userDto.getRoleCode();

+ 15 - 0
performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/mapper/UserEfficientVideoMapMapper.java

@@ -115,5 +115,20 @@ public interface UserEfficientVideoMapMapper extends BaseMapper<UserEfficientVid
     Integer getEffiVideoCountByCalcDate(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("roleId") String roleId, @Param("userId") String userId, @Param("appType") Integer appType);
 
     List<MaterialInfo> getEffiVideoList(@Param("appType")Integer appType, @Param("year")Integer year, @Param("quarter")Integer quarter, @Param("userId")String userId);
+
+    List<UserDto2> getKuaishouYunyingDepartUserInfo();
+
+    List<UserDto2> getToutiaoYunyingDepartUserInfo();
+    //获取快手单个优化师当前账户下的总消耗
+    BigDecimal getKuaishouYunyingTotalCost(@Param("userId")String userId, @Param("appType")Integer appType, @Param("startDate")String startDate, @Param("endDate")String endDate);
+    //获取快手单个优化师当前账户下的总消耗
+    BigDecimal getToutiaoYunyingTotalCost(@Param("userId")String userId, @Param("appType")Integer appType, @Param("startDate")String startDate, @Param("endDate")String endDate);
+    //获取头条单个优化师其下所有的账户下当前的消耗
+    List<BigDecimal> getKuaishouAccountTotalCost(@Param("userId")String userId, @Param("appType")Integer appType, @Param("startDate")String startDate, @Param("endDate")String endDate);
+    //获取头条单个优化师其下所有的账户下当前的消耗
+    List<BigDecimal> getToutiaoAccountTotalCost(@Param("userId")String userId, @Param("appType")Integer appType, @Param("startDate")String startDate, @Param("endDate")String endDate);
+
+
+
 }
 

+ 104 - 0
performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/mapper/xml/UserEfficientVideoMapMapper.xml

@@ -744,6 +744,110 @@
         and r.role_code in ('plan','clip','shot')
     </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 &gt;= #{startDate}
+        AND
+            dailiAccount.stat_date &lt; #{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 &gt;= #{startDate}
+        AND
+            dailiAccount.stat_datetime &lt; #{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 &gt;= #{startDate}
+        AND
+            dailiAccount.stat_datetime &lt; #{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 &gt;= #{startDate}
+        AND
+            dailiAccount.stat_date &lt; #{endDate}
+        AND
+            allocation.media_id = #{appType}
+        group by dailiAccount.account_id
+    </select>
+
     <!-- 根据天数的区间获取userId获取有效视频数量 -->
     <select id="getEffiVideoCountByCalcDate" resultType="java.lang.Integer">
         select