Project

General

Profile

chuyen dr_lke cho hieu xe

User documentation
22/04/2025

create or replace procedure PBH_HIEU_HANG_HOI_LIST(
    b_ma_dvi varchar2,b_nsd varchar2,b_pas varchar2,b_oraIn clob, b_oraOut out clob)
AS
    b_loi varchar2(100); b_lenh varchar2(1000); b_gtri nvarchar2(500);
    b_hang varchar2(20);
    b_kieu varchar2(1); b_dong number; b_tu number:=1; cs_lke clob;
begin
-- viet anh - tim hieu theo hang
delete temp_1; commit;
b_lenh:=FKH_JS_LENH('kieu,gtri,hang');
EXECUTE IMMEDIATE b_lenh into b_kieu,b_gtri,b_hang using b_oraIn;
PBH_HIEU_HANG_LISTt(b_ma_dvi, b_hang);
b_loi:=FHT_MA_NSD_KTRA(b_ma_dvi,b_nsd,b_pas,'BH','','');
if b_loi is not null then raise PROGRAM_ERROR; end if;
if b_kieu<>'C' then
    PBH_MA_DMUC_LIST(b_oraIn,b_dong,cs_lke,b_loi);
elsif trim(b_gtri) is not null then
    PBH_MA_DMUC_LIST_MA(b_oraIn,b_dong,cs_lke,b_loi);
else
    PBH_MA_DMUC_LIST_SL(b_oraIn,b_tu,b_dong,cs_lke,b_loi);
end if;
if b_loi is not null then raise PROGRAM_ERROR; end if;
select json_object('kieu' value b_kieu,'dong' value b_dong,'tu' value b_tu,'cs_lke' value cs_lke returning clob) into b_oraOut from dual;
delete temp_1; commit;
exception when others then if b_loi is null then raise PROGRAM_ERROR; else raise_application_error(-20105,b_loi); end if;
end;
/
create or replace procedure PBH_HIEU_HANG_LISTt(b_ma_dvi varchar2, b_hang varchar2)
AS
    b_ngay number:=PKH_NG_CSO(sysdate);
begin
  -- viet anh -- tim hieu theo hang
insert into temp_1(c1,c2,c3)
  select '1',ma as c2,ma as c3 from bh_xe_hieu where ma_dvi=b_ma_dvi and hang=b_hang order by c2;
end;
/
create or replace procedure PBH_2B_HIEU_HANG_HOI_LIST(
    b_ma_dvi varchar2,b_nsd varchar2,b_pas varchar2,b_oraIn clob, b_oraOut out clob)
AS
    b_loi varchar2(100); b_lenh varchar2(1000); b_gtri nvarchar2(500);
    b_hang varchar2(20);
    b_kieu varchar2(1); b_dong number; b_tu number:=1; cs_lke clob;
begin
-- viet anh - tim hieu theo hang
delete temp_1; commit;
b_lenh:=FKH_JS_LENH('kieu,gtri,hang');
EXECUTE IMMEDIATE b_lenh into b_kieu,b_gtri,b_hang using b_oraIn;
PBH_2B_HIEU_HANG_LISTt(b_ma_dvi, b_hang);
b_loi:=FHT_MA_NSD_KTRA(b_ma_dvi,b_nsd,b_pas,'BH','','');
if b_loi is not null then raise PROGRAM_ERROR; end if;
if b_kieu<>'C' then
    PBH_MA_DMUC_LIST(b_oraIn,b_dong,cs_lke,b_loi);
elsif trim(b_gtri) is not null then
    PBH_MA_DMUC_LIST_MA(b_oraIn,b_dong,cs_lke,b_loi);
else
    PBH_MA_DMUC_LIST_SL(b_oraIn,b_tu,b_dong,cs_lke,b_loi);
end if;
if b_loi is not null then raise PROGRAM_ERROR; end if;
select json_object('kieu' value b_kieu,'dong' value b_dong,'tu' value b_tu,'cs_lke' value cs_lke returning clob) into b_oraOut from dual;
delete temp_1; commit;
exception when others then if b_loi is null then raise PROGRAM_ERROR; else raise_application_error(-20105,b_loi); end if;
end;
/
create or replace procedure PBH_2B_HIEU_HANG_LISTt(b_ma_dvi varchar2, b_hang varchar2)
AS
    b_ngay number:=PKH_NG_CSO(sysdate);
begin
  -- viet anh -- tim hieu theo hang
insert into temp_1(c1,c2,c3)
  select '1',ma as c2,ma as c3 from bh_2b_hieu where hang=b_hang order by c2;
end;

Files