From b2a973f7bd158d063564c3d38f7034c97ba4e2f9 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 30 Jul 2023 22:12:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E8=BF=9B=E5=BA=A6!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/db/pkg/telsale_archievement_pkg.pck | 46 +++++++++++++----------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/code/db/pkg/telsale_archievement_pkg.pck b/code/db/pkg/telsale_archievement_pkg.pck index 640363e..b38f360 100644 --- a/code/db/pkg/telsale_archievement_pkg.pck +++ b/code/db/pkg/telsale_archievement_pkg.pck @@ -145,29 +145,35 @@ CREATE OR REPLACE PACKAGE BODY telsale_archievement_pkg IS -- 车非融合率排行榜 OPEN a_attaching_ranking_list FOR - SELECT 坐席名称, - round(decode(SUM(车险个人客户保费), - 0, - 0, - (SUM(车非融合保费) / SUM(车险个人客户保费)) * 100), - 2) 车非渗透率 - FROM 坐席车非每日保费 - WHERE 月份 = a_month - AND 年份 = a_year - AND 部门代码 = a_department_code - GROUP BY 坐席名称 - ORDER BY 车非渗透率 DESC; + SELECT rownum, + 坐席名称 as caller_name, + 车非渗透率 as attaching_rate + FROM (SELECT 坐席名称, + round(decode(SUM(车险个人客户保费), + 0, + 0, + (SUM(车非融合保费) / SUM(车险个人客户保费)) * 100), + 2) 车非渗透率 + FROM 坐席车非每日保费 + WHERE 月份 = a_month + AND 年份 = a_year + AND 部门代码 = a_department_code + GROUP BY 坐席名称 + ORDER BY 车非渗透率 DESC); -- 续保率排行榜 OPEN a_renewal_ranking_list FOR - SELECT 坐席名称, - round(nvl((SUM(已续保累计) / SUM(到期数)) * 100, - 0), - 2) 续保率 - FROM 坐席续保统计 xb - WHERE xb.部门 = l_department_name - GROUP BY 坐席名称 - ORDER BY 续保率 DESC; + SELECT rownum, + 坐席名称 as caller_name, + 续保率 as renewal_rate + FROM (SELECT 坐席名称, + round(nvl((SUM(已续保累计) / SUM(到期数)) * 100, + 0), + 2) 续保率 + FROM 坐席续保统计 xb + WHERE xb.部门 = l_department_name + GROUP BY 坐席名称 + ORDER BY 续保率 DESC); END; BEGIN