1. 程式人生 > >SZ12366DB 生產庫SQL指令碼合集

SZ12366DB 生產庫SQL指令碼合集

一、踢人程式碼SQL

--問號處填寫使用者帳號即可
update t_xt_yh set dqdlzt='0' where yh_dm='gsadmin';
commit;

二、查詢總人工接通率SQL

 select jgmc 機構名稱,
       nvl(hrzl.sl, 0) 來電總量,
       nvl(zrg.sl, 0) 轉接人工量,
       nvl(jtl.sl, 0) 人工接聽量,
       case
         when nvl(zrg.sl, 0) = 0 then
          '0%'
       
         else
          to_char(100 * round(nvl(jtl.sl, 0) / nvl(zrg.sl, 0), 4),
                  'fm999990.00') || '%'
       end 人工接通率
  from (select count(*) sl
          from TX_CALL_LOGO
         where CALLTYPE = '1'
            and trunc(INIVRDT,'Mi') >= trunc(sysdate-1)+15/24
        and trunc(INIVRDT,'Mi') <= trunc(sysdate)+15/24) hrzl, --呼入總量
       
       (select count(*) sl
          from TX_CALL_LOGO
         where CALLTYPE = '1'
           and --呼入
               INSEATDT is not null
           and trunc(INIVRDT,'Mi') >= trunc(sysdate-1)+15/24
        and trunc(INIVRDT,'Mi') <= trunc(sysdate)+15/24) jtl, --接聽量
       (select count(*) sl
          from TX_CALL_LOGO
         where CALLTYPE = '1'
           and --呼入
               INQUENEDT is not null
           and trunc(INIVRDT,'Mi') >= trunc(sysdate-1)+15/24
        and trunc(INIVRDT,'Mi') <= trunc(sysdate)+15/24) zrg, --轉人工量
           
       (select jgmc
          from exchange_pzb
         where sfdqdq = '1'
           and rownum = '1') jgmc

三、查詢分線路人工接通率SQL

--生產庫執行
select 
       nvl(zrg.sl, 0) 轉接人工量,
       nvl(jtl.sl, 0) 人工接聽量,
       case
         when nvl(zrg.sl, 0) = 0 then
          '0%'
       
         else
          to_char(100 * round(nvl(jtl.sl, 0) / nvl(zrg.sl, 0), 4),
                  'fm999990.00') || '%'
       end 人工接通率
  from            
       --生產庫執行,半年以前資料用此指令碼執行
       (select count(1) sl
          from tx_call_oper_detail_all a, tx_call_logo_all b
         where operno = '01' --不同按鍵軌跡在此修改
           and a.callid = b.callid
           and inquenedt is not null
           and to_char(inivrdt, 'yyyy-mm-dd') >= '2018-12-12' --統計時間在此修改
              
           and to_char(inivrdt, 'yyyy-mm-dd') <= '2018-12-12') zrg, --統計時間在此修改
       
       --生產庫執行,半年以前資料用此指令碼執行
       (select count(1) sl
          from tx_call_oper_detail_all a, tx_call_logo_all b
         where operno = '01' --不同按鍵軌跡在此修改
           and a.callid = b.callid
           and inseatdt is not null
           and to_char(inivrdt, 'yyyy-mm-dd') >= '2018-12-12' --統計時間在此修改
              
           and to_char(inivrdt, 'yyyy-mm-dd') <= '2018-12-12') jtl --統計時間在此修改