--按时间类型对bgorderinfo按照业务分类数据进行统计
CREATE OR REPLACE PROCEDURE IPS_BUSINESS_STATISTIC_PROC(businessKey IN varchar2,startTime IN date, statType IN varchar2,longTime IN INTEGER) AS
stime date;
etime date;
fail INTEGER;
totalc_ INTEGER;
mixc_ INTEGER;
BEGIN
-- 按小时
IF (statType = 1) THEN
stime :=to_date(to_char(startTime,'yyyy-mm-dd')||(to_char(startTime,'hh24')-1),'yyyy-mm-dd hh24');
etime :=to_date(to_char(startTime,'yyyy-mm-dd')||(to_char(startTime,'hh24')),'yyyy-mm-dd hh24');
DBMS_OUTPUT.PUT_LINE(to_char(stime,'yyyy-mm-dd hh24'));
END IF;
select count(business_key) totalc INTO totalc_ from ips_deal_bgorder_info where service_id='0000199999' and business_key=businessKey and ORDER_ACCEPTTIME>stime and ORDER_ACCEPTTIMEstime and ORDER_ACCEPTTIMEstime
and ORDER_ACCEPTTIME<etime;... |