| SQL Id | SQL Text |
| 038wwtksywn3c |
select max(ten_tt) ten_tt,
max(diachi_tt) diachi_tt,
max(ms_thue) ms_thue,
max(ma_kh) ma_kh,
sum(nogoc_thuc) nogoc_thuc,
sum(thue_thuc) thue_thuc,
to_char(sum(tongno_thuc), :"SYS_B_000") tongno_thuc,
sum(nogoc_km) nogoc_km,
sum(thue_km) thue_km,
to_char(sum(tongno_km), :"SYS_B_001") tongno_km,
sum(nogoc) nogoc,
sum(thue) thue,
to_char(sum(tongno), :"SYS_B_002") tongno,
max(ma_tb) ma_tb,
to_char(sum(datra), :"SYS_B_003") datra,
to_char(sum(da_km), :"SYS_B_004") da_km,
:"SYS_B_005" da_ck,
to_char(sum(da_dc), :"SYS_B_006") da_dc,
to_char(sum(thu_kyquy), :"SYS_B_007") thu_kyquy,
to_char(sum(tinhthuho), :"SYS_B_008") tinhthuho,
to_char(sum(thu_cuocnong), :"SYS_B_009") thu_cuocnong,
to_char(sum(cuocnong), :"SYS_B_010") cuocnong,
:"SYS_B_011" tt_cuocnong,
to_char(sum(tra_cuocnong), :"SYS_B_012") tra_cuocnong,
max(thongbao) thongbao,
max(ma_nv) ma_nv,
max(ma_t) ma_t,
:"SYS_B_013" kh_hientai
from (select distinct qltn_tamthu.chuanhoa_string(kh.ten_tt) ten_tt,
qltn_tamthu.chuanhoa_string(kh.diachi_tt) diachi_tt,
kh.ms_thue, kh.ma_kh,
nvl(no.nogoc, :"SYS_B_014") nogoc_thuc,
nvl(no.thue, :"SYS_B_015") thue_thuc,
to_char(nvl(no.nogoc, :"SYS_B_016")+nvl(no.thue, :"SYS_B_017"), :"SYS_B_018") tongno_thuc,
nvl(km.nogoc, :"SYS_B_019") nogoc_km,
nvl(km.thue, :"SYS_B_020") thue_km,
to_char( nvl(km.nogoc, :"SYS_B_021")+nvl(km.thue, :"SYS_B_022"), :"SYS_B_023") tongno_km,
(nvl(no.nogoc, :"SYS_B_024")-nvl(km.nogoc, :"SYS_B_025")) nogoc,
(nvl(no.thue, :"SYS_B_026")-nvl(km.thue, :"SYS_B_027")) thue,
to_char( nvl(no.nogoc, :"SYS_B_028")-nvl(km.nogoc, :"SYS_B_029")+nvl(no.thue, :"SYS_B_030")-nvl(km.thue, :"SYS_B_031"), :"SYS_B_032") tongno,
nvl(no.ma_tb, kh.sodaidien) ma_tb,
to_char(nvl(da_tra.tra, :"SYS_B_033"), :"SYS_B_034") datra,
to_char(nvl(da_km.tra, :"SYS_B_035"), :"SYS_B_036") da_km,
:"SYS_B_037" da_ck,
to_char(nvl(da_dc.tra, :"SYS_B_038"), :"SYS_B_039") da_dc,
TO_CHAR(nvl(thu_kq.tien, :"SYS_B_040")-nvl(chi_kq.tien, :"SYS_B_041"), :"SYS_B_042") thu_kyquy,
to_char(nvl(tien_th.tien, :"SYS_B_043")-nvl(gach_th.tien, :"SYS_B_044"), :"SYS_B_045") tinhthuho,
TO_CHA
R(nvl(thu_cn.tien, :"SYS_B_046")-nvl(chi_cn.tien, :"SYS_B_047"), :"SYS_B_048") thu_cuocnong , to_char(nvl(thdd_cn.tien, :"SYS_B_049"), :"SYS_B_050") cuocnong,
:"SYS_B_051" tt_cuocnong , to_char(qltn_tamthu.laytt_tientamthu2(
nvl(thdd_cn.tien, :"SYS_B_052"),
nvl(thdd_cn.qtrm, :"SYS_B_053"),
:"SYS_B_054"), :"SYS_B_055") tra_cuocnong,
--bo qua viec query sang VNP67 de tranh viec nghen he thong
--Khong chinh xac - phai la doituong_id trong danh ba
decode(nvl(db.doituong_id, :"SYS_B_056"), :"SYS_B_057", :"SYS_B_058", :"SYS_B_059") --khach hang nuoc ngoai hoac khu che xuat
|| (case when nvl(no.nogoc, :"SYS_B_060")+ nvl(no.thue, :"SYS_B_061") <=:"SYS_B_062" then :"SYS_B_063" else :"SYS_B_064" end) --khach hang het no
|| (case when nvl(tien_th.tien, :"SYS_B_065")-nvl(gach_th.tien, :"SYS_B_066") >:"SYS_B_067" then :"SYS_B_068" else :"SYS_B_069" end) --khach hang co thu ho
|| (case when nvl(km.nogoc, :"SYS_B_070")+nvl(km.thue, :"SYS_B_071") >:"SYS_B_072" then :"SYS_B_073" else :"SYS_B_074" end) --khach hang co khuyen mai
||:"SYS_B_075" --co nhieu khach hang
thongbao,
kh.ma_nv, kh.ma_t/*,
decode(no.ma_tb, db.somay, 1, 0) kh_hientai*/
from
(select * from CCS_HCM.khachhangs_pttb where ma_kh in (:"SYS_B_
076") ) kh
, (
SELECT ma_kh, SUM (nogoc) nogoc, SUM (thue) thue, max(ma_tb) ma_tb
from CCS_HCM.ct_no_052009
where kieuno<>:"SYS_B_077" and ma_kh in (:"SYS_B_078") and ma_tb in (:"SYS_B_079")
and loaitien_id in (:"SYS_B_080")
group by ma_kh
) no
, (
SELECT ma_kh, SUM (nogoc) nogoc, SUM (thue) thue
from CCS_HCM.ct_no_052009
where kieuno=:"SYS_B_081" and ma_kh in (:"SYS_B_082") and ma_tb in (:"SYS_B_083")
and loaitien_id in (:"SYS_B_084")
group by ma_kh
) km
, (
SELECT ma_kh, sum(tragoc+trathue) tra
from CCS_HCM.ct_tra_052009
where ma_kh in (:"SYS_B_085") and ma_tb in (:"SYS_B_086")
and loaitien_id in (:"SYS_B_087")
group by ma_kh
) da_tra
, (
SELECT ctt.ma_kh, sum(ctt.tragoc+ctt.trathue) tra
from CCS_HCM.ct_tra_052009 ctt, CCS_HCM.bangphieutra_052009 pt
where ctt.phieu_id=pt.phieu_id
and ctt.ma_kh in (:"SYS_B_088") and ma_tb in (:"SYS_B_089")
and ctt.loaitien_id in (:"SYS_B_090") and pt.httt_id in (:"SYS_B_091")
group by ctt.ma_kh
) da_km
, (
SELECT ctt.ma_kh, sum(ctt.tragoc+ctt.trathue) tra
from CCS_HCM.ct_tra_052009 ctt, CCS_HCM.bangphieutra_052009 pt
where ctt.phieu_id=pt.phieu_id
and ctt.ma_kh in (:"SYS_B_092") and ma_tb in (:"SYS_B_093")
and ctt.loaitien_id in (:"SYS_B_094") and pt.httt_id in (:"SYS_B_095", :"SYS_B_096")
group by ctt.ma_kh
) da_dc
, (
SELECT ma_kh, sum(sotien) tien
from CCS_HCM.kyquys
where ma_kh in (:"SYS_B_097") and ma_tb in (:"SYS_B_098")
and loaitien_id in (:"SYS_B_099")
group by ma_kh
) thu_kq
, (
SELECT ma_kh, sum(sotien) tien
from CCS_HCM.chikyquys
where ma_kh in (:"SYS_B_100") and ma_tb in (:"SYS_B_101")
and loaitien_id in (:"SYS_B_102")
group by ma_kh
) chi_kq
, (
SELECT ma_kh, sum(tragoc+trathue) tien
from CCS_HCM.cn_052009
where ma_kh in (:"SYS_B_103") and ma_tb in (:"SYS_B_104")
and loaitien_id in (:"SYS_B_105")
and khoanmuctt_id=:"SYS_B_106"
group by ma_kh
) thu_cn
, (
SELECT
ma_kh, sum(tragoc+trathue) tien
from CCS_HCM.chi_cn_052009
where ma_kh in (:"SYS_B_107") and ma_tb in (:"SYS_B_108")
and loaitien_id in (:"SYS_B_109")
group by ma_kh
) chi_cn
, (
SELECT ma_kh, sum(sotien) tien
from ccs_common.thuho_052009
where tinh_id=:"SYS_B_110" and ma_kh in (:"SYS_B_111") and ma_tb in (:"SYS_B_112")
and loaitien_id in (:"SYS_B_113")
group by ma_kh
) tien_th
, (
SELECT ma_kh, sum(tiengach) tien
from ccs_common.thuho_052009
where tinh_id=:"SYS_B_114" and ma_kh in (:"SYS_B_115") and ma_tb in (:"SYS_B_116")
and loaitien_id in (:"SYS_B_117")
group by ma_kh
) gach_th , (
SELECT ma_kh, round(sum(tien+vat)) tien,
count (distinct (decode(khoanmuctc_id, :"SYS_B_118", :"SYS_B_119", :"SYS_B_120", :"SYS_B_121", null))) qtrm
from CCS_HCM.thdd_200906@DBL_2_BILLING
where ma_kh in (:"SYS_B_122") and somay in (:"SYS_B_123")
and usd = (case when :"SYS_B_124"=:"SYS_B_125" then :"SYS_B_126" else :"SYS_B_127" end)
group by ma_kh
) thdd_cn , (select * from CCS_HCM.danhba_dds_
pttb where :"SYS_B_128"=:"SYS_B_129" and somay in (:"SYS_B_130") ) db where kh.ma_kh=no.ma_kh(+)
and kh.ma_kh=km.ma_kh(+)
and kh.ma_kh=da_tra.ma_kh(+)
and kh.ma_kh=da_km.ma_kh(+)
and kh.ma_kh=da_dc.ma_kh(+)
and kh.ma_kh=thu_kq.ma_kh(+)
and kh.ma_kh=chi_kq.ma_kh(+)
AND kh.ma_kh=thu_cn.ma_kh(+)
and kh.ma_kh=chi_cn.ma_kh(+)
and kh.ma_kh=tien_th.ma_kh(+)
and kh.ma_kh=gach_th.ma_kh(+)
and kh.ma_kh=db.ma_kh(+) and kh.ma_kh=thdd_cn.ma_kh(+)) |
| 05j2msn3cwp80 | select count(:"SYS_B_0") from CCS_THA.danhba_dds_pttb a where a.somay=:"SYS_B_1" |
| 09738z0xuauzd | select count(*) tongsobl,
to_char(sum(nvl(replace(sotienhuy, :"SYS_B_00", :"SYS_B_01"), :"SYS_B_02")), :"SYS_B_03") sotienhuy,
qltn_baocao.tienchu(sum(nvl(replace(sotienhuy, :"SYS_B_04", :"SYS_B_05"), :"SYS_B_06"))) tienchu
from (SELECT Huy.Ma_tn || :"SYS_B_07" || Huy.Sophieu Sobl, Huy.Ma_kh, Kh.Ten_tt, huy.soseri, huy.seri,
Huy.Nguoihuy, Huy.Huytumay, to_char(Huy.Ngayhuy, :"SYS_B_08") ngayhuy, to_char(Huy.Sotienhuy, :"SYS_B_09") sotienhuy
FROM CCS_HCM.Bienlaihuys Huy, CCS_HCM.Khachhangs_052009 Kh
WHERE Huy.Ma_kh = Kh.Ma_kh AND huy.ma_tn=:"SYS_B_10" AND huy.ngayhuy >= to_date(:"SYS_B_11", :"SYS_B_12") AND huy.ngayhuy <= to_date(:"SYS_B_13", :"SYS_B_14")) |
| 0araq3sudk126 |
SELECT rownum stt, x.* FROM ( SELECT tennganhang_user, ten_dv_user, ten_rpt_user, lanhdao_user, chucdanh_user, diachi_hd_user, ms_thue_user, tinh_kh, taikhoan_user, dienthoai_user, fax_user, ten_dv, ten_dv1, dangky_db_co, dangky_db_k, inchitiet_co, inchitiet_k, ten_rpt, ten_hd, lanhdao, lanhdao1, chucdanh, diachi_hd, msthueB, taikhoanB, dienthoai, fax, nguoi_dd, nguoi_dd1, nguoi_dd2, email, tennganhangb1, tennganhangb, tennganhanga1, tennganhanga, tennha, tien, tienchu, cuoc, tienchu cuoc_chu, kh_sonha, so_nha, kh_quanhuyen, kh_phuongxa, kh_pho, kh_tinh, kh_tinha, kh_tinhb, kh_tinhc, ten_kh, ten_kh1, ten_tt, diachi_ct, diachi_ct1, ms_thue, taikhoan, tai_khoana, cmt , ngaycap_gt, noicap_gt, chucvu, dt_lienhe, mahd, makh, ngay_laphd, dichvuvt_id, tai_nha, tai_bd, tai_nh, chuyen_khoan, hinhthuc_tainha, hinhthuc_tainha||:"SYS_B_00"||diachi_tt hinhthuc_tainha1, hinhthuc_taibuudien, hinhthuc_chuyenkhoan, code, diachi_tt, ten_tt||:"SYS_B_01"||diachi_tt dc_tt, hinhthuc_tainganhang, ma_so, bk_email, bk_buudien, bk_khong, bk_nha, yeucau, gt, uynhiem_chi, uynhiem_thu FROM ( SELECT distinct upper(dv.ten_dv) ten_dv, dv_user.ten_dv ten_dv_user, upper(dv.ten_dv) ten_dv1, DECODE(TO_CHAR(hd.dangky_db), :"SYS_B_02", :"SYS_B_03", :"SYS_B_04") dangky_db_co, DECODE(TO_CHAR(hd.dangky_db), :"SYS_B_0
5", :"SYS_B_06", :"SYS_B_07") dangky_db_k, DECODE(TO_CHAR(tb.inchitiet), :"SYS_B_08", :"SYS_B_09", :"SYS_B_10") inchitiet_co, DECODE(TO_CHAR(tb.inchitiet), :"SYS_B_11", :"SYS_B_12", :"SYS_B_13") inchitiet_k, dv.ten_rpt, dv.ten_hd, dv.lanhdao, dv.lanhdao lanhdao1, dv.chucdanh chucdanh, dv.diachi_hd, dv.ms_thue msthueB, dv.taikhoan taikhoanB, dv.dienthoai, dv.fax, NVL(hd.nguoi_dd, hd.ten_tt) nguoi_dd, NVL(hd.nguoi_dd, hd.ten_tt) nguoi_dd1, NVL(hd.nguoi_dd, hd.ten_tt) nguoi_dd2, hd.email, nh.ten tennganhangb1, nh_user.ten tennganhang_user, nh.ten tennganhangb, nh_hd.ten tennganhanga1, nh_hd.ten tennganhanga, nh_hd.ten tennhA, dv_user.ten_rpt ten_rpt_user, dv_user.lanhdao lanhdao_user, a_kh.name tinh_kh, dv_user.chucdanh chucdanh_user, dv_user.diachi_hd diachi_hd_user, dv_user.ms_thue ms_thue_user, dv_user.taikhoan taikhoan_user, dv_user.dienthoai dienthoai_user, dv_user.fax fax_user, TO_CHAR(TB.CUOC_LD+TB.VAT_LD, :"SYS_B_14") TIEN, UTIL.doisosangchu(TO_CHAR(nvl(TB.CUOC_LD+TB.VAT_LD, :"SYS_B_15"))) TIENCHU, hd.so_gt cmt, NVL(tb.cuoc_ld + tb.vat_ld, :"SYS_B_16") cuoc, hd.so_nha KH_SoNha, hd.so_nha , qn.tenquan kh_quanhuyen, ph.tenphuong kh_phuongxa, dp.tenpho kh_pho, ag.name kh_tinh, ag.name kh_tinhA, ag.name kh_tinhB, ag.name kh_tinhC, hd.coquan ten_kh, up
per(hd.coquan) ten_kh1, hd.ten_tt, hd.diachi_ct, hd.diachi_ct DIACHI_CT1, hd.diachi_tt, hd.ms_thue, hd.taikhoan, hd.taikhoan tai_khoanA, hd.ngaycap_gt, hd.noicap_gt, hd.chucdanh chucvu, hd.DIENTHOAI_LH dt_lienhe, hd.DIADIEMTT_ID, hd.ma_hd MaHD, hd.ma_kh MaKH, TO_CHAR(hd.ngay_laphd, :"SYS_B_17")NGAY_LAPHD, hd.dichvuvt_id, DECODE(hd.diadiemtt_id, :"SYS_B_18", :"SYS_B_19", :"SYS_B_20") tai_nha, DECODE(hd.diadiemtt_id, :"SYS_B_21", :"SYS_B_22", :"SYS_B_23") tai_BD, DECODE(hd.diadiemtt_id, :"SYS_B_24", :"SYS_B_25", :"SYS_B_26") tai_NH, DECODE(hd.diadiemtt_id, :"SYS_B_27", :"SYS_B_28", :"SYS_B_29") chuyen_khoan, DECODE(hd.diadiemtt_id, :"SYS_B_30", :"SYS_B_31", :"SYS_B_32") hinhthuc_tainha, DECODE(hd.diadiemtt_id, :"SYS_B_33", :"SYS_B_34", :"SYS_B_35") hinhthuc_taibuudien, DECODE(hd.diadiemtt_id, :"SYS_B_36", :"SYS_B_37", :"SYS_B_38") hinhthuc_chuyenkhoan, DECODE(hd.diadiemtt_id, :"SYS_B_39", :"SYS_B_40", :"SYS_B_41") hinhthuc_tainganhang, DECODE (hd.chuyenkhoan_id, :"SYS_B_42", :"SYS_B_43", :"SYS_B_44")uynhiem_chi, DECODE (hd.chuyenkhoan_id, :"SYS_B_45", :"SYS_B_46", :"SYS_B_47")uynhiem_thu, gt.code, bc.ma_bc||:"SYS_B_48"||hd.nguoi_cn||:"SYS_B_49"||TO_CHAR(sysdate, :"SYS_B_50") ma_so, DECODE(tb.kieubc_id, :"SYS_B_51", :"SYS_B_52", :"SYS_B_53") bk_email, DECODE(tb.kieubc_id, :"SYS_B_54", :"SYS_B_55", :"SYS_B_56") bk_buudien,
DECODE(tb.kieubc_id, :"SYS_B_57", :"SYS_B_58", :"SYS_B_59") bk_khong, DECODE(tb.kieubc_id, :"SYS_B_60", :"SYS_B_61", :"SYS_B_62") bk_nha, DECODE(tb.kieuld_id, :"SYS_B_63", :"SYS_B_64", :"SYS_B_65", :"SYS_B_66", :"SYS_B_67", :"SYS_B_68", :"SYS_B_69") yeucau, DECODE(hd.loaigt_id, :"SYS_B_70", :"SYS_B_71", :"SYS_B_72", :"SYS_B_73", :"SYS_B_74", :"SYS_B_75", :"SYS_B_76", :"SYS_B_77") gt FROM (SELECT dv.*, nvl(cd.ten, :"SYS_B_78") chucdanh FROM CCS_BNH.donvi_qls dv,
CCS_BNH.chucdanhs cd WHERE dv.chucdanh_id = cd.chucdanh_id(+) )dv,
CCS_BNH.buucucthus bc,
CCS_BNH.hopdong_lds hd, (SELECT * FROM CCS_BNH.thuebao_lds WHERE MA_HD=:"SYS_B_79" AND rownum<=:"SYS_B_80") tb, CCS_BNH.nganhangs nh ,
CCS_BNH.nganhangs nh_user, (SELECT * FROM CCS_BNH.nganhangs)nh_hd,
ccs_common.agent ag, (SELECT dv.*, NVL (cd.ten, :"SYS_B_81") chucdanh FROM CCS_BNH.donvi_qls dv,
CCS_BNH.chucdanhs cd WHERE dv.chucdanh_id = cd.chucdanh_id(+)) dv_user,
ccs_common.quans qn,
ccs_common.quans q_kh,
ccs_common.agent a_kh,
ccs_co
mmon.phuongs ph,
ccs_common.DUONGPHOS dp,
ccs_common.MAPHOS mp,
CCS_BNH.users us,
ccs_common.loai_gts gt WHERE :"SYS_B_82"=:"SYS_B_83" and us.name=:"SYS_B_84" AND ag.schema = :"SYS_B_85" and hd.ma_bc = bc.ma_bc AND tb.ma_hd = hd.ma_hd AND dv_user.donviql_id = us.donviql_id AND hd.loaigt_id= gt.loaigt_id AND q_kh.quan_id(+) = hd.quan_id AND a_kh.agent_id(+) = q_kh.tinh_id AND dv.nganhang_id = nh.nganhang_id(+) AND dv_user.nganhang_id = nh_user.nganhang_id(+) AND hd.nganhang_id = nh_hd.nganhang_id(+) AND bc.donviql_id = dv.donviql_id AND hd.quan_id =qn.quan_id(+) AND hd.phuong_id=ph.phuong_id(+) AND hd.pho_id=mp.pho_id(+) AND dp.pho_id(+)=mp.pho_id AND hd.ma_hd in(:"SYS_B_86")) ) x |
| 0dfm88ub23204 | SELECT MA_TN FROM CCS_HNM.NGUOIGACHNOS WHERE NGUOIGACH=:"SYS_B_0" |
| 0h6b2sajwb74n | select privilege#, level from sysauth$ connect by grantee#=prior privilege# and privilege#>0 start with grantee#=:1 and privilege#>0 |
| 1gj7gpvbzb4z3 |
select DISTINCT no.*, kh.ma_cq, replace(kh.ten_tt, :"SYS_B_00", :"SYS_B_01") ten_tt,
replace(kh.diachi_tt, :"SYS_B_02", :"SYS_B_03") diachi_tt, kh.ms_thue,
tb.ten trangthai
from (select to_char(sum(nogoc_dk+thue_dk), qltn.lay_fm(ct.loaitien_id)) no_dk,
to_char(sum(nogoc_ps+thue_ps), qltn.lay_fm(ct.loaitien_id)) no_ps,
to_char(sum(nogoc_km+thue_km), qltn.lay_fm(ct.loaitien_id)) no_km,
to_char(sum(nogoc_dk+thue_dk+nogoc_ps+thue_ps-nogoc_km-thue_km),
qltn.lay_fm(ct.loaitien_id)) tongno,
ct.ma_kh, ct.ma_tb, ct.loaitien_id, ct.donviql_id,
trim(QLTN.chukyno_dangchu(chukyno, :"SYS_B_04", :"SYS_B_05")) chukyno,
kieuno, chukyno ckn,
sum(nogoc_dk) nogoc_dk, sum(nogoc_ps) nogoc_ps,
sum(thue_dk) thue_dk, sum(thue_ps) thue_ps,
sum(nogoc_km) nogoc_km, sum(thue_km) thue_km,
to_char(sum(ndk), qltn.lay_fm(ct.loaitien_id)) ndk,
to_char(sum(nps), qltn.lay_fm(ct.loaitien_id)) nps,
to_char(sum(tra), qltn.lay_fm(ct.loaitien_id)) tra
from (select ct.ma_kh, ct.ma_tb, ct.loaitien_id,
ct.donviql_id, chukyno, decode(kieuno, :"SYS_B_06", :"SYS_B_07", :"SYS_B_08") kieuno,
decode(kieuno,
:"SYS_B_09", :"SYS_B_10", sum(nogoc_dk)) nogoc_dk,
decode(kieuno, :"SYS_B_11", :"SYS_B_12", sum(nogoc_ps)) nogoc_ps,
decode(kieuno, :"SYS_B_13", :"SYS_B_14", sum(thue_dk)) thue_dk,
decode(kieuno, :"SYS_B_15", :"SYS_B_16", sum(thue_ps)) thue_ps,
decode(kieuno, :"SYS_B_17", sum(nogoc_ps+nogoc_dk), :"SYS_B_18") nogoc_km,
decode(kieuno, :"SYS_B_19", sum(thue_ps+thue_dk), :"SYS_B_20") thue_km,
/*sum(nps) nps, sum(ndk) ndk, sum(tra) tra*/
QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, null, :"SYS_B_21", :"SYS_B_22", :"SYS_B_23") ndk,
QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, null, :"SYS_B_24", :"SYS_B_25", :"SYS_B_26") nps,
QLTN_TRACUU.laytt_tra(ma_kh, ma_tb, chukyno, null, kieuno, :"SYS_B_27", :"SYS_B_28") tra
from (SELECT ma_kh, ma_tb, loaitien_id, khoanmuctt_id, vbcc_id, donviql_id,
chukyno,
decode(kieuno, :"SYS_B_29", SUM (nogoc), :"SYS_B_30") nogoc_dk,
decode(kieuno, :"SYS_B_31", :"SYS_B_32", SUM (nogoc)) nogoc_ps,
decode(kieuno, :"SYS_B_33", SUM (hoahong), :"SYS_B_34") hoahong_dk,
decode(kieuno, :"SYS_B_35", :"SYS_B_36", SUM (hoahong)) hoahong_ps,
decode(ki
euno, :"SYS_B_37", SUM (thue), :"SYS_B_38") thue_dk,
decode(kieuno, :"SYS_B_39", :"SYS_B_40", SUM (thue)) thue_ps,
kieuno, :"SYS_B_41" ndk, :"SYS_B_42" nps, :"SYS_B_43" tra
/*QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, khoanmuctt_id, 0, 'CCS_HCM.', 'hophtb_hcm') ndk,
QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, khoanmuctt_id, 5, 'CCS_HCM.', 'hophtb_hcm') nps,
QLTN_TRACUU.laytt_tra(ma_kh, ma_tb, chukyno, khoanmuctt_id, kieuno, 'CCS_HCM.', 'hophtb_hcm') tra*/
from CCS_HCM.ct_no_052009
where :"SYS_B_44"=:"SYS_B_45" and ma_kh in (:"SYS_B_46")
group by ma_kh,
ma_tb,
loaitien_id,
khoanmuctt_id,
vbcc_id,
donviql_id,
chukyno,
kieuno) ct group by ma_kh, ma_tb, loaitien_id, donviql_id, chukyno, kieuno) ct where :"SYS_B_47"=:"SYS_B_48" and ma_kh in (:"SYS_B_49") and loaitien_id in (:"SYS_B_50") and ma_tb in (:"SYS_B_51") group by ma_kh, ma_tb, loaitien_id, donviql_id, chukyno, kieuno ) no, (select * from CCS_HCM.khachhangs_052009 where :"SYS_B_52"=:"SYS_B_53" and ma_kh in (:"SYS_B_54") ) kh,
(select a.somay, b.ten from CCS_HCM.danhba_dds_pttb a,
ccs_common.trangthai_tbs b
where a.trangthai_id=b.trangthai_id and ma_kh in (:"SYS_B_55") ) tb
where no.ma_kh=kh.ma_kh
and no.ma_tb=tb.somay(+) order by no.ma_kh, no.ma_tb, no.ckn desc |
| 1kdq68v2pg109 | select rownum row_stt, c.* from (SELECT ma_tb, trim(ten_tb) ten_tb, diachi diachitb, loaitb_id, dichvuvt_id, MA_KH, trang_thai, ten_tt FROM ( SELECT db.somay ma_tb, kh.ten_tt, db.ten_tb, db.diachi, db.loaitb_id, :"SYS_B_0" dichvuvt_id, db.ma_kh, tt.ten trang_thai FROM CCS_HNI.danhba_dds_pttb db, CCS_HNI.khachhangs_pttb kh, CCS_HNI.trangthai_tbs tt WHERE kh.ma_kh = db.ma_kh and db.trangthai_id = tt.trangthai_id and :"SYS_B_1"=:"SYS_B_2" and lower(kh.ten_tt) like :"SYS_B_3" )) c where rownum<:"SYS_B_4" |
| 1mp1p5q2zs09c | select sum(nvl(tragoc, 0)+nvl(trathue, 0)) from
(select ma_kh, ma_tb, chukyno, kieutra, tragoc, trathue, khoanmuctt_id from CCS_HCM.ct_tra_052009 tra
where tra.ma_kh=:ma_kh and tra.ma_tb=:ma_tb and
kieutra=:kieutra
union all
select ma_kh, ma_tb, chukyno, kieuno, nogoc, thue, khoanmuctt_id from CCS_HCM.ct_no_052009 no
where no.ma_kh=:ma_kh and no.ma_tb=:ma_tb and
kieuno=:kieuno) |
| 1qstz296jght8 | SELECT COUNT (a.trigger_name) FROM all_triggers a, all_objects b WHERE a.owner = b.owner AND a.trigger_name = b.object_name AND a.owner = :"SYS_B_0" AND a.base_object_type = :"SYS_B_1" AND a.table_name = :"SYS_B_2" /* AND a.trigger_name IN ('GACH_NO_052009', 'XOA_PHIEU_052009') */ AND a.status = :"SYS_B_3" AND b.object_type = :"SYS_B_4" AND b.status = :"SYS_B_5" |
| 1uybv5w95akxw |
select max(ten_tt) ten_tt,
max(diachi_tt) diachi_tt,
max(ms_thue) ms_thue,
max(ma_kh) ma_kh,
sum(nogoc_thuc) nogoc_thuc,
sum(thue_thuc) thue_thuc,
to_char(sum(tongno_thuc), :"SYS_B_00") tongno_thuc,
sum(nogoc_km) nogoc_km,
sum(thue_km) thue_km,
to_char(sum(tongno_km), :"SYS_B_01") tongno_km,
sum(nogoc) nogoc,
sum(thue) thue,
to_char(sum(tongno), :"SYS_B_02") tongno,
max(ma_tb) ma_tb,
to_char(sum(datra), :"SYS_B_03") datra,
to_char(sum(da_km), :"SYS_B_04") da_km,
:"SYS_B_05" da_ck,
to_char(sum(da_dc), :"SYS_B_06") da_dc,
to_char(sum(thu_kyquy), :"SYS_B_07") thu_kyquy,
to_char(sum(tinhthuho), :"SYS_B_08") tinhthuho,
to_char(sum(thu_cuocnong), :"SYS_B_09") thu_cuocnong,
to_char(sum(cuocnong), :"SYS_B_10") cuocnong,
:"SYS_B_11" tt_cuocnong,
to_char(sum(tra_cuocnong), :"SYS_B_12") tra_cuocnong,
max(thongbao) thongbao,
max(ma_nv) ma_nv,
max(ma_t) ma_t,
:"SYS_B_13" kh_hientai
from (select distinct qltn_tamthu.chuanhoa_string(kh.ten_tt) ten_tt,
qltn_tamthu.chuanhoa_string(kh.diachi_tt) diachi_tt,
kh.ms_thue, kh.ma_kh,
nvl(no.nogoc, :"SYS_B_14") nogoc_thuc,
nvl(no.thue, :"SYS_B_15") thue_thuc,
to_char(nvl(no.nogoc, :"SYS_B_16")+nvl(no.thue, :"SYS_B_17"), :"SYS_B_18") tongno_thuc,
nvl(km.nogoc, :"SYS_B_19") nogoc_km,
nvl(km.thue, :"SYS_B_20") thue_km,
to_char( nvl(km.nogoc, :"SYS_B_21")+nvl(km.thue, :"SYS_B_22"), :"SYS_B_23") tongno_km,
(nvl(no.nogoc, :"SYS_B_24")-nvl(km.nogoc, :"SYS_B_25")) nogoc,
(nvl(no.thue, :"SYS_B_26")-nvl(km.thue, :"SYS_B_27")) thue,
to_char( nvl(no.nogoc, :"SYS_B_28")-nvl(km.nogoc, :"SYS_B_29")+nvl(no.thue, :"SYS_B_30")-nvl(km.thue, :"SYS_B_31"), :"SYS_B_32") tongno,
nvl(no.ma_tb, kh.sodaidien) ma_tb,
to_char(nvl(da_tra.tra, :"SYS_B_33"), :"SYS_B_34") datra,
to_char(nvl(da_km.tra, :"SYS_B_35"), :"SYS_B_36") da_km,
:"SYS_B_37" da_ck,
to_char(nvl(da_dc.tra, :"SYS_B_38"), :"SYS_B_39") da_dc,
/*TO_CHAR(nvl(thu_kq.tien, 0)-nvl(chi_kq.tien, 0), 'fm999999999999999999') thu_kyquy, */ :"SYS_B_40" thu_kyquy,
to_char(nvl(tien_th.tien, :"SYS_B_41")-nvl(gach_th.tien, :"SYS_B_42"), :"SYS_B_43") tinhthuho,
TO_CHAR(nvl(thu_cn.tien, :"SYS
_B_44")-nvl(chi_cn.tien, :"SYS_B_45"), :"SYS_B_46") thu_cuocnong , :"SYS_B_47" cuocnong , :"SYS_B_48" tt_cuocnong, :"SYS_B_49" tra_cuocnong,
--bo qua viec query sang VNP67 de tranh viec nghen he thong
--Khong chinh xac - phai la doituong_id trong danh ba
decode(nvl(db.doituong_id, :"SYS_B_50"), :"SYS_B_51", :"SYS_B_52", :"SYS_B_53") --khach hang nuoc ngoai hoac khu che xuat
|| (case when nvl(no.nogoc, :"SYS_B_54")+ nvl(no.thue, :"SYS_B_55") <=:"SYS_B_56" then :"SYS_B_57" else :"SYS_B_58" end) --khach hang het no
|| (case when nvl(tien_th.tien, :"SYS_B_59")-nvl(gach_th.tien, :"SYS_B_60") >:"SYS_B_61" then :"SYS_B_62" else :"SYS_B_63" end) --khach hang co thu ho
|| (case when nvl(km.nogoc, :"SYS_B_64")+nvl(km.thue, :"SYS_B_65") >:"SYS_B_66" then :"SYS_B_67" else :"SYS_B_68" end) --khach hang co khuyen mai
||:"SYS_B_69" --co nhieu khach hang
thongbao,
kh.ma_nv, kh.ma_t/*,
decode(no.ma_tb, db.somay, 1, 0) kh_hientai*/
from
(select * from CCS_HNI.khachhangs_052009 where ma_kh in (:"SYS_B_70") ) kh
, (
SELECT ma_kh, SUM (nogoc) nogoc, SUM (thue) thue, max(ma_tb) ma_tb
from CCS_HNI.ct_no_052009
where kieuno<>:"SYS_B_71" and ma_kh in (:"SYS_B_72")
and loaitien_id in (:"SYS_B_73")
group by ma_kh
)
no
, (
SELECT ma_kh, SUM (nogoc) nogoc, SUM (thue) thue
from CCS_HNI.ct_no_052009
where kieuno=:"SYS_B_74" and ma_kh in (:"SYS_B_75")
and loaitien_id in (:"SYS_B_76")
group by ma_kh
) km
, (
SELECT ma_kh, sum(tragoc+trathue) tra
from CCS_HNI.ct_tra_052009
where ma_kh in (:"SYS_B_77")
and loaitien_id in (:"SYS_B_78")
group by ma_kh
) da_tra
, (
SELECT ctt.ma_kh, sum(ctt.tragoc+ctt.trathue) tra
from CCS_HNI.ct_tra_052009 ctt, CCS_HNI.bangphieutra_052009 pt
where ctt.phieu_id=pt.phieu_id
and ctt.ma_kh in (:"SYS_B_79")
and ctt.loaitien_id in (:"SYS_B_80") and pt.httt_id in (:"SYS_B_81")
group by ctt.ma_kh
) da_km
, (
SELECT ctt.ma_kh, sum(ctt.tragoc+ctt.trathue) tra
from CCS_HNI.ct_tra_052009 ctt, CCS_HNI.bangphieutra_052009 pt
where ctt.phieu_id=pt.phieu_id
and ctt.ma_kh in (:"SYS_B_82")
and ctt.loaitien_id in (:"SYS_B_83") and pt.httt_id in (:"SYS_B_84", :"SYS_B_85")
group by ctt.ma_kh
) da_dc
, /*(
S
ELECT ma_kh, sum(sotien) tien
from CCS_HNI.kyquys
where ma_kh in ('HNIDD00139182')
and loaitien_id in (1)
group by ma_kh
) thu_kq
, (
SELECT ma_kh, sum(sotien) tien
from CCS_HNI.chikyquys
where ma_kh in ('HNIDD00139182')
and loaitien_id in (1)
group by ma_kh
) chi_kq
, */ (
SELECT ma_kh, sum(tragoc+trathue) tien
from CCS_HNI.cn_052009
where ma_kh in (:"SYS_B_86")
and loaitien_id in (:"SYS_B_87")
and khoanmuctt_id=:"SYS_B_88"
group by ma_kh
) thu_cn
, (
SELECT ma_kh, sum(tragoc+trathue) tien
from CCS_HNI.chi_cn_052009
where ma_kh in (:"SYS_B_89")
and loaitien_id in (:"SYS_B_90")
group by ma_kh
) chi_cn
, (
SELECT ma_kh, sum(sotien) tien
from ccs_common.thuho_052009
where tinh_id=:"SYS_B_91" and ma_kh in (:"SYS_B_92")
and loaitien_id in (:"SYS_B_93")
group by ma_kh
) tien_th
, (
SELECT ma_kh, sum(ti
engach) tien
from ccs_common.thuho_052009
where tinh_id=:"SYS_B_94" and ma_kh in (:"SYS_B_95")
and loaitien_id in (:"SYS_B_96")
group by ma_kh
) gach_th , (select * from CCS_HNI.danhba_dds_052009) db where kh.ma_kh=no.ma_kh(+)
and kh.ma_kh=km.ma_kh(+)
and kh.ma_kh=da_tra.ma_kh(+)
and kh.ma_kh=da_km.ma_kh(+)
and kh.ma_kh=da_dc.ma_kh(+)
/*
and kh.ma_kh=thu_kq.ma_kh(+)
and kh.ma_kh=chi_kq.ma_kh(+)
*/
AND kh.ma_kh=thu_cn.ma_kh(+)
and kh.ma_kh=chi_cn.ma_kh(+)
and kh.ma_kh=tien_th.ma_kh(+)
and kh.ma_kh=gach_th.ma_kh(+)
and kh.ma_kh=db.ma_kh(+)) |
| 1zzcqt7fjyuux |
select DISTINCT no.*, kh.ma_cq, replace(kh.ten_tt, :"SYS_B_00", :"SYS_B_01") ten_tt,
replace(kh.diachi_tt, :"SYS_B_02", :"SYS_B_03") diachi_tt, kh.ms_thue,
tb.ten trangthai
from (select to_char(sum(nogoc_dk+thue_dk), qltn.lay_fm(ct.loaitien_id)) no_dk,
to_char(sum(nogoc_ps+thue_ps), qltn.lay_fm(ct.loaitien_id)) no_ps,
to_char(sum(nogoc_km+thue_km), qltn.lay_fm(ct.loaitien_id)) no_km,
to_char(sum(nogoc_dk+thue_dk+nogoc_ps+thue_ps-nogoc_km-thue_km),
qltn.lay_fm(ct.loaitien_id)) tongno,
ct.ma_kh, ct.ma_tb, ct.loaitien_id, ct.donviql_id,
trim(QLTN.chukyno_dangchu(chukyno, :"SYS_B_04", :"SYS_B_05")) chukyno,
kieuno, chukyno ckn,
sum(nogoc_dk) nogoc_dk, sum(nogoc_ps) nogoc_ps,
sum(thue_dk) thue_dk, sum(thue_ps) thue_ps,
sum(nogoc_km) nogoc_km, sum(thue_km) thue_km,
to_char(sum(ndk), qltn.lay_fm(ct.loaitien_id)) ndk,
to_char(sum(nps), qltn.lay_fm(ct.loaitien_id)) nps,
to_char(sum(tra), qltn.lay_fm(ct.loaitien_id)) tra
from (select ct.ma_kh, ct.ma_tb, ct.loaitien_id,
ct.donviql_id, chukyno, decode(kieuno, :"SYS_B_06", :"SYS_B_07", :"SYS_B_08") kieuno,
decode(kieuno,
:"SYS_B_09", :"SYS_B_10", sum(nogoc_dk)) nogoc_dk,
decode(kieuno, :"SYS_B_11", :"SYS_B_12", sum(nogoc_ps)) nogoc_ps,
decode(kieuno, :"SYS_B_13", :"SYS_B_14", sum(thue_dk)) thue_dk,
decode(kieuno, :"SYS_B_15", :"SYS_B_16", sum(thue_ps)) thue_ps,
decode(kieuno, :"SYS_B_17", sum(nogoc_ps+nogoc_dk), :"SYS_B_18") nogoc_km,
decode(kieuno, :"SYS_B_19", sum(thue_ps+thue_dk), :"SYS_B_20") thue_km,
/*sum(nps) nps, sum(ndk) ndk, sum(tra) tra*/
QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, null, :"SYS_B_21", :"SYS_B_22", :"SYS_B_23") ndk,
QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, null, :"SYS_B_24", :"SYS_B_25", :"SYS_B_26") nps,
QLTN_TRACUU.laytt_tra(ma_kh, ma_tb, chukyno, null, kieuno, :"SYS_B_27", :"SYS_B_28") tra
from (SELECT ma_kh, ma_tb, loaitien_id, khoanmuctt_id, vbcc_id, donviql_id,
chukyno,
decode(kieuno, :"SYS_B_29", SUM (nogoc), :"SYS_B_30") nogoc_dk,
decode(kieuno, :"SYS_B_31", :"SYS_B_32", SUM (nogoc)) nogoc_ps,
decode(kieuno, :"SYS_B_33", SUM (hoahong), :"SYS_B_34") hoahong_dk,
decode(kieuno, :"SYS_B_35", :"SYS_B_36", SUM (hoahong)) hoahong_ps,
decode(ki
euno, :"SYS_B_37", SUM (thue), :"SYS_B_38") thue_dk,
decode(kieuno, :"SYS_B_39", :"SYS_B_40", SUM (thue)) thue_ps,
kieuno, :"SYS_B_41" ndk, :"SYS_B_42" nps, :"SYS_B_43" tra
/*QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, khoanmuctt_id, 0, 'CCS_HCM.', 'muitau_hcm') ndk,
QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, khoanmuctt_id, 5, 'CCS_HCM.', 'muitau_hcm') nps,
QLTN_TRACUU.laytt_tra(ma_kh, ma_tb, chukyno, khoanmuctt_id, kieuno, 'CCS_HCM.', 'muitau_hcm') tra*/
from CCS_HCM.ct_no_052009
where :"SYS_B_44"=:"SYS_B_45" and ma_kh in (:"SYS_B_46")
group by ma_kh,
ma_tb,
loaitien_id,
khoanmuctt_id,
vbcc_id,
donviql_id,
chukyno,
kieuno) ct group by ma_kh, ma_tb, loaitien_id, donviql_id, chukyno, kieuno) ct where :"SYS_B_47"=:"SYS_B_48" and ma_kh in (:"SYS_B_49") and loaitien_id in (:"SYS_B_50") and ma_tb in (:"SYS_B_51") group by ma_kh, ma_tb, loaitien_id, donviql_id, chukyno, kieuno ) no, (select * from CCS_HCM.khachhangs_052009 where :"SYS_B_52"=:"SYS_B_53" and ma_kh in (:"SYS_B_54") ) kh,
(select a.somay, b.ten from CCS_HCM.danhba_dds_pttb a,
ccs_common.trangthai_tbs b
where a.trangthai_id=b.trangthai_id and ma_kh in (:"SYS_B_55") ) tb
where no.ma_kh=kh.ma_kh
and no.ma_tb=tb.somay(+) order by no.ma_kh, no.ma_tb, no.ckn desc |
| 29mmxd5twknr4 | select ma_bc from CCS_HNI.user_buucuc where userid=:"SYS_B_0" |
| 2bsmcpuj8wstb | select output from table(dbms_workload_repository.ash_report_html(:1, :2, :3, :4, :"SYS_B_0")) |
| 2jgzkt98xkw4z | begin :1 := CCS_ADMIN.qltn_tracuu.laytt_nochitiet('052009', 'HCMDD00044197', '84918732055', '1', '', '', '1', 'CCS_HCM.', 'thaontt_hcm'); end; |
| 2mnsvwjq7cmj7 | begin :1:= CCS_ADMIN.qltn_tracuu.laytt_notonghop('052009', 'HNIDD00124027', '', '1', '1', 'CCS_HNI.', 'cq1_hni'); end; |
| 2ym6hhaq30r73 | select type#, blocks, extents, minexts, maxexts, extsize, extpct, user#, iniexts, NVL(lists, 65535), NVL(groups, 65535), cachehint, hwmincr, NVL(spare1, 0), NVL(scanhint, 0) from seg$ where ts#=:1 and file#=:2 and block#=:3 |
| 360knjd7abxy7 | SELECT Huy.Ma_tn || :"SYS_B_0" || Huy.Sophieu Sobl, Huy.Ma_kh, Kh.Ten_tt, huy.soseri, huy.seri,
Huy.Nguoihuy, Huy.Huytumay, to_char(Huy.Ngayhuy, :"SYS_B_1") ngayhuy, to_char(Huy.Sotienhuy, :"SYS_B_2") sotienhuy
FROM CCS_HCM.Bienlaihuys Huy, CCS_HCM.Khachhangs_052009 Kh
WHERE Huy.Ma_kh = Kh.Ma_kh AND huy.ma_tn=:"SYS_B_3" AND huy.ngayhuy >= to_date(:"SYS_B_4", :"SYS_B_5") AND huy.ngayhuy <= to_date(:"SYS_B_6", :"SYS_B_7") |
| 3c1kubcdjnppq | update sys.col_usage$ set equality_preds = equality_preds + decode(bitand(:flag, 1), 0, 0, 1), equijoin_preds = equijoin_preds + decode(bitand(:flag, 2), 0, 0, 1), nonequijoin_preds = nonequijoin_preds + decode(bitand(:flag, 4), 0, 0, 1), range_preds = range_preds + decode(bitand(:flag, 8), 0, 0, 1), like_preds = like_preds + decode(bitand(:flag, 16), 0, 0, 1), null_preds = null_preds + decode(bitand(:flag, 32), 0, 0, 1), timestamp = :time where obj# = :objn and intcol# = :coln |
| 3d4n2f4w6ntu8 | update sequences set max_id=:"SYS_B_0" where tenseq=:"SYS_B_1" |
| 3tdhywvcgdzvx | select * from (SELECT nvl(display_main, :"SYS_B_0") display_main from user_info a where userid=:"SYS_B_1") where rownum < :"SYS_B_2" |
| 412vq3dym6phr | SELECT * FROM "CCS_CMU"."NHANVIEN_TCS" |
| 425ps4s3h8y5p | select upper(al.name) name, cf.ATTRIBUTE_VALUE from sys_attribute_config cf , sys_attribute_list al where al.attribute_id=cf.attribute_id and cf.group_attribute_code=:"SYS_B_0" and al.name in (:"SYS_B_1", :"SYS_B_2", :"SYS_B_3") |
| 4dghvj1hj3whg | SELECT max_id FROM sequences where tenseq =:"SYS_B_0" |
| 4dtzac5hyf7a5 |
select DISTINCT no.*, kh.ma_cq, replace(kh.ten_tt, :"SYS_B_00", :"SYS_B_01") ten_tt,
replace(kh.diachi_tt, :"SYS_B_02", :"SYS_B_03") diachi_tt, kh.ms_thue,
tb.ten trangthai
from (select to_char(sum(nogoc_dk+thue_dk), qltn.lay_fm(ct.loaitien_id)) no_dk,
to_char(sum(nogoc_ps+thue_ps), qltn.lay_fm(ct.loaitien_id)) no_ps,
to_char(sum(nogoc_km+thue_km), qltn.lay_fm(ct.loaitien_id)) no_km,
to_char(sum(nogoc_dk+thue_dk+nogoc_ps+thue_ps-nogoc_km-thue_km),
qltn.lay_fm(ct.loaitien_id)) tongno,
ct.ma_kh, ct.ma_tb, ct.loaitien_id, ct.donviql_id,
trim(QLTN.chukyno_dangchu(chukyno, :"SYS_B_04", :"SYS_B_05")) chukyno,
kieuno, chukyno ckn,
sum(nogoc_dk) nogoc_dk, sum(nogoc_ps) nogoc_ps,
sum(thue_dk) thue_dk, sum(thue_ps) thue_ps,
sum(nogoc_km) nogoc_km, sum(thue_km) thue_km,
to_char(sum(ndk), qltn.lay_fm(ct.loaitien_id)) ndk,
to_char(sum(nps), qltn.lay_fm(ct.loaitien_id)) nps,
to_char(sum(tra), qltn.lay_fm(ct.loaitien_id)) tra
from (select ct.ma_kh, ct.ma_tb, ct.loaitien_id,
ct.donviql_id, chukyno, decode(kieuno, :"SYS_B_06", :"SYS_B_07", :"SYS_B_08") kieuno,
decode(kieuno,
:"SYS_B_09", :"SYS_B_10", sum(nogoc_dk)) nogoc_dk,
decode(kieuno, :"SYS_B_11", :"SYS_B_12", sum(nogoc_ps)) nogoc_ps,
decode(kieuno, :"SYS_B_13", :"SYS_B_14", sum(thue_dk)) thue_dk,
decode(kieuno, :"SYS_B_15", :"SYS_B_16", sum(thue_ps)) thue_ps,
decode(kieuno, :"SYS_B_17", sum(nogoc_ps+nogoc_dk), :"SYS_B_18") nogoc_km,
decode(kieuno, :"SYS_B_19", sum(thue_ps+thue_dk), :"SYS_B_20") thue_km,
/*sum(nps) nps, sum(ndk) ndk, sum(tra) tra*/
QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, null, :"SYS_B_21", :"SYS_B_22", :"SYS_B_23") ndk,
QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, null, :"SYS_B_24", :"SYS_B_25", :"SYS_B_26") nps,
QLTN_TRACUU.laytt_tra(ma_kh, ma_tb, chukyno, null, kieuno, :"SYS_B_27", :"SYS_B_28") tra
from (SELECT ma_kh, ma_tb, loaitien_id, khoanmuctt_id, vbcc_id, donviql_id,
chukyno,
decode(kieuno, :"SYS_B_29", SUM (nogoc), :"SYS_B_30") nogoc_dk,
decode(kieuno, :"SYS_B_31", :"SYS_B_32", SUM (nogoc)) nogoc_ps,
decode(kieuno, :"SYS_B_33", SUM (hoahong), :"SYS_B_34") hoahong_dk,
decode(kieuno, :"SYS_B_35", :"SYS_B_36", SUM (hoahong)) hoahong_ps,
decode(ki
euno, :"SYS_B_37", SUM (thue), :"SYS_B_38") thue_dk,
decode(kieuno, :"SYS_B_39", :"SYS_B_40", SUM (thue)) thue_ps,
kieuno, :"SYS_B_41" ndk, :"SYS_B_42" nps, :"SYS_B_43" tra
/*QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, khoanmuctt_id, 0, 'CCS_GLI.', 'plk.tuyen.qltn_gli') ndk,
QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, khoanmuctt_id, 5, 'CCS_GLI.', 'plk.tuyen.qltn_gli') nps,
QLTN_TRACUU.laytt_tra(ma_kh, ma_tb, chukyno, khoanmuctt_id, kieuno, 'CCS_GLI.', 'plk.tuyen.qltn_gli') tra*/
from CCS_GLI.ct_no_052009
where :"SYS_B_44"=:"SYS_B_45" and ma_kh in (:"SYS_B_46")
group by ma_kh,
ma_tb,
loaitien_id,
khoanmuctt_id,
vbcc_id,
donviql_id,
chukyno,
kieuno) ct group by ma_kh, ma_tb, loaitien_id, donviql_id, chukyno, kieuno) ct where :"SYS_B_47"=:"SYS_B_48" and ma_kh in (:"SYS_B_49") and loaitien_id in (:"SYS_B_50") group by ma_kh, ma_tb, loaitien_id, donviql_id, chukyno, kieuno ) no, (select * from CCS_GLI.khachhangs_052009 where :"SYS_B_51"=:"SYS_B_52" and ma_kh in (:"SYS_B_53") ) kh,
(select a.somay, b.ten from CCS_GLI.danhba_dds_pttb a,
ccs_common.trangthai_tbs b whe
re a.trangthai_id=b.trangthai_id and ma_kh in (:"SYS_B_54") ) tb
where no.ma_kh=kh.ma_kh
and no.ma_tb=tb.somay(+) order by no.ma_kh, no.ma_tb, no.ckn desc |
| 4mnbg2k91mbrh | SELECT Somay FROM CCS_HCM.Danhba_dds_042009 a, CCS_HCM.Bangphieutra_042009 b WHERE a.ma_kh = b.ma_kh and b.Gomhoadon = :"SYS_B_0" |
| 50s5xwwzrz7pp | select tenbuucuc, ma_bc from CCS_HCM.buucucthus where :"SYS_B_0"=:"SYS_B_1" and ma_bc in (select ma_bc from CCS_HCM.user_buucuc where userid=:"SYS_B_2") |
| 53btfq0dt9bs9 | insert into sys.col_usage$ values ( :objn, :coln, decode(bitand(:flag, 1), 0, 0, 1), decode(bitand(:flag, 2), 0, 0, 1), decode(bitand(:flag, 4), 0, 0, 1), decode(bitand(:flag, 8), 0, 0, 1), decode(bitand(:flag, 16), 0, 0, 1), decode(bitand(:flag, 32), 0, 0, 1), :time) |
| 586ynz5r1f1gw | select count(:"SYS_B_0") from CCS_HCM.danhba_dds_pttb a where a.somay=:"SYS_B_1" |
| 5bn82p826rubs |
select max(ten_tt) ten_tt,
max(diachi_tt) diachi_tt,
max(ms_thue) ms_thue,
max(ma_kh) ma_kh,
sum(nogoc_thuc) nogoc_thuc,
sum(thue_thuc) thue_thuc,
to_char(sum(tongno_thuc), :"SYS_B_00") tongno_thuc,
sum(nogoc_km) nogoc_km,
sum(thue_km) thue_km,
to_char(sum(tongno_km), :"SYS_B_01") tongno_km,
sum(nogoc) nogoc,
sum(thue) thue,
to_char(sum(tongno), :"SYS_B_02") tongno,
max(ma_tb) ma_tb,
to_char(sum(datra), :"SYS_B_03") datra,
to_char(sum(da_km), :"SYS_B_04") da_km,
:"SYS_B_05" da_ck,
to_char(sum(da_dc), :"SYS_B_06") da_dc,
to_char(sum(thu_kyquy), :"SYS_B_07") thu_kyquy,
to_char(sum(tinhthuho), :"SYS_B_08") tinhthuho,
to_char(sum(thu_cuocnong), :"SYS_B_09") thu_cuocnong,
to_char(sum(cuocnong), :"SYS_B_10") cuocnong,
:"SYS_B_11" tt_cuocnong,
to_char(sum(tra_cuocnong), :"SYS_B_12") tra_cuocnong,
max(thongbao) thongbao,
max(ma_nv) ma_nv,
max(ma_t) ma_t,
:"SYS_B_13" kh_hientai
from (select distinct qltn_tamthu.chuanhoa_string(kh.ten_tt) ten_tt,
qltn_tamthu.chuanhoa_string(kh.diachi_tt) diachi_tt,
kh.ms_thue, kh.ma_kh,
nvl(no.nogoc, :"SYS_B_14") nogoc_thuc,
nvl(no.thue, :"SYS_B_15") thue_thuc,
to_char(nvl(no.nogoc, :"SYS_B_16")+nvl(no.thue, :"SYS_B_17"), :"SYS_B_18") tongno_thuc,
nvl(km.nogoc, :"SYS_B_19") nogoc_km,
nvl(km.thue, :"SYS_B_20") thue_km,
to_char( nvl(km.nogoc, :"SYS_B_21")+nvl(km.thue, :"SYS_B_22"), :"SYS_B_23") tongno_km,
(nvl(no.nogoc, :"SYS_B_24")-nvl(km.nogoc, :"SYS_B_25")) nogoc,
(nvl(no.thue, :"SYS_B_26")-nvl(km.thue, :"SYS_B_27")) thue,
to_char( nvl(no.nogoc, :"SYS_B_28")-nvl(km.nogoc, :"SYS_B_29")+nvl(no.thue, :"SYS_B_30")-nvl(km.thue, :"SYS_B_31"), :"SYS_B_32") tongno,
nvl(no.ma_tb, kh.sodaidien) ma_tb,
to_char(nvl(da_tra.tra, :"SYS_B_33"), :"SYS_B_34") datra,
to_char(nvl(da_km.tra, :"SYS_B_35"), :"SYS_B_36") da_km,
:"SYS_B_37" da_ck,
to_char(nvl(da_dc.tra, :"SYS_B_38"), :"SYS_B_39") da_dc,
/*TO_CHAR(nvl(thu_kq.tien, 0)-nvl(chi_kq.tien, 0), 'fm999999999999999999') thu_kyquy, */ :"SYS_B_40" thu_kyquy,
to_char(nvl(tien_th.tien, :"SYS_B_41")-nvl(gach_th.tien, :"SYS_B_42"), :"SYS_B_43") tinhthuho,
TO_CHAR(nvl(thu_cn.tien, :"SYS
_B_44")-nvl(chi_cn.tien, :"SYS_B_45"), :"SYS_B_46") thu_cuocnong , :"SYS_B_47" cuocnong , :"SYS_B_48" tt_cuocnong, :"SYS_B_49" tra_cuocnong,
--bo qua viec query sang VNP67 de tranh viec nghen he thong
--Khong chinh xac - phai la doituong_id trong danh ba
decode(nvl(db.doituong_id, :"SYS_B_50"), :"SYS_B_51", :"SYS_B_52", :"SYS_B_53") --khach hang nuoc ngoai hoac khu che xuat
|| (case when nvl(no.nogoc, :"SYS_B_54")+ nvl(no.thue, :"SYS_B_55") <=:"SYS_B_56" then :"SYS_B_57" else :"SYS_B_58" end) --khach hang het no
|| (case when nvl(tien_th.tien, :"SYS_B_59")-nvl(gach_th.tien, :"SYS_B_60") >:"SYS_B_61" then :"SYS_B_62" else :"SYS_B_63" end) --khach hang co thu ho
|| (case when nvl(km.nogoc, :"SYS_B_64")+nvl(km.thue, :"SYS_B_65") >:"SYS_B_66" then :"SYS_B_67" else :"SYS_B_68" end) --khach hang co khuyen mai
||:"SYS_B_69" --co nhieu khach hang
thongbao,
kh.ma_nv, kh.ma_t/*,
decode(no.ma_tb, db.somay, 1, 0) kh_hientai*/
from
(select * from CCS_HNI.khachhangs_052009 where ma_kh in (:"SYS_B_70") ) kh
, (
SELECT ma_kh, SUM (nogoc) nogoc, SUM (thue) thue, max(ma_tb) ma_tb
from CCS_HNI.ct_no_052009
where kieuno<>:"SYS_B_71" and ma_kh in (:"SYS_B_72")
and loaitien_id in (:"SYS_B_73")
group by ma_kh
)
no
, (
SELECT ma_kh, SUM (nogoc) nogoc, SUM (thue) thue
from CCS_HNI.ct_no_052009
where kieuno=:"SYS_B_74" and ma_kh in (:"SYS_B_75")
and loaitien_id in (:"SYS_B_76")
group by ma_kh
) km
, (
SELECT ma_kh, sum(tragoc+trathue) tra
from CCS_HNI.ct_tra_052009
where ma_kh in (:"SYS_B_77")
and loaitien_id in (:"SYS_B_78")
group by ma_kh
) da_tra
, (
SELECT ctt.ma_kh, sum(ctt.tragoc+ctt.trathue) tra
from CCS_HNI.ct_tra_052009 ctt, CCS_HNI.bangphieutra_052009 pt
where ctt.phieu_id=pt.phieu_id
and ctt.ma_kh in (:"SYS_B_79")
and ctt.loaitien_id in (:"SYS_B_80") and pt.httt_id in (:"SYS_B_81")
group by ctt.ma_kh
) da_km
, (
SELECT ctt.ma_kh, sum(ctt.tragoc+ctt.trathue) tra
from CCS_HNI.ct_tra_052009 ctt, CCS_HNI.bangphieutra_052009 pt
where ctt.phieu_id=pt.phieu_id
and ctt.ma_kh in (:"SYS_B_82")
and ctt.loaitien_id in (:"SYS_B_83") and pt.httt_id in (:"SYS_B_84", :"SYS_B_85")
group by ctt.ma_kh
) da_dc
, /*(
S
ELECT ma_kh, sum(sotien) tien
from CCS_HNI.kyquys
where ma_kh in ('HNIDD00124027')
and loaitien_id in (1)
group by ma_kh
) thu_kq
, (
SELECT ma_kh, sum(sotien) tien
from CCS_HNI.chikyquys
where ma_kh in ('HNIDD00124027')
and loaitien_id in (1)
group by ma_kh
) chi_kq
, */ (
SELECT ma_kh, sum(tragoc+trathue) tien
from CCS_HNI.cn_052009
where ma_kh in (:"SYS_B_86")
and loaitien_id in (:"SYS_B_87")
and khoanmuctt_id=:"SYS_B_88"
group by ma_kh
) thu_cn
, (
SELECT ma_kh, sum(tragoc+trathue) tien
from CCS_HNI.chi_cn_052009
where ma_kh in (:"SYS_B_89")
and loaitien_id in (:"SYS_B_90")
group by ma_kh
) chi_cn
, (
SELECT ma_kh, sum(sotien) tien
from ccs_common.thuho_052009
where tinh_id=:"SYS_B_91" and ma_kh in (:"SYS_B_92")
and loaitien_id in (:"SYS_B_93")
group by ma_kh
) tien_th
, (
SELECT ma_kh, sum(ti
engach) tien
from ccs_common.thuho_052009
where tinh_id=:"SYS_B_94" and ma_kh in (:"SYS_B_95")
and loaitien_id in (:"SYS_B_96")
group by ma_kh
) gach_th , (select * from CCS_HNI.danhba_dds_052009) db where kh.ma_kh=no.ma_kh(+)
and kh.ma_kh=km.ma_kh(+)
and kh.ma_kh=da_tra.ma_kh(+)
and kh.ma_kh=da_km.ma_kh(+)
and kh.ma_kh=da_dc.ma_kh(+)
/*
and kh.ma_kh=thu_kq.ma_kh(+)
and kh.ma_kh=chi_kq.ma_kh(+)
*/
AND kh.ma_kh=thu_cn.ma_kh(+)
and kh.ma_kh=chi_cn.ma_kh(+)
and kh.ma_kh=tien_th.ma_kh(+)
and kh.ma_kh=gach_th.ma_kh(+)
and kh.ma_kh=db.ma_kh(+)) |
| 5ngzsfstg8tmy | select o.owner#, o.name, o.namespace, o.remoteowner, o.linkname, o.subname, o.dataobj#, o.flags from obj$ o where o.obj#=:1 |
| 5nuwdvjgqahfa |
select DISTINCT no.*, kh.ma_cq, replace(kh.ten_tt, :"SYS_B_00", :"SYS_B_01") ten_tt,
replace(kh.diachi_tt, :"SYS_B_02", :"SYS_B_03") diachi_tt, kh.ms_thue,
tb.ten trangthai
from (select to_char(sum(nogoc_dk+thue_dk), qltn.lay_fm(ct.loaitien_id)) no_dk,
to_char(sum(nogoc_ps+thue_ps), qltn.lay_fm(ct.loaitien_id)) no_ps,
to_char(sum(nogoc_km+thue_km), qltn.lay_fm(ct.loaitien_id)) no_km,
to_char(sum(nogoc_dk+thue_dk+nogoc_ps+thue_ps-nogoc_km-thue_km),
qltn.lay_fm(ct.loaitien_id)) tongno,
ct.ma_kh, ct.ma_tb, ct.loaitien_id, ct.donviql_id,
trim(QLTN.chukyno_dangchu(chukyno, :"SYS_B_04", :"SYS_B_05")) chukyno,
kieuno, chukyno ckn,
sum(nogoc_dk) nogoc_dk, sum(nogoc_ps) nogoc_ps,
sum(thue_dk) thue_dk, sum(thue_ps) thue_ps,
sum(nogoc_km) nogoc_km, sum(thue_km) thue_km,
to_char(sum(ndk), qltn.lay_fm(ct.loaitien_id)) ndk,
to_char(sum(nps), qltn.lay_fm(ct.loaitien_id)) nps,
to_char(sum(tra), qltn.lay_fm(ct.loaitien_id)) tra
from (select ct.ma_kh, ct.ma_tb, ct.loaitien_id,
ct.donviql_id, chukyno, decode(kieuno, :"SYS_B_06", :"SYS_B_07", :"SYS_B_08") kieuno,
decode(kieuno,
:"SYS_B_09", :"SYS_B_10", sum(nogoc_dk)) nogoc_dk,
decode(kieuno, :"SYS_B_11", :"SYS_B_12", sum(nogoc_ps)) nogoc_ps,
decode(kieuno, :"SYS_B_13", :"SYS_B_14", sum(thue_dk)) thue_dk,
decode(kieuno, :"SYS_B_15", :"SYS_B_16", sum(thue_ps)) thue_ps,
decode(kieuno, :"SYS_B_17", sum(nogoc_ps+nogoc_dk), :"SYS_B_18") nogoc_km,
decode(kieuno, :"SYS_B_19", sum(thue_ps+thue_dk), :"SYS_B_20") thue_km,
/*sum(nps) nps, sum(ndk) ndk, sum(tra) tra*/
QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, null, :"SYS_B_21", :"SYS_B_22", :"SYS_B_23") ndk,
QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, null, :"SYS_B_24", :"SYS_B_25", :"SYS_B_26") nps,
QLTN_TRACUU.laytt_tra(ma_kh, ma_tb, chukyno, null, kieuno, :"SYS_B_27", :"SYS_B_28") tra
from (SELECT ma_kh, ma_tb, loaitien_id, khoanmuctt_id, vbcc_id, donviql_id,
chukyno,
decode(kieuno, :"SYS_B_29", SUM (nogoc), :"SYS_B_30") nogoc_dk,
decode(kieuno, :"SYS_B_31", :"SYS_B_32", SUM (nogoc)) nogoc_ps,
decode(kieuno, :"SYS_B_33", SUM (hoahong), :"SYS_B_34") hoahong_dk,
decode(kieuno, :"SYS_B_35", :"SYS_B_36", SUM (hoahong)) hoahong_ps,
decode(ki
euno, :"SYS_B_37", SUM (thue), :"SYS_B_38") thue_dk,
decode(kieuno, :"SYS_B_39", :"SYS_B_40", SUM (thue)) thue_ps,
kieuno, :"SYS_B_41" ndk, :"SYS_B_42" nps, :"SYS_B_43" tra
/*QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, khoanmuctt_id, 0, 'CCS_HCM.', 'hoaltt_hcm') ndk,
QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, khoanmuctt_id, 5, 'CCS_HCM.', 'hoaltt_hcm') nps,
QLTN_TRACUU.laytt_tra(ma_kh, ma_tb, chukyno, khoanmuctt_id, kieuno, 'CCS_HCM.', 'hoaltt_hcm') tra*/
from CCS_HCM.ct_no_052009
where :"SYS_B_44"=:"SYS_B_45" and ma_kh in (:"SYS_B_46")
group by ma_kh,
ma_tb,
loaitien_id,
khoanmuctt_id,
vbcc_id,
donviql_id,
chukyno,
kieuno) ct group by ma_kh, ma_tb, loaitien_id, donviql_id, chukyno, kieuno) ct where :"SYS_B_47"=:"SYS_B_48" and ma_kh in (:"SYS_B_49") and loaitien_id in (:"SYS_B_50") and ma_tb in (:"SYS_B_51") group by ma_kh, ma_tb, loaitien_id, donviql_id, chukyno, kieuno ) no, (select * from CCS_HCM.khachhangs_052009 where :"SYS_B_52"=:"SYS_B_53" and ma_kh in (:"SYS_B_54") ) kh,
(select a.somay, b.ten from CCS_HCM.danhba_dds_pttb a,
ccs_common.trangthai_tbs b
where a.trangthai_id=b.trangthai_id and ma_kh in (:"SYS_B_55") ) tb
where no.ma_kh=kh.ma_kh
and no.ma_tb=tb.somay(+) order by no.ma_kh, no.ma_tb, no.ckn desc |
| 63qw3y5g1cr2t | select count(*) from CCS_HCM.khachhangs_052009 where ma_cq||:"SYS_B_0" in (:"SYS_B_1") |
| 6ads2u7h8tatq |
select DISTINCT no.*, kh.ma_cq, replace(kh.ten_tt, :"SYS_B_00", :"SYS_B_01") ten_tt,
replace(kh.diachi_tt, :"SYS_B_02", :"SYS_B_03") diachi_tt, kh.ms_thue,
tb.ten trangthai
from (select to_char(sum(nogoc_dk+thue_dk), qltn.lay_fm(ct.loaitien_id)) no_dk,
to_char(sum(nogoc_ps+thue_ps), qltn.lay_fm(ct.loaitien_id)) no_ps,
to_char(sum(nogoc_km+thue_km), qltn.lay_fm(ct.loaitien_id)) no_km,
to_char(sum(nogoc_dk+thue_dk+nogoc_ps+thue_ps-nogoc_km-thue_km),
qltn.lay_fm(ct.loaitien_id)) tongno,
ct.ma_kh, ct.ma_tb, ct.loaitien_id, ct.donviql_id,
trim(QLTN.chukyno_dangchu(chukyno, :"SYS_B_04", :"SYS_B_05")) chukyno,
kieuno, chukyno ckn,
sum(nogoc_dk) nogoc_dk, sum(nogoc_ps) nogoc_ps,
sum(thue_dk) thue_dk, sum(thue_ps) thue_ps,
sum(nogoc_km) nogoc_km, sum(thue_km) thue_km,
to_char(sum(ndk), qltn.lay_fm(ct.loaitien_id)) ndk,
to_char(sum(nps), qltn.lay_fm(ct.loaitien_id)) nps,
to_char(sum(tra), qltn.lay_fm(ct.loaitien_id)) tra
from (select ct.ma_kh, ct.ma_tb, ct.loaitien_id,
ct.donviql_id, chukyno, decode(kieuno, :"SYS_B_06", :"SYS_B_07", :"SYS_B_08") kieuno,
decode(kieuno,
:"SYS_B_09", :"SYS_B_10", sum(nogoc_dk)) nogoc_dk,
decode(kieuno, :"SYS_B_11", :"SYS_B_12", sum(nogoc_ps)) nogoc_ps,
decode(kieuno, :"SYS_B_13", :"SYS_B_14", sum(thue_dk)) thue_dk,
decode(kieuno, :"SYS_B_15", :"SYS_B_16", sum(thue_ps)) thue_ps,
decode(kieuno, :"SYS_B_17", sum(nogoc_ps+nogoc_dk), :"SYS_B_18") nogoc_km,
decode(kieuno, :"SYS_B_19", sum(thue_ps+thue_dk), :"SYS_B_20") thue_km,
/*sum(nps) nps, sum(ndk) ndk, sum(tra) tra*/
QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, null, :"SYS_B_21", :"SYS_B_22", :"SYS_B_23") ndk,
QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, null, :"SYS_B_24", :"SYS_B_25", :"SYS_B_26") nps,
QLTN_TRACUU.laytt_tra(ma_kh, ma_tb, chukyno, null, kieuno, :"SYS_B_27", :"SYS_B_28") tra
from (SELECT ma_kh, ma_tb, loaitien_id, khoanmuctt_id, vbcc_id, donviql_id,
chukyno,
decode(kieuno, :"SYS_B_29", SUM (nogoc), :"SYS_B_30") nogoc_dk,
decode(kieuno, :"SYS_B_31", :"SYS_B_32", SUM (nogoc)) nogoc_ps,
decode(kieuno, :"SYS_B_33", SUM (hoahong), :"SYS_B_34") hoahong_dk,
decode(kieuno, :"SYS_B_35", :"SYS_B_36", SUM (hoahong)) hoahong_ps,
decode(ki
euno, :"SYS_B_37", SUM (thue), :"SYS_B_38") thue_dk,
decode(kieuno, :"SYS_B_39", :"SYS_B_40", SUM (thue)) thue_ps,
kieuno, :"SYS_B_41" ndk, :"SYS_B_42" nps, :"SYS_B_43" tra
/*QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, khoanmuctt_id, 0, 'CCS_HCM.', 'hanhntq_hcm') ndk,
QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, khoanmuctt_id, 5, 'CCS_HCM.', 'hanhntq_hcm') nps,
QLTN_TRACUU.laytt_tra(ma_kh, ma_tb, chukyno, khoanmuctt_id, kieuno, 'CCS_HCM.', 'hanhntq_hcm') tra*/
from CCS_HCM.ct_no_052009
where :"SYS_B_44"=:"SYS_B_45" and ma_kh in (:"SYS_B_46")
group by ma_kh,
ma_tb,
loaitien_id,
khoanmuctt_id,
vbcc_id,
donviql_id,
chukyno,
kieuno) ct group by ma_kh, ma_tb, loaitien_id, donviql_id, chukyno, kieuno) ct where :"SYS_B_47"=:"SYS_B_48" and ma_kh in (:"SYS_B_49") and loaitien_id in (:"SYS_B_50") and ma_tb in (:"SYS_B_51") group by ma_kh, ma_tb, loaitien_id, donviql_id, chukyno, kieuno ) no, (select * from CCS_HCM.khachhangs_052009 where :"SYS_B_52"=:"SYS_B_53" and ma_kh in (:"SYS_B_54") ) kh,
(select a.somay, b.ten from CCS_HCM.danhba_dds_pttb a,
ccs_common.trangthai_tb
s b where a.trangthai_id=b.trangthai_id and ma_kh in (:"SYS_B_55") ) tb
where no.ma_kh=kh.ma_kh
and no.ma_tb=tb.somay(+) order by no.ma_kh, no.ma_tb, no.ckn desc |
| 6f9yhh5yct2gy |
select distinct qltn_tamthu.chuanhoa_string(kh.ten_tt) ten_tt,
qltn_tamthu.chuanhoa_string(kh.diachi_tt) diachi_tt,
kh.ms_thue, kh.ma_kh,
nvl(no.nogoc, :"SYS_B_000") nogoc_thuc,
nvl(no.thue, :"SYS_B_001") thue_thuc,
to_char(nvl(no.nogoc, :"SYS_B_002")+nvl(no.thue, :"SYS_B_003"), :"SYS_B_004") tongno_thuc,
nvl(km.nogoc, :"SYS_B_005") nogoc_km,
nvl(km.thue, :"SYS_B_006") thue_km,
to_char( nvl(km.nogoc, :"SYS_B_007")+nvl(km.thue, :"SYS_B_008"), :"SYS_B_009") tongno_km,
(nvl(no.nogoc, :"SYS_B_010")-nvl(km.nogoc, :"SYS_B_011")) nogoc,
(nvl(no.thue, :"SYS_B_012")-nvl(km.thue, :"SYS_B_013")) thue,
to_char( nvl(no.nogoc, :"SYS_B_014")-nvl(km.nogoc, :"SYS_B_015")+nvl(no.thue, :"SYS_B_016")-nvl(km.thue, :"SYS_B_017"), :"SYS_B_018") tongno,
nvl(no.ma_tb, kh.sodaidien) ma_tb,
to_char(nvl(da_tra.tra, :"SYS_B_019"), :"SYS_B_020") datra,
to_char(nvl(da_km.tra, :"SYS_B_021"), :"SYS_B_022") da_km,
:"SYS_B_023" da_ck,
to_char(nvl(da_dc.tra, :"SYS_B_024"), :"SYS_B_025") da_dc,
TO_CHAR(nvl(thu_kq.tien, :"SYS_B_026")-nvl(chi_kq.tien, :"SYS_B_027"), :"SYS_B_028") thu_kyquy,
to_char(nvl(tien_th.tien, :"SYS_B_029")-nvl(gach_th.tien, :"SYS_B_030"), :"SYS_B_031") tinhthuho,
TO_CHAR(nvl(thu_cn.tien, :"SYS_B_032")-nvl(chi_cn.tien, :"SYS_B_033"), :"S
YS_B_034") thu_cuocnong , to_char(nvl(thdd_cn.tien, :"SYS_B_035"), :"SYS_B_036") cuocnong,
:"SYS_B_037" tt_cuocnong , to_char(qltn_tamthu.laytt_tientamthu2(
nvl(thdd_cn.tien, :"SYS_B_038"),
nvl(thdd_cn.qtrm, :"SYS_B_039"),
:"SYS_B_040"), :"SYS_B_041") tra_cuocnong,
--bo qua viec query sang VNP67 de tranh viec nghen he thong
--Khong chinh xac - phai la doituong_id trong danh ba
decode(nvl(db.doituong_id, :"SYS_B_042"), :"SYS_B_043", :"SYS_B_044", :"SYS_B_045") --khach hang nuoc ngoai hoac khu che xuat
|| (case when nvl(no.nogoc, :"SYS_B_046")+ nvl(no.thue, :"SYS_B_047") <=:"SYS_B_048" then :"SYS_B_049" else :"SYS_B_050" end) --khach hang het no
|| (case when nvl(tien_th.tien, :"SYS_B_051")-nvl(gach_th.tien, :"SYS_B_052") >:"SYS_B_053" then :"SYS_B_054" else :"SYS_B_055" end) --khach hang co thu ho
|| (case when nvl(km.nogoc, :"SYS_B_056")+nvl(km.thue, :"SYS_B_057") >:"SYS_B_058" then :"SYS_B_059" else :"SYS_B_060" end) --khach hang co khuyen mai
||:"SYS_B_061" --co nhieu khach hang
thongbao,
kh.ma_nv, kh.ma_t/*,
decode(no.ma_tb, db.somay, 1, 0) kh_hientai*/
from
(select * from CCS_HCM.khachhangs_pttb where ma_kh in (:"SYS_B_062", :"SYS_B_063") ) kh
, (
SELECT
ma_kh, SUM (nogoc) nogoc, SUM (thue) thue, max(ma_tb) ma_tb
from CCS_HCM.ct_no_052009
where kieuno<>:"SYS_B_064" and ma_kh in (:"SYS_B_065", :"SYS_B_066") and ma_tb in (:"SYS_B_067")
and loaitien_id in (:"SYS_B_068")
group by ma_kh
) no
, (
SELECT ma_kh, SUM (nogoc) nogoc, SUM (thue) thue
from CCS_HCM.ct_no_052009
where kieuno=:"SYS_B_069" and ma_kh in (:"SYS_B_070", :"SYS_B_071") and ma_tb in (:"SYS_B_072")
and loaitien_id in (:"SYS_B_073")
group by ma_kh
) km
, (
SELECT ma_kh, sum(tragoc+trathue) tra
from CCS_HCM.ct_tra_052009
where ma_kh in (:"SYS_B_074", :"SYS_B_075") and ma_tb in (:"SYS_B_076")
and loaitien_id in (:"SYS_B_077")
group by ma_kh
) da_tra
, (
SELECT ctt.ma_kh, sum(ctt.tragoc+ctt.trathue) tra
from CCS_HCM.ct_tra_052009 ctt, CCS_HCM.bangphieutra_052009 pt
where ctt.phieu_id=pt.phieu_id
and ctt.ma_kh in (:"SYS_B_078", :"SYS_B_079") and ma_tb in (:"SYS_B_080")
and ctt.loaitien_id in (:"SYS_B_081") and pt.httt_id in (:"SYS_B_082")
group by ctt.ma_kh
) da_km
, (
SELECT ctt.ma_kh, sum(ctt.tragoc+ctt.trathue) tra
from CCS_HCM.ct_tra_052009 ctt, CCS_HCM.bangphieutra_052009 pt
where ctt.phieu_id=pt.phieu_id
and ctt.ma_kh in (:"SYS_B_083", :"SYS_B_084") and ma_tb in (:"SYS_B_085")
and ctt.loaitien_id in (:"SYS_B_086") and pt.httt_id in (:"SYS_B_087", :"SYS_B_088")
group by ctt.ma_kh
) da_dc
, (
SELECT ma_kh, sum(sotien) tien
from CCS_HCM.kyquys
where ma_kh in (:"SYS_B_089", :"SYS_B_090") and ma_tb in (:"SYS_B_091")
and loaitien_id in (:"SYS_B_092")
group by ma_kh
) thu_kq
, (
SELECT ma_kh, sum(sotien) tien
from CCS_HCM.chikyquys
where ma_kh in (:"SYS_B_093", :"SYS_B_094") and ma_tb in (:"SYS_B_095")
and loaitien_id in (:"SYS_B_096")
group by ma_kh
) chi_kq
, (
SELECT ma_kh, sum(tragoc+trathue) tien
from CCS_HCM.cn_052009
where ma_kh in (:"SYS_B_097", :"SYS_B_098") and ma_tb in (:"SYS_B_099")
and loaitien_id in (:"SYS_B_100")
and khoanmuctt_id=:"SYS_B_101"
group by ma_kh
) thu_cn
, (
SELECT ma_kh, sum(tragoc+trathue) tien
from CCS_HCM.chi_cn_052009
where ma_kh in (:"SYS_B_102", :"SYS_B_103") and ma_tb in (:"SYS_B_104")
and loaitien_id in (:"SYS_B_105")
group by ma_kh
) chi_cn
, (
SELECT ma_kh, sum(sotien) tien
from ccs_common.thuho_052009
where tinh_id=:"SYS_B_106" and ma_kh in (:"SYS_B_107", :"SYS_B_108") and ma_tb in (:"SYS_B_109")
and loaitien_id in (:"SYS_B_110")
group by ma_kh
) tien_th
, (
SELECT ma_kh, sum(tiengach) tien
from ccs_common.thuho_052009
where tinh_id=:"SYS_B_111" and ma_kh in (:"SYS_B_112", :"SYS_B_113") and ma_tb in (:"SYS_B_114")
and loaitien_id in (:"SYS_B_115")
group by ma_kh
) gach_th , (
SELECT ma_kh, round(sum(tien+vat)) tien,
count (distinct (decode(khoanmuctc_id, :"SYS_B_116", :"SYS_B_117", :"SYS_B_118", :"SYS_B_119", null))) qtrm
from CCS_HCM.thdd_200906@DBL_2_BILLING
where ma_kh in (:"SYS_B_120", :"SYS_B_121") and somay in (:"SYS_B_122")
and usd = (case when :"SYS_B_123"=:"SYS_B_124" then :"SYS_B_125" else :"
SYS_B_126" end)
group by ma_kh
) thdd_cn , (select * from CCS_HCM.danhba_dds_pttb where :"SYS_B_127"=:"SYS_B_128" and somay in (:"SYS_B_129") ) db where kh.ma_kh=no.ma_kh(+)
and kh.ma_kh=km.ma_kh(+)
and kh.ma_kh=da_tra.ma_kh(+)
and kh.ma_kh=da_km.ma_kh(+)
and kh.ma_kh=da_dc.ma_kh(+)
and kh.ma_kh=thu_kq.ma_kh(+)
and kh.ma_kh=chi_kq.ma_kh(+)
AND kh.ma_kh=thu_cn.ma_kh(+)
and kh.ma_kh=chi_cn.ma_kh(+)
and kh.ma_kh=tien_th.ma_kh(+)
and kh.ma_kh=gach_th.ma_kh(+)
and kh.ma_kh=db.ma_kh(+) and kh.ma_kh=thdd_cn.ma_kh(+) |
| 6hf8r6y6uh25g | SELECT a.loai, a.so_tb, MA_TINH, trang_thai FROM ccs_common.thue_bao a WHERE a.so_tb= :"SYS_B_0" and rownum<:"SYS_B_1" |
| 6mfqvwgkmqchx | SELECT SUM("A1"."NOGOC"+"A1"."THUE"), "A1"."MA_KH" FROM "CCS_CBG"."CT_NO_042009" "A1" GROUP BY "A1"."MA_KH" |
| 6qw0sxqv730xr | SELECT ROWNUM STT , TRIM(SUBSTR( :B3 , INSTR(:B3 , :B2 , 1, ROWNUM ) +1 , INSTR(:B3 , :B2 , 1, ROWNUM+1) - INSTR(:B3 , :B2 , 1, ROWNUM ) -1 )) TOKEN FROM (SELECT :B1 STR FROM DUAL) A , USER_OBJECTS B WHERE (1=1) AND ROWNUM< LENGTH(A.STR)-LENGTH(REPLACE(A.STR, :B2 ))+1 |
| 6tf2uz2c218jr |
select DISTINCT no.*, kh.ma_cq, replace(kh.ten_tt, :"SYS_B_00", :"SYS_B_01") ten_tt,
replace(kh.diachi_tt, :"SYS_B_02", :"SYS_B_03") diachi_tt, kh.ms_thue,
tb.ten trangthai
from (select to_char(nogoc_dk+thue_dk, qltn.lay_fm(ct.loaitien_id)) no_dk,
to_char(nogoc_ps+thue_ps, qltn.lay_fm(ct.loaitien_id)) no_ps,
to_char(nogoc_dk+thue_dk+nogoc_ps+thue_ps, qltn.lay_fm(ct.loaitien_id)) tongno,
ct.ma_kh, ct.ma_tb, ct.loaitien_id,
ct.khoanmuctt_id, ct.donviql_id,
trim(QLTN.chukyno_dangchu(chukyno, :"SYS_B_04", :"SYS_B_05")) chukyno,
kieuno, chukyno ckn,
nogoc_dk, nogoc_ps, thue_dk, thue_ps,
to_char(ndk, qltn.lay_fm(ct.loaitien_id)) ndk,
to_char(nps, qltn.lay_fm(ct.loaitien_id)) nps,
to_char(tra, qltn.lay_fm(ct.loaitien_id)) tra,
km.tenkhoanmuc from CCS_HCM.khoanmuc_tts km, (SELECT ma_kh, ma_tb, loaitien_id, khoanmuctt_id, vbcc_id, donviql_id,
chukyno,
decode(kieuno, :"SYS_B_06", SUM (nogoc), :"SYS_B_07") nogoc_dk,
decode(kieuno, :"SYS_B_08", :"SYS_B_09", SUM (nogoc)) nogoc_ps,
decode(kieuno, :"SYS_B_10", SUM (hoahong), :"SYS_B_11") hoahong_dk,
decode(kieun
o, :"SYS_B_12", :"SYS_B_13", SUM (hoahong)) hoahong_ps,
decode(kieuno, :"SYS_B_14", SUM (thue), :"SYS_B_15") thue_dk,
decode(kieuno, :"SYS_B_16", :"SYS_B_17", SUM (thue)) thue_ps,
kieuno, :"SYS_B_18" ndk, :"SYS_B_19" nps, :"SYS_B_20" tra
/*QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, khoanmuctt_id, 0, 'CCS_HCM.', 'thaontt_hcm') ndk,
QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, khoanmuctt_id, 5, 'CCS_HCM.', 'thaontt_hcm') nps,
QLTN_TRACUU.laytt_tra(ma_kh, ma_tb, chukyno, khoanmuctt_id, kieuno, 'CCS_HCM.', 'thaontt_hcm') tra*/
from CCS_HCM.ct_no_052009
where :"SYS_B_21"=:"SYS_B_22" and ma_kh in (:"SYS_B_23")
group by ma_kh,
ma_tb,
loaitien_id,
khoanmuctt_id,
vbcc_id,
donviql_id,
chukyno,
kieuno) ct where km.khoanmuctt_id=ct.khoanmuctt_id and ma_kh in (:"SYS_B_24") and loaitien_id in (:"SYS_B_25") and ma_tb in (:"SYS_B_26") ) no, (select * from CCS_HCM.khachhangs_052009 where :"SYS_B_27"=:"SYS_B_28" and ma_kh in (:"SYS_B_29") ) kh,
(select a.somay, b.ten from CCS_HCM.danhba_dds_pttb a,
ccs_common.trangthai_tbs b where a.trangthai_id=b.trang
thai_id and ma_kh in (:"SYS_B_30") ) tb
where no.ma_kh=kh.ma_kh
and no.ma_tb=tb.somay(+) order by no.ma_kh, no.ma_tb, no.ckn desc |
| 70sfpwdar4mk2 |
select DISTINCT no.*, kh.ma_cq, replace(kh.ten_tt, :"SYS_B_00", :"SYS_B_01") ten_tt,
replace(kh.diachi_tt, :"SYS_B_02", :"SYS_B_03") diachi_tt, kh.ms_thue,
tb.ten trangthai
from (select to_char(sum(nogoc_dk+thue_dk), qltn.lay_fm(ct.loaitien_id)) no_dk,
to_char(sum(nogoc_ps+thue_ps), qltn.lay_fm(ct.loaitien_id)) no_ps,
to_char(sum(nogoc_km+thue_km), qltn.lay_fm(ct.loaitien_id)) no_km,
to_char(sum(nogoc_dk+thue_dk+nogoc_ps+thue_ps-nogoc_km-thue_km),
qltn.lay_fm(ct.loaitien_id)) tongno,
ct.ma_kh, ct.ma_tb, ct.loaitien_id, ct.donviql_id,
trim(QLTN.chukyno_dangchu(chukyno, :"SYS_B_04", :"SYS_B_05")) chukyno,
kieuno, chukyno ckn,
sum(nogoc_dk) nogoc_dk, sum(nogoc_ps) nogoc_ps,
sum(thue_dk) thue_dk, sum(thue_ps) thue_ps,
sum(nogoc_km) nogoc_km, sum(thue_km) thue_km,
to_char(sum(ndk), qltn.lay_fm(ct.loaitien_id)) ndk,
to_char(sum(nps), qltn.lay_fm(ct.loaitien_id)) nps,
to_char(sum(tra), qltn.lay_fm(ct.loaitien_id)) tra
from (select ct.ma_kh, ct.ma_tb, ct.loaitien_id,
ct.donviql_id, chukyno, decode(kieuno, :"SYS_B_06", :"SYS_B_07", :"SYS_B_08") kieuno,
decode(kieuno,
:"SYS_B_09", :"SYS_B_10", sum(nogoc_dk)) nogoc_dk,
decode(kieuno, :"SYS_B_11", :"SYS_B_12", sum(nogoc_ps)) nogoc_ps,
decode(kieuno, :"SYS_B_13", :"SYS_B_14", sum(thue_dk)) thue_dk,
decode(kieuno, :"SYS_B_15", :"SYS_B_16", sum(thue_ps)) thue_ps,
decode(kieuno, :"SYS_B_17", sum(nogoc_ps+nogoc_dk), :"SYS_B_18") nogoc_km,
decode(kieuno, :"SYS_B_19", sum(thue_ps+thue_dk), :"SYS_B_20") thue_km,
/*sum(nps) nps, sum(ndk) ndk, sum(tra) tra*/
QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, null, :"SYS_B_21", :"SYS_B_22", :"SYS_B_23") ndk,
QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, null, :"SYS_B_24", :"SYS_B_25", :"SYS_B_26") nps,
QLTN_TRACUU.laytt_tra(ma_kh, ma_tb, chukyno, null, kieuno, :"SYS_B_27", :"SYS_B_28") tra
from (SELECT ma_kh, ma_tb, loaitien_id, khoanmuctt_id, vbcc_id, donviql_id,
chukyno,
decode(kieuno, :"SYS_B_29", SUM (nogoc), :"SYS_B_30") nogoc_dk,
decode(kieuno, :"SYS_B_31", :"SYS_B_32", SUM (nogoc)) nogoc_ps,
decode(kieuno, :"SYS_B_33", SUM (hoahong), :"SYS_B_34") hoahong_dk,
decode(kieuno, :"SYS_B_35", :"SYS_B_36", SUM (hoahong)) hoahong_ps,
decode(ki
euno, :"SYS_B_37", SUM (thue), :"SYS_B_38") thue_dk,
decode(kieuno, :"SYS_B_39", :"SYS_B_40", SUM (thue)) thue_ps,
kieuno, :"SYS_B_41" ndk, :"SYS_B_42" nps, :"SYS_B_43" tra
/*QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, khoanmuctt_id, 0, 'CCS_HCM.', 'lecb_hcm') ndk,
QLTN_TRACUU.laytt_dkps(ma_kh, ma_tb, chukyno, khoanmuctt_id, 5, 'CCS_HCM.', 'lecb_hcm') nps,
QLTN_TRACUU.laytt_tra(ma_kh, ma_tb, chukyno, khoanmuctt_id, kieuno, 'CCS_HCM.', 'lecb_hcm') tra*/
from CCS_HCM.ct_no_052009
where :"SYS_B_44"=:"SYS_B_45" and ma_kh in (:"SYS_B_46")
group by ma_kh,
ma_tb,
loaitien_id,
khoanmuctt_id,
vbcc_id,
donviql_id,
chukyno,
kieuno) ct group by ma_kh, ma_tb, loaitien_id, donviql_id, chukyno, kieuno) ct where :"SYS_B_47"=:"SYS_B_48" and ma_kh in (:"SYS_B_49") and loaitien_id in (:"SYS_B_50") and ma_tb in (:"SYS_B_51") group by ma_kh, ma_tb, loaitien_id, donviql_id, chukyno, kieuno ) no, (select * from CCS_HCM.khachhangs_052009 where :"SYS_B_52"=:"SYS_B_53" and ma_kh in (:"SYS_B_54") ) kh,
(select a.somay, b.ten from CCS_HCM.danhba_dds_pttb a,
ccs_common.trangthai_tbs b where
a.trangthai_id=b.trangthai_id and ma_kh in (:"SYS_B_55") ) tb
where no.ma_kh=kh.ma_kh
and no.ma_tb=tb.somay(+) order by no.ma_kh, no.ma_tb, no.ckn desc |
| 778j0bv2psvf0 | select tenquay, maquay from CCS_HCM.quaythus where :"SYS_B_0"=:"SYS_B_1" and instr((select quaythus from CCS_HCM.nguoigachnos where nguoigach=:"SYS_B_2"), :"SYS_B_3"||maquay||:"SYS_B_4")>:"SYS_B_5" order by tenquay |
| 77ugm22xa7r4c | SELECT a.id, a.ma_kh, a.ma_nv, a.ma_tuyen, a.chungtu_id, a.phieu_id, a.ketqua ketqua_id,
qltn.chukyno_dangchu(a.chukyno, :"SYS_B_0", :"SYS_B_1") chukyno,
to_char(a.ngayphat, :"SYS_B_2") ngayphat, to_char(a.ngay_cn, :"SYS_B_3") ngay_cn, a.ct_trave, a.somay, b.tenchungtu, c.ketqua,
a.nguoinhap, a.nguoinhan, a.lanphat, a.ykien, a.noidung, d.ten_tt, d.diachi_tt, e.ten_nv, f.ten_t
FROM CCS_HNI.kq_phatchungtus a, CCS_HNI.chungtuphats b, CCS_HNI.loai_kqphat c, CCS_HNI.khachhangs_052009 d, CCS_HNI.nhanvien_tcs e, CCS_HNI.tuyens f where a.chungtu_id=b.chungtu_id and to_number(a.ketqua)=c.kq_id and a.ma_kh=d.ma_kh and a.ma_nv=e.ma_nv and d.ma_nv=e.ma_nv and a.ma_nv=f.ma_nv and d.ma_t= f.ma_t and a.ma_tuyen=f.ma_t |
| 7sa9b2rn9tvyw |
select distinct qltn_tamthu.chuanhoa_string(kh.ten_tt) ten_tt,
qltn_tamthu.chuanhoa_string(kh.diachi_tt) diachi_tt,
kh.ms_thue, kh.ma_kh,
nvl(no.nogoc, :"SYS_B_000") nogoc_thuc,
nvl(no.thue, :"SYS_B_001") thue_thuc,
to_char(nvl(no.nogoc, :"SYS_B_002")+nvl(no.thue, :"SYS_B_003"), :"SYS_B_004") tongno_thuc,
nvl(km.nogoc, :"SYS_B_005") nogoc_km,
nvl(km.thue, :"SYS_B_006") thue_km,
to_char( nvl(km.nogoc, :"SYS_B_007")+nvl(km.thue, :"SYS_B_008"), :"SYS_B_009") tongno_km,
(nvl(no.nogoc, :"SYS_B_010")-nvl(km.nogoc, :"SYS_B_011")) nogoc,
(nvl(no.thue, :"SYS_B_012")-nvl(km.thue, :"SYS_B_013")) thue,
to_char( nvl(no.nogoc, :"SYS_B_014")-nvl(km.nogoc, :"SYS_B_015")+nvl(no.thue, :"SYS_B_016")-nvl(km.thue, :"SYS_B_017"), :"SYS_B_018") tongno,
nvl(no.ma_tb, kh.sodaidien) ma_tb,
to_char(nvl(da_tra.tra, :"SYS_B_019"), :"SYS_B_020") datra,
to_char(nvl(da_km.tra, :"SYS_B_021"), :"SYS_B_022") da_km,
:"SYS_B_023" da_ck,
to_char(nvl(da_dc.tra, :"SYS_B_024"), :"SYS_B_025") da_dc,
TO_CHAR(nvl(thu_kq.tien, :"SYS_B_026")-nvl(chi_kq.tien, :"SYS_B_027"), :"SYS_B_028") thu_kyquy,
to_char(nvl(tien_th.tien, :"SYS_B_029")-nvl(gach_th.tien, :"SYS_B_030"), :"SYS_B_031") tinhthuho,
TO_CHAR(nvl(thu_cn.tien, :"SYS_B_032")-nvl(chi_cn.tien, :"SYS_B_033"), :"S
YS_B_034") thu_cuocnong , :"SYS_B_035" cuocnong , :"SYS_B_036" tt_cuocnong, :"SYS_B_037" tra_cuocnong,
--bo qua viec query sang VNP67 de tranh viec nghen he thong
--Khong chinh xac - phai la doituong_id trong danh ba
decode(nvl(db.doituong_id, :"SYS_B_038"), :"SYS_B_039", :"SYS_B_040", :"SYS_B_041") --khach hang nuoc ngoai hoac khu che xuat
|| (case when nvl(no.nogoc, :"SYS_B_042")+ nvl(no.thue, :"SYS_B_043") <=:"SYS_B_044" then :"SYS_B_045" else :"SYS_B_046" end) --khach hang het no
|| (case when nvl(tien_th.tien, :"SYS_B_047")-nvl(gach_th.tien, :"SYS_B_048") >:"SYS_B_049" then :"SYS_B_050" else :"SYS_B_051" end) --khach hang co thu ho
|| (case when nvl(km.nogoc, :"SYS_B_052")+nvl(km.thue, :"SYS_B_053") >:"SYS_B_054" then :"SYS_B_055" else :"SYS_B_056" end) --khach hang co khuyen mai
||:"SYS_B_057" --co nhieu khach hang
thongbao,
kh.ma_nv, kh.ma_t/*,
decode(no.ma_tb, db.somay, 1, 0) kh_hientai*/
from
(select * from CCS_HCM.khachhangs_pttb where ma_kh in (:"SYS_B_058") ) kh
, (
SELECT ma_kh, SUM (nogoc) nogoc, SUM (thue) thue, max(ma_tb) ma_tb
from CCS_HCM.ct_no_052009
where kieuno<>:"SYS_B_059" and ma_kh in (:"SYS_B_060") and ma_tb in (:"SYS_B_061")
and loaitien_id in (:"SYS_B_062")
group by ma_kh
) no
, (
SELECT ma_kh, SUM (nogoc) nogoc, SUM (thue) thue
from CCS_HCM.ct_no_052009
where kieuno=:"SYS_B_063" and ma_kh in (:"SYS_B_064") and ma_tb in (:"SYS_B_065")
and loaitien_id in (:"SYS_B_066")
group by ma_kh
) km
, (
SELECT ma_kh, sum(tragoc+trathue) tra
from CCS_HCM.ct_tra_052009
where ma_kh in (:"SYS_B_067") and ma_tb in (:"SYS_B_068")
and loaitien_id in (:"SYS_B_069")
group by ma_kh
) da_tra
, (
SELECT ctt.ma_kh, sum(ctt.tragoc+ctt.trathue) tra
from CCS_HCM.ct_tra_052009 ctt, CCS_HCM.bangphieutra_052009 pt
where ctt.phieu_id=pt.phieu_id
and ctt.ma_kh in (:"SYS_B_070") and ma_tb in (:"SYS_B_071")
and ctt.loaitien_id in (:"SYS_B_072") and pt.httt_id in (:"SYS_B_073")
group by ctt.ma_kh
) da_km
, (
SELECT ctt.ma_kh, sum(ctt.tragoc+ctt.trathue) tra
from CCS_HCM.ct_tra_052009 ctt, CCS_HCM.bangphieutra_052009 pt
where ctt.phieu_id=pt.phieu_id
and ctt.ma_kh in (:"SYS_B_074") and ma_tb in (:"SYS_B_075")
and ctt.loaitien_id in (:"SYS_B_076") and pt.htt
t_id in (:"SYS_B_077", :"SYS_B_078")
group by ctt.ma_kh
) da_dc
, (
SELECT ma_kh, sum(sotien) tien
from CCS_HCM.kyquys
where ma_kh in (:"SYS_B_079") and ma_tb in (:"SYS_B_080")
and loaitien_id in (:"SYS_B_081")
group by ma_kh
) thu_kq
, (
SELECT ma_kh, sum(sotien) tien
from CCS_HCM.chikyquys
where ma_kh in (:"SYS_B_082") and ma_tb in (:"SYS_B_083")
and loaitien_id in (:"SYS_B_084")
group by ma_kh
) chi_kq
, (
SELECT ma_kh, sum(tragoc+trathue) tien
from CCS_HCM.cn_052009
where ma_kh in (:"SYS_B_085") and ma_tb in (:"SYS_B_086")
and loaitien_id in (:"SYS_B_087")
and khoanmuctt_id=:"SYS_B_088"
group by ma_kh
) thu_cn
, (
SELECT ma_kh, sum(tragoc+trathue) tien
from CCS_HCM.chi_cn_052009
where ma_kh in (:"SYS_B_089") and ma_tb in (:"SYS_B_090")
and loaitien_id in (:"SYS_B_091")
group by ma_kh
) chi_cn
, (
SELECT ma_kh, sum(sotien) tien
from
ccs_common.thuho_052009
where tinh_id=:"SYS_B_092" and ma_kh in (:"SYS_B_093") and ma_tb in (:"SYS_B_094")
and loaitien_id in (:"SYS_B_095")
group by ma_kh
) tien_th
, (
SELECT ma_kh, sum(tiengach) tien
from ccs_common.thuho_052009
where tinh_id=:"SYS_B_096" and ma_kh in (:"SYS_B_097") and ma_tb in (:"SYS_B_098")
and loaitien_id in (:"SYS_B_099")
group by ma_kh
) gach_th , (select * from CCS_HCM.danhba_dds_pttb where :"SYS_B_100"=:"SYS_B_101" and somay in (:"SYS_B_102") ) db where kh.ma_kh=no.ma_kh(+)
and kh.ma_kh=km.ma_kh(+)
and kh.ma_kh=da_tra.ma_kh(+)
and kh.ma_kh=da_km.ma_kh(+)
and kh.ma_kh=da_dc.ma_kh(+)
and kh.ma_kh=thu_kq.ma_kh(+)
and kh.ma_kh=chi_kq.ma_kh(+)
AND kh.ma_kh=thu_cn.ma_kh(+)
and kh.ma_kh=chi_cn.ma_kh(+)
and kh.ma_kh=tien_th.ma_kh(+)
and kh.ma_kh=gach_th.ma_kh(+)
and kh.ma_kh=db.ma_kh(+) |
| 84tnxurr3c254 | select * from (SELECT Phuong_ID dieukien, TenPhuong ten FROM CCS_COMMON.Phuongs where Quan_id = :"SYS_B_0" ORDER by TenPhuong) where rownum < :"SYS_B_1" |
| 86f7a9m4ubtwu |
select * from (SELECT ph.Ma_kh, ph.Ma_tb, Kh.Ten_tt, ph.so_ct phieu_Id, to_char(ph.ngaynhap, :"SYS_B_00") Ngaythu,
to_char(nvl((select sum(tragoc+trathue) from CCS_HCM.cn where khoanmuctt_id=:"SYS_B_01"
and ph.phieu_id=phieu_id and ph.ckn_chu=ckn_chu), :"SYS_B_02"), :"SYS_B_03") sotien
FROM CCS_HCM.Phieuthu ph,
(SELECT DISTINCT MA_KH, MAX(TEN_TT) TEN_TT FROM ( select ma_kh, ten_tt from CCS_HCM.Khachhangs_052009 union
select ma_kh, ten_tt from CCS_HCM.Khachhangs_052009
) GROUP BY MA_KH ) Kh,
(SELECT MAX (Somay) Ma_tb, Ma_kh
FROM CCS_HCM.Danhba_dds_052009
GROUP BY Ma_kh
union
SELECT MAX (Somay) Ma_tb, Ma_kh
FROM CCS_HCM.Danhba_dds_052009
GROUP BY Ma_kh
) Db,
(SELECT SUM (Sotien) Tienchi, Phieu_thu
FROM CCS_HCM.Phieuchi
GROUP BY Phieu_thu) Chi
WHERE :"SYS_B_04"=:"SYS_B_05" AND ph.ma_bc = :"SYS_B_06" AND ph.ma_tn=:"SYS_B_07" AND ph.ngaynhap >= to_date(:"SYS_B_08", :"SYS_B_09") AND ph.ngaynhap <= to_date(:"SYS_B_10", :"SYS_B_11") and ph.Phieu_id = Chi.Phieu_thu(+) AND ph.Ma_kh = Kh.Ma_kh AND ph.Ma_kh = Db.Ma_kh(+) AND ph.ckn_chu=:"SYS_B_12" and ph.httt_id!=:"SYS_B_13") ph where replace(ph.sotien, :"SYS_B_14", :"S
YS_B_15")!=:"SYS_B_16" order by ph.phieu_id |
| 89nfd4778yx5c |
select max(ten_tt) ten_tt,
max(diachi_tt) diachi_tt,
max(ms_thue) ms_thue,
max(ma_kh) ma_kh,
sum(nogoc_thuc) nogoc_thuc,
sum(thue_thuc) thue_thuc,
to_char(sum(tongno_thuc), :"SYS_B_000") tongno_thuc,
sum(nogoc_km) nogoc_km,
sum(thue_km) thue_km,
to_char(sum(tongno_km), :"SYS_B_001") tongno_km,
sum(nogoc) nogoc,
sum(thue) thue,
to_char(sum(tongno), :"SYS_B_002") tongno,
max(ma_tb) ma_tb,
to_char(sum(datra), :"SYS_B_003") datra,
to_char(sum(da_km), :"SYS_B_004") da_km,
:"SYS_B_005" da_ck,
to_char(sum(da_dc), :"SYS_B_006") da_dc,
to_char(sum(thu_kyquy), :"SYS_B_007") thu_kyquy,
to_char(sum(tinhthuho), :"SYS_B_008") tinhthuho,
to_char(sum(thu_cuocnong), :"SYS_B_009") thu_cuocnong,
to_char(sum(cuocnong), :"SYS_B_010") cuocnong,
:"SYS_B_011" tt_cuocnong,
to_char(sum(tra_cuocnong), :"SYS_B_012") tra_cuocnong,
max(thongbao) thongbao,
max(ma_nv) ma_nv,
max(ma_t) ma_t,
:"SYS_B_013" kh_hientai
from (select distinct qltn_tamthu.chuanhoa_string(kh.ten_tt) ten_tt,
qltn_tamthu.chuanhoa_string(kh.diachi_tt) diachi_tt,
kh.ms_thue, kh.ma_kh,
nvl(no.nogoc, :"SYS_B_014") nogoc_thuc,
nvl(no.thue, :"SYS_B_015") thue_thuc,
to_char(nvl(no.nogoc, :"SYS_B_016")+nvl(no.thue, :"SYS_B_017"), :"SYS_B_018") tongno_thuc,
nvl(km.nogoc, :"SYS_B_019") nogoc_km,
nvl(km.thue, :"SYS_B_020") thue_km,
to_char( nvl(km.nogoc, :"SYS_B_021")+nvl(km.thue, :"SYS_B_022"), :"SYS_B_023") tongno_km,
(nvl(no.nogoc, :"SYS_B_024")-nvl(km.nogoc, :"SYS_B_025")) nogoc,
(nvl(no.thue, :"SYS_B_026")-nvl(km.thue, :"SYS_B_027")) thue,
to_char( nvl(no.nogoc, :"SYS_B_028")-nvl(km.nogoc, :"SYS_B_029")+nvl(no.thue, :"SYS_B_030")-nvl(km.thue, :"SYS_B_031"), :"SYS_B_032") tongno,
nvl(no.ma_tb, kh.sodaidien) ma_tb,
to_char(nvl(da_tra.tra, :"SYS_B_033"), :"SYS_B_034") datra,
to_char(nvl(da_km.tra, :"SYS_B_035"), :"SYS_B_036") da_km,
:"SYS_B_037" da_ck,
to_char(nvl(da_dc.tra, :"SYS_B_038"), :"SYS_B_039") da_dc,
/*TO_CHAR(nvl(thu_kq.tien, 0)-nvl(chi_kq.tien, 0), 'fm999999999999999999') thu_kyquy, */ :"SYS_B_040" thu_kyquy,
to_char(nvl(tien_th.tien, :"SYS_B_041")-nvl(gach_th.tien, :"SYS_B_042"), :"SYS_B_043") tinhth
uho,
TO_CHAR(nvl(thu_cn.tien, :"SYS_B_044")-nvl(chi_cn.tien, :"SYS_B_045"), :"SYS_B_046") thu_cuocnong , :"SYS_B_047" cuocnong , :"SYS_B_048" tt_cuocnong, :"SYS_B_049" tra_cuocnong,
--bo qua viec query sang VNP67 de tranh viec nghen he thong
--Khong chinh xac - phai la doituong_id trong danh ba
decode(nvl(db.doituong_id, :"SYS_B_050"), :"SYS_B_051", :"SYS_B_052", :"SYS_B_053") --khach hang nuoc ngoai hoac khu che xuat
|| (case when nvl(no.nogoc, :"SYS_B_054")+ nvl(no.thue, :"SYS_B_055") <=:"SYS_B_056" then :"SYS_B_057" else :"SYS_B_058" end) --khach hang het no
|| (case when nvl(tien_th.tien, :"SYS_B_059")-nvl(gach_th.tien, :"SYS_B_060") >:"SYS_B_061" then :"SYS_B_062" else :"SYS_B_063" end) --khach hang co thu ho
|| (case when nvl(km.nogoc, :"SYS_B_064")+nvl(km.thue, :"SYS_B_065") >:"SYS_B_066" then :"SYS_B_067" else :"SYS_B_068" end) --khach hang co khuyen mai
||:"SYS_B_069" --co nhieu khach hang
thongbao,
kh.ma_nv, kh.ma_t/*,
decode(no.ma_tb, db.somay, 1, 0) kh_hientai*/
from
(select * from CCS_HNI.khachhangs_052009 where ma_kh in (:"SYS_B_070") ) kh
, (
SELECT ma_kh, SUM (nogoc) nogoc, SUM (thue) thue, max(ma_tb) ma_tb
from CCS_HNI.ct_no_052009
where kieuno<>:"SYS_B_071" and ma_kh in (:"SYS_B_072") and ma_tb in (:"SYS_B_073")
and loaitien_id in (:"SYS_B_074")
group by ma_kh
) no
, (
SELECT ma_kh, SUM (nogoc) nogoc, SUM (thue) thue
from CCS_HNI.ct_no_052009
where kieuno=:"SYS_B_075" and ma_kh in (:"SYS_B_076") and ma_tb in (:"SYS_B_077")
and loaitien_id in (:"SYS_B_078")
group by ma_kh
) km
, (
SELECT ma_kh, sum(tragoc+trathue) tra
from CCS_HNI.ct_tra_052009
where ma_kh in (:"SYS_B_079") and ma_tb in (:"SYS_B_080")
and loaitien_id in (:"SYS_B_081")
group by ma_kh
) da_tra
, (
SELECT ctt.ma_kh, sum(ctt.tragoc+ctt.trathue) tra
from CCS_HNI.ct_tra_052009 ctt, CCS_HNI.bangphieutra_052009 pt
where ctt.phieu_id=pt.phieu_id
and ctt.ma_kh in (:"SYS_B_082") and ma_tb in (:"SYS_B_083")
and ctt.loaitien_id in (:"SYS_B_084") and pt.httt_id in (:"SYS_B_085")
group by ctt.ma_kh
) da_km
, (
SELECT ctt.ma_kh, sum(ctt.tragoc+ctt.trathue) tra
from CCS_HNI.ct_tra_052009 ctt, CCS_HNI.bangphieutra_052009 pt
where ctt.phieu_id=pt.phieu_id
and ctt.ma_kh in (:"SYS_B_086") and ma_tb i
n (:"SYS_B_087")
and ctt.loaitien_id in (:"SYS_B_088") and pt.httt_id in (:"SYS_B_089", :"SYS_B_090")
group by ctt.ma_kh
) da_dc
, /*(
SELECT ma_kh, sum(sotien) tien
from CCS_HNI.kyquys
where ma_kh in ('HNIDD00081787') and ma_tb in ('84913203636')
and loaitien_id in (1)
group by ma_kh
) thu_kq
, (
SELECT ma_kh, sum(sotien) tien
from CCS_HNI.chikyquys
where ma_kh in ('HNIDD00081787') and ma_tb in ('84913203636')
and loaitien_id in (1)
group by ma_kh
) chi_kq
, */ (
SELECT ma_kh, sum(tragoc+trathue) tien
from CCS_HNI.cn_052009
where ma_kh in (:"SYS_B_091") and ma_tb in (:"SYS_B_092")
and loaitien_id in (:"SYS_B_093")
and khoanmuctt_id=:"SYS_B_094"
group by ma_kh
) thu_cn
, (
SELECT ma_kh, sum(tragoc+trathue) tien
from CCS_HNI.chi_cn_052009
where ma_kh in (:"SYS_B_095") and ma_tb in (:"SYS_B_096")
and loaitien_id in (:"SYS_B_097")
group by ma_kh
) chi_cn
, (
SELECT ma_kh, sum(sotien) tien
from ccs_common.thuho_052009
where tinh_id=:"SYS_B_098" and ma_kh in (:"SYS_B_099") and ma_tb in (:"SYS_B_100")
and loaitien_id in (:"SYS_B_101")
group by ma_kh
) tien_th
, (
SELECT ma_kh, sum(tiengach) tien
from ccs_common.thuho_052009
where tinh_id=:"SYS_B_102" and ma_kh in (:"SYS_B_103") and ma_tb in (:"SYS_B_104")
and loaitien_id in (:"SYS_B_105")
group by ma_kh
) gach_th , (select * from CCS_HNI.danhba_dds_052009 where :"SYS_B_106"=:"SYS_B_107" and somay in (:"SYS_B_108") ) db where kh.ma_kh=no.ma_kh(+)
and kh.ma_kh=km.ma_kh(+)
and kh.ma_kh=da_tra.ma_kh(+)
and kh.ma_kh=da_km.ma_kh(+)
and kh.ma_kh=da_dc.ma_kh(+)
/*
and kh.ma_kh=thu_kq.ma_kh(+)
and kh.ma_kh=chi_kq.ma_kh(+)
*/
AND kh.ma_kh=thu_cn.ma_kh(+)
and kh.ma_kh=chi_cn.ma_kh(+)
and kh.ma_kh=tien_th.ma_kh(+)
and kh.ma_kh=gach_th.ma_kh(+)
and kh.ma_kh=db.ma_kh(+)) |
| 8hdn2qwu9sfuu | select count(:"SYS_B_0") from CCS_BNH.danhba_dds_pttb a where a.somay=:"SYS_B_1" |
| 8s9zpsgmd5n2u | select sum(nvl(tragoc, 0)+nvl(trathue, 0)) from
(select ma_kh, ma_tb, chukyno, kieutra, tragoc, trathue, khoanmuctt_id from CCS_HCM.ct_tra_042009 tra
where tra.ma_kh=:ma_kh and tra.ma_tb=:ma_tb and
kieutra=:kieutra
union all
select ma_kh, ma_tb, chukyno, kieuno, nogoc, thue, khoanmuctt_id from CCS_HCM.ct_no_042009 no
where no.ma_kh=:ma_kh and no.ma_tb=:ma_tb and
kieuno=:kieuno) |
| 8vrm2a7my2q8w |
SELECT ma_kh, initcap(ten_tt)ten_tt, thang, to_char(sotien, :"SYS_B_00")sotien, to_char(dauky, :"SYS_B_01")dauky, sophieu, ma_nv FROM( SELECT DECODE(GROUPING(ma_kh)+GROUPING(ma_nv) + GROUPING(tenbuucuc), :"SYS_B_02", max(ma_kh), :"SYS_B_03", :"SYS_B_04"||ma_nv, :"SYS_B_05", :"SYS_B_06"||tenbuucuc||:"SYS_B_07", :"SYS_B_08", :"SYS_B_09") ma_kh, DECODE(GROUPING(ma_kh)+GROUPING(ma_nv) + GROUPING(tenbuucuc), :"SYS_B_10", MAX(ten_tt)) ten_tt, DECODE(GROUPING(ma_kh)+GROUPING(ma_nv) + GROUPING(tenbuucuc), :"SYS_B_11", ma_nv) ma_nv, DECODE(GROUPING(ma_kh)+GROUPING(ma_nv) + GROUPING(tenbuucuc), :"SYS_B_12", MAX(thang))thang, DECODE(GROUPING(ma_kh)+GROUPING(ma_nv) + GROUPING(tenbuucuc), :"SYS_B_13", MAX(sotien), :"SYS_B_14", SUM(sotien), :"SYS_B_15", SUM(sotien), :"SYS_B_16", SUM(sotien))sotien, DECODE(GROUPING(ma_kh)+GROUPING(ma_nv) + GROUPING(tenbuucuc), :"SYS_B_17", MAX(dauky), :"SYS_B_18", SUM(dauky), :"SYS_B_19", SUM(dauky), :"SYS_B_20", SUM(dauky))dauky, DECODE(GROUPING(ma_kh)+GROUPING(ma_nv) + GROUPING(tenbuucuc), :"SYS_B_21", MAX(sophieu), :"SYS_B_22", COUNT(sophieu), :"SYS_B_23", COUNT(sophieu), :"SYS_B_24", count(sophieu))sophieu FROM ( select sotien, dauky, ma_kh, thang, ma_nv, ten_tt, count(:"SYS_B_25") sophieu, tenbuucuc from ( SELECT decode(a.kieuno, :"SYS_B_26", SUM(a.NOGOC+a.THUE), :"SYS_B_27") sotien, decode(a.kieuno, :"SYS_B_28", SUM(a.NOGOC+a.THUE), :"SYS_B_29") dauky, a.MA_KH, COUNT(a.MA_KH) sophieu, :"SYS_B_30" thang , b.MA_NV, b.TEN_TT,
c
.TENBUUCUC FROM ( select a.* from CCS_HNI.ct_no_042009 a, ( select distinct ma_kh from ( select distinct ma_kh from CCS_HNI.ct_no_042009 union all (select distinct ma_kh from CCS_HNI.ct_no_042009 where chukyno=:"SYS_B_31" minus select distinct b.ma_KH FROM CCS_HNI.bangphieutra_042009 a, CCS_HNI.ct_tra_042009 b where a.httt_id<>:"SYS_B_32" and a.phieu_id = b.phieu_id
and b.chukyno=:"SYS_B_33" ))) b where a.ma_kh = b.ma_kh ) a , CCS_HNI.khachhangs_042009 b , CCS_HNI.buucucthus c
WHERE :"SYS_B_34"=:"SYS_B_35" and b.donviql_id=:"SYS_B_36" and b.ma_bc=:"SYS_B_37" AND a.MA_KH = b.MA_KH AND b.MA_BC = c.MA_BC
GROUP BY a.MA_KH, b.MA_NV, ten_tt, c.TENBUUCUC, a.kieuno
HAVING SUM(a.NOGOC+a.THUE)<>:"SYS_B_38") where sotien<>:"SYS_B_39"
group by sotien, dauky, ma_kh, thang, ma_nv, ten_tt, tenbuucuc ) GROUP BY ROLLUP(tenbuucuc, ma_nv, ma_kh)) |
| 8z1fgr6wzkqz9 |
select * from (SELECT ph.chungtu, tra.ma_tb, ph.ma_kh,
to_char(ph.ngay_tt, :"SYS_B_00") ngay_tt,
to_char(nvl(tra.tragoc, :"SYS_B_01") + nvl(tra.trathue, :"SYS_B_02"), :"SYS_B_03") thuctra,
QLTN_xln.laytt_thangtra1(:"SYS_B_04", ph.phieu_id, :"SYS_B_05", :"SYS_B_06") ckn_chu,
ph.seri, ph.soseri, ph.gomhoadon,
ht.hinhthuc, to_char(ph.ngay_thuc, :"SYS_B_07") ngay_thuc, bc.tenbuucuc,
ph.phieu_id, ph.nguoigach, ng.hovaten, ph.gachtumay,
ph.ghichu
FROM CCS_HCM.bangphieutra_112008 ph,
(SELECT SUM (tragoc) tragoc, SUM (trathue) trathue, max(ma_tb) ma_tb,
phieu_id FROM CCS_HCM.ct_tra_112008
GROUP BY phieu_id) tra,
CCS_HCM.nguoigachnos ng,
ccs_common.hinhthuc_tts ht,
CCS_HCM.buucucthus bc
WHERE ph.phieu_id = tra.phieu_id
AND ph.nguoigach = ng.nguoigach
AND ht.httt_id=ph.httt_id
AND ph.ma_bc=bc.ma_bc and tra.ma_tb=:"SYS_B_08" union all SELECT ph.chungtu, tra.ma_tb, ph.ma_kh,
to_char(ph.ngay_tt, :"SYS_B_09") ngay_tt,
to_char(nvl(tra.tragoc, :"SYS_B_10") + nvl(tra.trathue, :"SYS_B_11"), :"SYS_B_12") thuctra,
QLTN_xln.laytt_thangtra1(:"SYS_B_13", ph.phieu_id, :"SYS_B_14", :"SYS_B_15") ckn_ch
u,
ph.seri, ph.soseri, ph.gomhoadon,
ht.hinhthuc, to_char(ph.ngay_thuc, :"SYS_B_16") ngay_thuc, bc.tenbuucuc,
ph.phieu_id, ph.nguoigach, ng.hovaten, ph.gachtumay,
ph.ghichu
FROM CCS_HCM.bangphieutra_122008 ph,
(SELECT SUM (tragoc) tragoc, SUM (trathue) trathue, max(ma_tb) ma_tb,
phieu_id FROM CCS_HCM.ct_tra_122008
GROUP BY phieu_id) tra,
CCS_HCM.nguoigachnos ng,
ccs_common.hinhthuc_tts ht,
CCS_HCM.buucucthus bc
WHERE ph.phieu_id = tra.phieu_id
AND ph.nguoigach = ng.nguoigach
AND ht.httt_id=ph.httt_id
AND ph.ma_bc=bc.ma_bc and tra.ma_tb=:"SYS_B_17" union all SELECT ph.chungtu, tra.ma_tb, ph.ma_kh,
to_char(ph.ngay_tt, :"SYS_B_18") ngay_tt,
to_char(nvl(tra.tragoc, :"SYS_B_19") + nvl(tra.trathue, :"SYS_B_20"), :"SYS_B_21") thuctra,
QLTN_xln.laytt_thangtra1(:"SYS_B_22", ph.phieu_id, :"SYS_B_23", :"SYS_B_24") ckn_chu,
ph.seri, ph.soseri, ph.gomhoadon,
ht.hinhthuc, to_char(ph.ngay_thuc, :"SYS_B_25") ngay_thuc, bc.tenbuucuc,
ph.phieu_id, ph.nguoigach, ng.hovaten, ph.gachtumay,
ph.ghichu
FROM CCS_HCM.bangphieutra_012009 ph,
(SELECT
SUM (tragoc) tragoc, SUM (trathue) trathue, max(ma_tb) ma_tb,
phieu_id FROM CCS_HCM.ct_tra_012009
GROUP BY phieu_id) tra,
CCS_HCM.nguoigachnos ng,
ccs_common.hinhthuc_tts ht,
CCS_HCM.buucucthus bc
WHERE ph.phieu_id = tra.phieu_id
AND ph.nguoigach = ng.nguoigach
AND ht.httt_id=ph.httt_id
AND ph.ma_bc=bc.ma_bc and tra.ma_tb=:"SYS_B_26" union all SELECT ph.chungtu, tra.ma_tb, ph.ma_kh,
to_char(ph.ngay_tt, :"SYS_B_27") ngay_tt,
to_char(nvl(tra.tragoc, :"SYS_B_28") + nvl(tra.trathue, :"SYS_B_29"), :"SYS_B_30") thuctra,
QLTN_xln.laytt_thangtra1(:"SYS_B_31", ph.phieu_id, :"SYS_B_32", :"SYS_B_33") ckn_chu,
ph.seri, ph.soseri, ph.gomhoadon,
ht.hinhthuc, to_char(ph.ngay_thuc, :"SYS_B_34") ngay_thuc, bc.tenbuucuc,
ph.phieu_id, ph.nguoigach, ng.hovaten, ph.gachtumay,
ph.ghichu
FROM CCS_HCM.bangphieutra_022009 ph,
(SELECT SUM (tragoc) tragoc, SUM (trathue) trathue, max(ma_tb) ma_tb,
phieu_id FROM CCS_HCM.ct_tra_022009
GROUP BY phieu_id) tra,
CCS_HCM.nguoigachnos ng,
ccs_common.hinhthuc_tts ht,
CCS_HCM.buucucthus bc
WHERE ph.phieu_
id = tra.phieu_id
AND ph.nguoigach = ng.nguoigach
AND ht.httt_id=ph.httt_id
AND ph.ma_bc=bc.ma_bc and tra.ma_tb=:"SYS_B_35" union all SELECT ph.chungtu, tra.ma_tb, ph.ma_kh,
to_char(ph.ngay_tt, :"SYS_B_36") ngay_tt,
to_char(nvl(tra.tragoc, :"SYS_B_37") + nvl(tra.trathue, :"SYS_B_38"), :"SYS_B_39") thuctra,
QLTN_xln.laytt_thangtra1(:"SYS_B_40", ph.phieu_id, :"SYS_B_41", :"SYS_B_42") ckn_chu,
ph.seri, ph.soseri, ph.gomhoadon,
ht.hinhthuc, to_char(ph.ngay_thuc, :"SYS_B_43") ngay_thuc, bc.tenbuucuc,
ph.phieu_id, ph.nguoigach, ng.hovaten, ph.gachtumay,
ph.ghichu
FROM CCS_HCM.bangphieutra_032009 ph,
(SELECT SUM (tragoc) tragoc, SUM (trathue) trathue, max(ma_tb) ma_tb,
phieu_id FROM CCS_HCM.ct_tra_032009
GROUP BY phieu_id) tra,
CCS_HCM.nguoigachnos ng,
ccs_common.hinhthuc_tts ht,
CCS_HCM.buucucthus bc
WHERE ph.phieu_id = tra.phieu_id
AND ph.nguoigach = ng.nguoigach
AND ht.httt_id=ph.httt_id
AND ph.ma_bc=bc.ma_bc and tra.ma_tb=:"SYS_B_44" union all SELECT ph.chungtu, tra.ma_tb, ph.ma_kh,
to_char(ph.ngay_tt, :"SYS_B_45") ngay_tt,
to_char(nvl(tra.tragoc, :"SYS_B
_46") + nvl(tra.trathue, :"SYS_B_47"), :"SYS_B_48") thuctra,
QLTN_xln.laytt_thangtra1(:"SYS_B_49", ph.phieu_id, :"SYS_B_50", :"SYS_B_51") ckn_chu,
ph.seri, ph.soseri, ph.gomhoadon,
ht.hinhthuc, to_char(ph.ngay_thuc, :"SYS_B_52") ngay_thuc, bc.tenbuucuc,
ph.phieu_id, ph.nguoigach, ng.hovaten, ph.gachtumay,
ph.ghichu
FROM CCS_HCM.bangphieutra_042009 ph,
(SELECT SUM (tragoc) tragoc, SUM (trathue) trathue, max(ma_tb) ma_tb,
phieu_id FROM CCS_HCM.ct_tra_042009
GROUP BY phieu_id) tra,
CCS_HCM.nguoigachnos ng,
ccs_common.hinhthuc_tts ht,
CCS_HCM.buucucthus bc
WHERE ph.phieu_id = tra.phieu_id
AND ph.nguoigach = ng.nguoigach
AND ht.httt_id=ph.httt_id
AND ph.ma_bc=bc.ma_bc and tra.ma_tb=:"SYS_B_53" union all SELECT ph.chungtu, tra.ma_tb, ph.ma_kh,
to_char(ph.ngay_tt, :"SYS_B_54") ngay_tt,
to_char(nvl(tra.tragoc, :"SYS_B_55") + nvl(tra.trathue, :"SYS_B_56"), :"SYS_B_57") thuctra,
QLTN_xln.laytt_thangtra1(:"SYS_B_58", ph.phieu_id, :"SYS_B_59", :"SYS_B_60") ckn_chu,
ph.seri, ph.soseri, ph.gomhoadon,
ht.hinhthuc, to_char(ph.ngay_thuc, :"SYS_B_61") ngay_thuc, bc.tenbuucuc,
ph.phieu_id, ph.nguoigach, ng.hovaten, ph.gachtumay,
ph.ghichu
FROM CCS_HCM.bangphieutra_052009 ph,
(SELECT SUM (tragoc) tragoc, SUM (trathue) trathue, max(ma_tb) ma_tb,
phieu_id FROM CCS_HCM.ct_tra_052009
GROUP BY phieu_id) tra,
CCS_HCM.nguoigachnos ng,
ccs_common.hinhthuc_tts ht,
CCS_HCM.buucucthus bc
WHERE ph.phieu_id = tra.phieu_id
AND ph.nguoigach = ng.nguoigach
AND ht.httt_id=ph.httt_id
AND ph.ma_bc=bc.ma_bc and tra.ma_tb=:"SYS_B_62" ) order by to_date(ngay_tt, :"SYS_B_63"), to_date(ngay_thuc, :"SYS_B_64") |
| 91uwt9azjrzv9 | SELECT *
FROM ccs_common.thuebao_nhoms_062009 a
WHERE EXISTS (SELECT :"SYS_B_0"
FROM (SELECT a.somay, a.nhom_id--, COUNT (1)
FROM ccs_common.thuebao_nhoms_062009 a
GROUP BY a.somay, a.nhom_id
HAVING COUNT (:"SYS_B_1") > :"SYS_B_2") b
WHERE a.nhom_id = b.nhom_id AND a.somay = b.somay) |
| 964uj0uu29zap | select distinct ma_kh from CCS_HCM.ct_no_052009 where :"SYS_B_0"=:"SYS_B_1" and ma_tb in (:"SYS_B_2") |
| 96g93hntrzjtr | select /*+ rule */ bucket_cnt, row_cnt, cache_cnt, null_cnt, timestamp#, sample_size, minimum, maximum, distcnt, lowval, hival, density, col#, spare1, spare2, avgcln from hist_head$ where obj#=:1 and intcol#=:2 |
| 9tw54j5jy5uby | SELECT B.PHO_ID dieukien, B.TENPHO ten FROM ccs_common.MAPHOS A, ccs_common.DUONGPHOS B
WHERE (A.PHO_ID = B.PHO_ID) AND ( A.Phuong_ID =:1) order by TenPho |
| axxctr8qu5vmr | Select :"SYS_B_0" from CCS_HCM.QUYENLV a where HUY = :"SYS_B_1"
AND name = :"SYS_B_2" AND THANGKYNO LIKE :"SYS_B_3" and rownum<=:"SYS_B_4" |
| b058ymxj1rvkg | SELECT sql_id, sql_text from v$sql WHERE sql_id in (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10) |
| b2gnxm5z6r51n | lock table sys.col_usage$ in exclusive mode nowait |
| b31r7jt6fjmwr | select count(:"SYS_B_0") from CCS_TNH.danhba_dds_pttb a where a.somay=:"SYS_B_1" |
| b9pc7j5maqw40 | select nvl(count(:"SYS_B_0"), :"SYS_B_1") from ccs_common.KETNOI_CATMO KC where data_schema=:"SYS_B_2" and KC.MA_TB =:"SYS_B_3" AND KC.MA_HD=:"SYS_B_4" |
| bbd15mmyajuq5 | select count(:"SYS_B_0") from CCS_QNH.danhba_dds_pttb a where a.somay=:"SYS_B_1" |
| bbu9d5zu2c1au | select count(*) from all_tables where owner=:"SYS_B_0" and table_name=:"SYS_B_1" |
| bnca8pdsntx2u | select * from (select seri, quyen, soseri from CCS_HCM.nguoigachnos where nguoigach=:"SYS_B_0") where rownum < :"SYS_B_1" |
| btn0n7756q409 | begin :1:= CCS_ADMIN.qltn_tracuu.laytt_notonghop('052009', 'HNIDD00139182', '', '1', '1', 'CCS_HNI.', 'cq1_hni'); end; |
| bwfx4wd80h11p |
SELECT rownum stt, x.* FROM ( SELECT tennganhang_user, ten_dv_user, ten_rpt_user, lanhdao_user, chucdanh_user, diachi_hd_user, ms_thue_user, tinh_kh, taikhoan_user, dienthoai_user, fax_user, ten_dv, ten_dv1, dangky_db_co, dangky_db_k, inchitiet_co, inchitiet_k, ten_rpt, ten_hd, lanhdao, lanhdao1, chucdanh, diachi_hd, msthueB, taikhoanB, dienthoai, fax, nguoi_dd, nguoi_dd1, nguoi_dd2, email, tennganhangb1, tennganhangb, tennganhanga1, tennganhanga, tennha, tien, tienchu, cuoc, tienchu cuoc_chu, kh_sonha, so_nha, kh_quanhuyen, kh_phuongxa, kh_pho, kh_tinh, kh_tinha, kh_tinhb, kh_tinhc, ten_kh, ten_kh1, ten_tt, diachi_ct, diachi_ct1, ms_thue, taikhoan, tai_khoana, cmt , ngaycap_gt, noicap_gt, chucvu, dt_lienhe, mahd, makh, ngay_laphd, dichvuvt_id, tai_nha, tai_bd, tai_nh, chuyen_khoan, hinhthuc_tainha, hinhthuc_tainha||:"SYS_B_00"||diachi_tt hinhthuc_tainha1, hinhthuc_taibuudien, hinhthuc_chuyenkhoan, code, diachi_tt, ten_tt||:"SYS_B_01"||diachi_tt dc_tt, hinhthuc_tainganhang, ma_so, bk_email, bk_buudien, bk_khong, bk_nha, yeucau, gt, uynhiem_chi, uynhiem_thu FROM ( SELECT distinct upper(dv.ten_dv) ten_dv, dv_user.ten_dv ten_dv_user, upper(dv.ten_dv) ten_dv1, DECODE(TO_CHAR(hd.dangky_db), :"SYS_B_02", :"SYS_B_03", :"SYS_B_04") dangky_db_co, DECODE(TO_CHAR(hd.dangky_db), :"SYS_B_0
5", :"SYS_B_06", :"SYS_B_07") dangky_db_k, DECODE(TO_CHAR(tb.inchitiet), :"SYS_B_08", :"SYS_B_09", :"SYS_B_10") inchitiet_co, DECODE(TO_CHAR(tb.inchitiet), :"SYS_B_11", :"SYS_B_12", :"SYS_B_13") inchitiet_k, dv.ten_rpt, dv.ten_hd, dv.lanhdao, dv.lanhdao lanhdao1, dv.chucdanh chucdanh, dv.diachi_hd, dv.ms_thue msthueB, dv.taikhoan taikhoanB, dv.dienthoai, dv.fax, NVL(hd.nguoi_dd, hd.ten_tt) nguoi_dd, NVL(hd.nguoi_dd, hd.ten_tt) nguoi_dd1, NVL(hd.nguoi_dd, hd.ten_tt) nguoi_dd2, hd.email, nh.ten tennganhangb1, nh_user.ten tennganhang_user, nh.ten tennganhangb, nh_hd.ten tennganhanga1, nh_hd.ten tennganhanga, nh_hd.ten tennhA, dv_user.ten_rpt ten_rpt_user, dv_user.lanhdao lanhdao_user, a_kh.name tinh_kh, dv_user.chucdanh chucdanh_user, dv_user.diachi_hd diachi_hd_user, dv_user.ms_thue ms_thue_user, dv_user.taikhoan taikhoan_user, dv_user.dienthoai dienthoai_user, dv_user.fax fax_user, TO_CHAR(TB.CUOC_LD+TB.VAT_LD, :"SYS_B_14") TIEN, UTIL.doisosangchu(TO_CHAR(nvl(TB.CUOC_LD+TB.VAT_LD, :"SYS_B_15"))) TIENCHU, hd.so_gt cmt, NVL(tb.cuoc_ld + tb.vat_ld, :"SYS_B_16") cuoc, hd.so_nha KH_SoNha, hd.so_nha , qn.tenquan kh_quanhuyen, ph.tenphuong kh_phuongxa, dp.tenpho kh_pho, ag.name kh_tinh, ag.name kh_tinhA, ag.name kh_tinhB, ag.name kh_tinhC, hd.coquan ten_kh, up
per(hd.coquan) ten_kh1, hd.ten_tt, hd.diachi_ct, hd.diachi_ct DIACHI_CT1, hd.diachi_tt, hd.ms_thue, hd.taikhoan, hd.taikhoan tai_khoanA, hd.ngaycap_gt, hd.noicap_gt, hd.chucdanh chucvu, hd.DIENTHOAI_LH dt_lienhe, hd.DIADIEMTT_ID, hd.ma_hd MaHD, hd.ma_kh MaKH, TO_CHAR(hd.ngay_laphd, :"SYS_B_17")NGAY_LAPHD, hd.dichvuvt_id, DECODE(hd.diadiemtt_id, :"SYS_B_18", :"SYS_B_19", :"SYS_B_20") tai_nha, DECODE(hd.diadiemtt_id, :"SYS_B_21", :"SYS_B_22", :"SYS_B_23") tai_BD, DECODE(hd.diadiemtt_id, :"SYS_B_24", :"SYS_B_25", :"SYS_B_26") tai_NH, DECODE(hd.diadiemtt_id, :"SYS_B_27", :"SYS_B_28", :"SYS_B_29") chuyen_khoan, DECODE(hd.diadiemtt_id, :"SYS_B_30", :"SYS_B_31", :"SYS_B_32") hinhthuc_tainha, DECODE(hd.diadiemtt_id, :"SYS_B_33", :"SYS_B_34", :"SYS_B_35") hinhthuc_taibuudien, DECODE(hd.diadiemtt_id, :"SYS_B_36", :"SYS_B_37", :"SYS_B_38") hinhthuc_chuyenkhoan, DECODE(hd.diadiemtt_id, :"SYS_B_39", :"SYS_B_40", :"SYS_B_41") hinhthuc_tainganhang, DECODE (hd.chuyenkhoan_id, :"SYS_B_42", :"SYS_B_43", :"SYS_B_44")uynhiem_chi, DECODE (hd.chuyenkhoan_id, :"SYS_B_45", :"SYS_B_46", :"SYS_B_47")uynhiem_thu, gt.code, bc.ma_bc||:"SYS_B_48"||hd.nguoi_cn||:"SYS_B_49"||TO_CHAR(sysdate, :"SYS_B_50") ma_so, DECODE(tb.kieubc_id, :"SYS_B_51", :"SYS_B_52", :"SYS_B_53") bk_email, DECODE(tb.kieubc_id, :"SYS_B_54", :"SYS_B_55", :"SYS_B_56") bk_buudien,
DECODE(tb.kieubc_id, :"SYS_B_57", :"SYS_B_58", :"SYS_B_59") bk_khong, DECODE(tb.kieubc_id, :"SYS_B_60", :"SYS_B_61", :"SYS_B_62") bk_nha, DECODE(tb.kieuld_id, :"SYS_B_63", :"SYS_B_64", :"SYS_B_65", :"SYS_B_66", :"SYS_B_67", :"SYS_B_68", :"SYS_B_69") yeucau, DECODE(hd.loaigt_id, :"SYS_B_70", :"SYS_B_71", :"SYS_B_72", :"SYS_B_73", :"SYS_B_74", :"SYS_B_75", :"SYS_B_76", :"SYS_B_77") gt FROM (SELECT dv.*, nvl(cd.ten, :"SYS_B_78") chucdanh FROM CCS_QNI.donvi_qls dv,
CCS_QNI.chucdanhs cd WHERE dv.chucdanh_id = cd.chucdanh_id(+) )dv,
CCS_QNI.buucucthus bc,
CCS_QNI.hopdong_lds hd, (SELECT * FROM CCS_QNI.thuebao_lds WHERE MA_HD=:"SYS_B_79" AND rownum<=:"SYS_B_80") tb, CCS_QNI.nganhangs nh ,
CCS_QNI.nganhangs nh_user, (SELECT * FROM CCS_QNI.nganhangs)nh_hd,
ccs_common.agent ag, (SELECT dv.*, NVL (cd.ten, :"SYS_B_81") chucdanh FROM CCS_QNI.donvi_qls dv,
CCS_QNI.chucdanhs cd WHERE dv.chucdanh_id = cd.chucdanh_id(+)) dv_user,
ccs_common.quans qn,
ccs_common.quans q_kh,
ccs_common.agent a_kh,
ccs_co
mmon.phuongs ph,
ccs_common.DUONGPHOS dp,
ccs_common.MAPHOS mp,
CCS_QNI.users us,
ccs_common.loai_gts gt WHERE :"SYS_B_82"=:"SYS_B_83" and us.name=:"SYS_B_84" AND ag.schema = :"SYS_B_85" and hd.ma_bc = bc.ma_bc AND tb.ma_hd = hd.ma_hd AND dv_user.donviql_id = us.donviql_id AND hd.loaigt_id= gt.loaigt_id AND q_kh.quan_id(+) = hd.quan_id AND a_kh.agent_id(+) = q_kh.tinh_id AND dv.nganhang_id = nh.nganhang_id(+) AND dv_user.nganhang_id = nh_user.nganhang_id(+) AND hd.nganhang_id = nh_hd.nganhang_id(+) AND bc.donviql_id = dv.donviql_id AND hd.quan_id =qn.quan_id(+) AND hd.phuong_id=ph.phuong_id(+) AND hd.pho_id=mp.pho_id(+) AND dp.pho_id(+)=mp.pho_id AND hd.ma_hd in(:"SYS_B_86")) ) x |
| c33yfr8c2sdcu | select distinct ct.ma_tb from CCS_HCM.ct_tra_052009 ct,
CCS_HCM.bangphieutra_052009 ph where ct.phieu_id=ph.phieu_id and ph.phieu_id=:"SYS_B_0" |
| cb0fwr0haa5rf | select ma_kh from CCS_HCM.khachhangs_052009 where ma_cq||:"SYS_B_0" in (:"SYS_B_1") |
| cjswc8t62pv3d |
select rownum row_stt, c.* from (SELECT ph.ma_kh, kh.sodaidien, kh.ms_thue, kh.ten_tt, kh.diachi_tt,
decode(ph.trangthai, :"SYS_B_00", :"SYS_B_01", :"SYS_B_02") check_box, nvl(no.no_dk, :"SYS_B_03") no_dk, nvl(no.no_ps, :"SYS_B_04") no_ps,
to_char((case when :"SYS_B_05"=:"SYS_B_06" then ph.sotien
else NVL(NO.tongno, :"SYS_B_07") end)-nvl(km.tien, :"SYS_B_08")
, :"SYS_B_09") tiencon, to_char(NVL(ph.tiengiao, sotien), :"SYS_B_10") tienphieu,
to_char(nvl((select sum(tragoc+trathue) from CCS_VTU.ct_tra_032009
where ph.ma_kh=ma_kh), :"SYS_B_11"), :"SYS_B_12") tientra,
to_char(NVL(NO.tongno, :"SYS_B_13"), :"SYS_B_14") tongno,
to_char(nvl(km.tien, :"SYS_B_15"), :"SYS_B_16") khuyenmai, decode(nvl(km.tien, :"SYS_B_17"), :"SYS_B_18", :"SYS_B_19", :"SYS_B_20") check_km,
ph.chukyno, ph.seri, ph.thung, ph.soseri,
qltn.chukyno_dangchu (ph.chukyno, :"SYS_B_21", :"SYS_B_22") kyhoadon,
ph.loaihd_id, ph.ten_t, ph.ma_t, ph.ma_nv, ph.ma_bc,
:"SYS_B_23" cf_ma_kh, :"SYS_B_24" cf_sdd, :"SYS_B_25" cf_ten_tt, :"SYS_B_26" cf_diachi_tt, :"SYS_B_27" cf_ms_thue, :"SYS_B_28" cf_seri, :"SYS_B_29" cf_soseri, :"SYS_B_30" cf_ma_t, :"SYS_B_31" cf_ky_hd, :"SYS_B_32" cf_no_dk, :"SYS_B_33" cf_no_ps, :"SYS_B_34" cf_tongno, :"SYS_B_35" cf_tien
phieu, :"SYS_B_36" cf_datra, :"SYS_B_37" cf_httt, :"SYS_B_38" cf_so_ct, :"SYS_B_39" cf_kytra, :"SYS_B_40" cf_kh_tra
FROM CCS_VTU.PHIEU_032009 ph,
CCS_VTU.khachhangs_032009 kh,
(SELECT SUM (nogoc + thue - hoahong) tongno, sum(decode(kieuno, :"SYS_B_41", nogoc+thue, :"SYS_B_42")) no_dk,
sum(decode(chukyno, :"SYS_B_43", nogoc+thue, :"SYS_B_44")) no_ps, ma_kh
FROM CCS_VTU.ct_no_032009
GROUP BY ma_kh) NO,
(select sum (nogoc+thue) tien, ma_kh from CCS_VTU.kmck_032009
where trangthai_id=:"SYS_B_45" group by ma_kh) km
WHERE ph.ma_kh = kh.ma_kh(+)
AND ph.ma_kh = NO.ma_kh(+)
and ph.ma_kh=km.ma_kh(+)
and ph.chukyno=:"SYS_B_46" and exists (select :"SYS_B_47" from CCS_VTU.user_buucuc where kh.MA_BC=ma_bc and userid=:"SYS_B_48") AND ph.ma_nv = :"SYS_B_49" AND ph.trangthai in (:"SYS_B_50", :"SYS_B_51") order by ph.ma_nv, ph.ma_t, ph.ma_kh, kh.sodaidien, kh.ten_tt) c where rownum<:"SYS_B_52" |
| d4tq7gvv2phba | select ma_bc from CCS_HCM.user_buucuc where userid=:"SYS_B_0" |
| db78fxqxwxt7r | select /*+ rule */ bucket, endpoint, col#, epvalue from histgrm$ where obj#=:1 and intcol#=:2 and row#=:3 order by bucket |
| dq15xdpusd899 | begin :1:= CCS_ADMIN.qltn_tracuu.laytt_notonghop('052009', '', '84913203636', '1', '1', 'CCS_HNI.', 'cq1_hni'); end; |
| durpnk0t0gj0h | SELECT * FROM "CCS_CBG"."CT_NO_042009" |
| dwrvx27q3z34r | SELECT ID, NAME, DETAIL_FILE, PICTURE_FILE, STATUSBAR_TEXT, MENU_LEVEL, PARENT_ID, NVL (WINDOW_PROP, ' ') WINDOW_PROP, WINDOW_WIDTH, WINDOW_HEIGHT, NVL (WINDOW_PARAM, ' ') WINDOW_PARAM FROM MENU A, (SELECT DISTINCT MENU_ID FROM MENU_ACCESS A, USER_ROLE B WHERE 1 = 1 AND B.USER_ID = :B1 AND B.ROLE_ID = A.ROLE_ID) B WHERE STYLE = 'top' AND PUBLISH = 1 AND A.ID = B.MENU_ID ORDER BY GENERAL_ORDER |
| f1mk4qhmj87qr | select a.ma_tinh from ccs_common.thue_bao a where a.so_tb=:"SYS_B_0" |
| f3cc7zu4ccxr9 | SELECT nvl(TBTT, :"SYS_B_0"), nvl(KHAC, :"SYS_B_1") FROM
(SELECT SUM(CT.NOGOC + CT.THUE - CT.HOAHONG) TBTT
FROM CCS_HCM.ct_no_052009 CT,
CCS_HCM.bangphieutra_052009 PH
WHERE PH.phieu_id = :"SYS_B_2"
AND CT.MA_TB IN(:"SYS_B_3")
AND PH.MA_KH = CT.MA_KH),
(SELECT SUM(CT.NOGOC + CT.THUE - CT.HOAHONG) KHAC
FROM CCS_HCM.ct_no_052009 CT,
CCS_HCM.bangphieutra_052009 PH
WHERE PH.phieu_id = :"SYS_B_4"
AND CT.MA_TB NOT IN(:"SYS_B_5")
AND PH.MA_KH = CT.MA_KH) |
| f3qbuy2ujcpab | select username from sys.dba_users where exists (select :"SYS_B_0" from sys.dba_objects where owner=username) or username = user order by username |
| f6kjhnkzgs2hm | begin :1 := CCS_ADMIN.pttb_thtoan.gachno_hdld('pttb_thuvta_hnm', 'HNM', 'CCS_HNM.', 'HNM-LD/00004174', '3422', '10.30.34.75', 1, to_date('08/06/2009', 'DD/MM/YYYY'), to_date('08/06/2009', 'DD/MM/YYYY'), 1, 1, null, '', '');end; |
| fbd1gzpptzu82 |
select * from (SELECT kh.ten_tt, tra.ma_tb somay, kh.diachi_tt, ph.seri, ph.soseri, ph.ma_kh, ph.phieu_id,
ph.ma_tn, ph.chungtu, ph.ghichu, ph.nguoigach, lt.viettat, to_char(ph.ngay_tt, :"SYS_B_00") ngay_tt,
ph.sophieu, ph.luotthanhtoan, qltn.chukyno_dangchu(tra.chukyno, :"SYS_B_01", :"SYS_B_02") thangtra,
to_char(ph.ngay_thuc, :"SYS_B_03") ngay_thuc, to_char(ck.ngaynhan, :"SYS_B_04") ngaynhan,
ht.hinhthuc, to_char(NVL (km.khuyenmai, :"SYS_B_05"), :"SYS_B_06") chietkhau,
:"SYS_B_07" chukyno, to_char(tra.tientra, :"SYS_B_08") tientra
FROM CCS_HNI.bangphieutra_042009 ph,
CCS_HNI.loaitiens lt,
(select ma_kh, max(phieu_id) phieu_id, max(ngaynhan) ngaynhan from CCS_HNI.chuyenkhoans group by ma_kh) ck,
ccs_common.hinhthuc_tts ht,
CCS_HNI.khachhangs_042009 kh,
(SELECT SUM (tragoc - chihoahong + trathue) tientra, max(chukyno) chukyno, ma_kh, phieu_id, max(ma_tb) ma_tb
FROM CCS_HNI.ct_tra_042009
GROUP BY ma_kh, phieu_id) tra,
(SELECT SUM (nogoc + thue - hoahong) khuyenmai, ma_kh, phieu_id
FROM CCS_HNI.kmck_042009
WHERE trangthai_id = :"SYS_B_09"
GROUP BY ma_kh, phieu_id) km
WHERE ph.phieu_id = tra.phieu_id
AND ph.phieu_id = km.phieu_id(+)
AND ph.l
oaitien_id = lt.loaitien_id
AND ph.httt_id = ht.httt_id
AND ph.ma_kh = ck.ma_kh(+)
AND kh.ma_kh = ph.ma_kh and ph.ngay_tt>=to_date(:"SYS_B_10", :"SYS_B_11") and ph.ngay_tt<=to_date(:"SYS_B_12", :"SYS_B_13")) order by sophieu |
| fj956xukzdnnp | SELECT U.USERID, U.PASSWORD, U.LDAP_CHECK, U.USER_NAME, A.SHORT_NAME, A.SCHEMA FROM USER_INFO U, AGENT A WHERE 1=1 AND U.STATUS=0 AND U.USERID= :B1 AND U.AGENT_ID= A.AGENT_ID |
| fmg55191p2fv7 |
select distinct qltn_tamthu.chuanhoa_string(kh.ten_tt) ten_tt,
qltn_tamthu.chuanhoa_string(kh.diachi_tt) diachi_tt,
kh.ms_thue, kh.ma_kh,
nvl(no.nogoc, :"SYS_B_000") nogoc_thuc,
nvl(no.thue, :"SYS_B_001") thue_thuc,
to_char(nvl(no.nogoc, :"SYS_B_002")+nvl(no.thue, :"SYS_B_003"), :"SYS_B_004") tongno_thuc,
nvl(km.nogoc, :"SYS_B_005") nogoc_km,
nvl(km.thue, :"SYS_B_006") thue_km,
to_char( nvl(km.nogoc, :"SYS_B_007")+nvl(km.thue, :"SYS_B_008"), :"SYS_B_009") tongno_km,
(nvl(no.nogoc, :"SYS_B_010")-nvl(km.nogoc, :"SYS_B_011")) nogoc,
(nvl(no.thue, :"SYS_B_012")-nvl(km.thue, :"SYS_B_013")) thue,
to_char( nvl(no.nogoc, :"SYS_B_014")-nvl(km.nogoc, :"SYS_B_015")+nvl(no.thue, :"SYS_B_016")-nvl(km.thue, :"SYS_B_017"), :"SYS_B_018") tongno,
nvl(no.ma_tb, kh.sodaidien) ma_tb,
to_char(nvl(da_tra.tra, :"SYS_B_019"), :"SYS_B_020") datra,
to_char(nvl(da_km.tra, :"SYS_B_021"), :"SYS_B_022") da_km,
:"SYS_B_023" da_ck,
to_char(nvl(da_dc.tra, :"SYS_B_024"), :"SYS_B_025") da_dc,
TO_CHAR(nvl(thu_kq.tien, :"SYS_B_026")-nvl(chi_kq.tien, :"SYS_B_027"), :"SYS_B_028") thu_kyquy,
to_char(nvl(tien_th.tien, :"SYS_B_029")-nvl(gach_th.tien, :"SYS_B_030"), :"SYS_B_031") tinhthuho,
TO_CHAR(nvl(thu_cn.tien, :"SYS_B_032")-nvl(chi_cn.tien, :"SYS_B_033"), :"S
YS_B_034") thu_cuocnong , to_char(nvl(thdd_cn.tien, :"SYS_B_035"), :"SYS_B_036") cuocnong,
:"SYS_B_037" tt_cuocnong , to_char(qltn_tamthu.laytt_tientamthu2(
nvl(thdd_cn.tien, :"SYS_B_038"),
nvl(thdd_cn.qtrm, :"SYS_B_039"),
:"SYS_B_040"), :"SYS_B_041") tra_cuocnong,
--bo qua viec query sang VNP67 de tranh viec nghen he thong
--Khong chinh xac - phai la doituong_id trong danh ba
decode(nvl(db.doituong_id, :"SYS_B_042"), :"SYS_B_043", :"SYS_B_044", :"SYS_B_045") --khach hang nuoc ngoai hoac khu che xuat
|| (case when nvl(no.nogoc, :"SYS_B_046")+ nvl(no.thue, :"SYS_B_047") <=:"SYS_B_048" then :"SYS_B_049" else :"SYS_B_050" end) --khach hang het no
|| (case when nvl(tien_th.tien, :"SYS_B_051")-nvl(gach_th.tien, :"SYS_B_052") >:"SYS_B_053" then :"SYS_B_054" else :"SYS_B_055" end) --khach hang co thu ho
|| (case when nvl(km.nogoc, :"SYS_B_056")+nvl(km.thue, :"SYS_B_057") >:"SYS_B_058" then :"SYS_B_059" else :"SYS_B_060" end) --khach hang co khuyen mai
||:"SYS_B_061" --co nhieu khach hang
thongbao,
kh.ma_nv, kh.ma_t/*,
decode(no.ma_tb, db.somay, 1, 0) kh_hientai*/
from
(select * from CCS_HCM.khachhangs_pttb where ma_kh in (:"SYS_B_062") ) kh
, (
SELECT ma_kh, SUM (n
ogoc) nogoc, SUM (thue) thue, max(ma_tb) ma_tb
from CCS_HCM.ct_no_052009
where kieuno<>:"SYS_B_063" and ma_kh in (:"SYS_B_064") and ma_tb in (:"SYS_B_065")
and loaitien_id in (:"SYS_B_066")
group by ma_kh
) no
, (
SELECT ma_kh, SUM (nogoc) nogoc, SUM (thue) thue
from CCS_HCM.ct_no_052009
where kieuno=:"SYS_B_067" and ma_kh in (:"SYS_B_068") and ma_tb in (:"SYS_B_069")
and loaitien_id in (:"SYS_B_070")
group by ma_kh
) km
, (
SELECT ma_kh, sum(tragoc+trathue) tra
from CCS_HCM.ct_tra_052009
where ma_kh in (:"SYS_B_071") and ma_tb in (:"SYS_B_072")
and loaitien_id in (:"SYS_B_073")
group by ma_kh
) da_tra
, (
SELECT ctt.ma_kh, sum(ctt.tragoc+ctt.trathue) tra
from CCS_HCM.ct_tra_052009 ctt, CCS_HCM.bangphieutra_052009 pt
where ctt.phieu_id=pt.phieu_id
and ctt.ma_kh in (:"SYS_B_074") and ma_tb in (:"SYS_B_075")
and ctt.loaitien_id in (:"SYS_B_076") and pt.httt_id in (:"SYS_B_077")
group by ctt.ma_kh
) da_km
, (
SELECT ctt.ma_kh, sum
(ctt.tragoc+ctt.trathue) tra
from CCS_HCM.ct_tra_052009 ctt, CCS_HCM.bangphieutra_052009 pt
where ctt.phieu_id=pt.phieu_id
and ctt.ma_kh in (:"SYS_B_078") and ma_tb in (:"SYS_B_079")
and ctt.loaitien_id in (:"SYS_B_080") and pt.httt_id in (:"SYS_B_081", :"SYS_B_082")
group by ctt.ma_kh
) da_dc
, (
SELECT ma_kh, sum(sotien) tien
from CCS_HCM.kyquys
where ma_kh in (:"SYS_B_083") and ma_tb in (:"SYS_B_084")
and loaitien_id in (:"SYS_B_085")
group by ma_kh
) thu_kq
, (
SELECT ma_kh, sum(sotien) tien
from CCS_HCM.chikyquys
where ma_kh in (:"SYS_B_086") and ma_tb in (:"SYS_B_087")
and loaitien_id in (:"SYS_B_088")
group by ma_kh
) chi_kq
, (
SELECT ma_kh, sum(tragoc+trathue) tien
from CCS_HCM.cn_052009
where ma_kh in (:"SYS_B_089") and ma_tb in (:"SYS_B_090")
and loaitien_id in (:"SYS_B_091")
and khoanmuctt_id=:"SYS_B_092"
group by ma_kh
) thu_cn
, (
SELECT ma_kh, sum(tragoc+trathue) tien
from CCS_HCM.c
hi_cn_052009
where ma_kh in (:"SYS_B_093") and ma_tb in (:"SYS_B_094")
and loaitien_id in (:"SYS_B_095")
group by ma_kh
) chi_cn
, (
SELECT ma_kh, sum(sotien) tien
from ccs_common.thuho_052009
where tinh_id=:"SYS_B_096" and ma_kh in (:"SYS_B_097") and ma_tb in (:"SYS_B_098")
and loaitien_id in (:"SYS_B_099")
group by ma_kh
) tien_th
, (
SELECT ma_kh, sum(tiengach) tien
from ccs_common.thuho_052009
where tinh_id=:"SYS_B_100" and ma_kh in (:"SYS_B_101") and ma_tb in (:"SYS_B_102")
and loaitien_id in (:"SYS_B_103")
group by ma_kh
) gach_th , (
SELECT ma_kh, round(sum(tien+vat)) tien,
count (distinct (decode(khoanmuctc_id, :"SYS_B_104", :"SYS_B_105", :"SYS_B_106", :"SYS_B_107", null))) qtrm
from CCS_HCM.thdd_200906@DBL_2_BILLING
where ma_kh in (:"SYS_B_108") and somay in (:"SYS_B_109")
and usd = (case when :"SYS_B_110"=:"SYS_B_111" then :"SYS_B_112" else :"SYS_B_113" end)
group by ma_kh
) thdd_cn , (select * from CCS_HCM.danhba_dds_pttb where :"SYS_B_114"=:"SYS_B_115" and somay in (:"SYS_B_116") )
db where kh.ma_kh=no.ma_kh(+)
and kh.ma_kh=km.ma_kh(+)
and kh.ma_kh=da_tra.ma_kh(+)
and kh.ma_kh=da_km.ma_kh(+)
and kh.ma_kh=da_dc.ma_kh(+)
and kh.ma_kh=thu_kq.ma_kh(+)
and kh.ma_kh=chi_kq.ma_kh(+)
AND kh.ma_kh=thu_cn.ma_kh(+)
and kh.ma_kh=chi_cn.ma_kh(+)
and kh.ma_kh=tien_th.ma_kh(+)
and kh.ma_kh=gach_th.ma_kh(+)
and kh.ma_kh=db.ma_kh(+) and kh.ma_kh=thdd_cn.ma_kh(+) |
| ft9bwg84d3x02 | UPDATE ccs_common.ketnoi_catmo SET trangthaith_id =:"SYS_B_0" WHERE ma_hd=:"SYS_B_1" and ma_tb=:"SYS_B_2" |
| g30hy9b8c802b | select * from (select hinhthuctt_ids, qltn_tamthu.laytt_ngaycuocnong(:"SYS_B_0") ngay_cn from CCS_HCM.nguoigachnos where nguoigach=:"SYS_B_1") where rownum < :"SYS_B_2" |
| g4p25zzdxt7wh | SELECT "MA_NV", "TEN_NV" FROM "CCS_CMU"."NHANVIEN_TCS" "NHANVIEN_TCS" WHERE "MA_NV"=:1 |
| gp92v1nz53dfh |
select to_char(sum(replace(sotien, :"SYS_B_00", :"SYS_B_01") ), :"SYS_B_02") sotien,
qltn_baocao.tienchu(sum(replace(sotien, :"SYS_B_03", :"SYS_B_04") ) ) tienchu,
count(*) tongphieu
from (SELECT ph.Ma_kh, ph.Ma_tb, Kh.Ten_tt, ph.so_ct phieu_Id, to_char(ph.ngaynhap, :"SYS_B_05") Ngaythu,
to_char(nvl((select sum(tragoc+trathue) from CCS_HCM.cn where khoanmuctt_id=:"SYS_B_06"
and ph.phieu_id=phieu_id and ph.ckn_chu=ckn_chu), :"SYS_B_07"), :"SYS_B_08") sotien
FROM CCS_HCM.Phieuthu ph,
(SELECT DISTINCT MA_KH, MAX(TEN_TT) TEN_TT FROM ( select ma_kh, ten_tt from CCS_HCM.Khachhangs_052009 union
select ma_kh, ten_tt from CCS_HCM.Khachhangs_052009
) GROUP BY MA_KH ) Kh,
(SELECT MAX (Somay) Ma_tb, Ma_kh
FROM CCS_HCM.Danhba_dds_052009
GROUP BY Ma_kh
union
SELECT MAX (Somay) Ma_tb, Ma_kh
FROM CCS_HCM.Danhba_dds_052009
GROUP BY Ma_kh
) Db,
(SELECT SUM (Sotien) Tienchi, Phieu_thu
FROM CCS_HCM.Phieuchi
GROUP BY Phieu_thu) Chi
WHERE :"SYS_B_09"=:"SYS_B_10" AND ph.ma_bc = :"SYS_B_11" AND ph.ma_tn=:"SYS_B_12" AND ph.ngaynhap >= to_date(:"SYS_B_13", :"SYS_B_14")
AND ph.ngaynhap <= to_date(:"SYS_B_15", :"SYS_B_16") and ph.Phieu_id = Chi.Phieu_thu(+) AND ph.Ma_kh = Kh.Ma_kh AND ph.Ma_kh = Db.Ma_kh(+) AND ph.ckn_chu=:"SYS_B_17" and ph.httt_id!=:"SYS_B_18" ) |