CREATE OR REPLACE PROCEDURE count_busniess_type (
v_c_04 out number,
v_sum_04 out boc_payinfo.ORDERAMOUNT%TYPE,
v_type in varchar,
v_date_start char,
v_date_end char,
v_mech_no varchar,
v_amount_sum out number,
v_order_sum out number
)
as
BEGIN
select count(*),sum(ORDERAMOUNT) into v_c_04, v_sum_04 from boc_payinfo where PROCSTATE = '04' and chltype like '%' || v_type ||'%' and MECHDATE >= v_date_start and MECHDATE <= v_date_end and mechno like '%' || v_mech_no ||'%';
IF v_c_04 = 0 THEN
v_sum_04 := 0;
END IF;
v_amount_sum := v_sum_04 + v_sum_02 + v_sum_03 + v_sum_05 + v_sum_06 + v_sum_07 + v_sum_08 + v_sum_99 + v_sum_14;
v_order_sum := v_c_04 + v_c_02 + v_c_03 + v_c_05 + v_c_06 + v_c_07 + v_c_08 + v_c_99 + v_c_14;
END count_busniess_type;