insert into fne_treasury_tips
select get_uuid,
a.frgnid,
a.frgncode,
(select aa.fname
from afa_auth_region aa
where aa.fcode = a.frgncode),
‘02’ || (select to_char(sysdate, ‘yyyymmdd’) from dual) ||
nvl((select lpad((max(substr(ft.FBATCHNO, 11)) + 1), 8, ‘0’)
from fne_treasury_tips ft
where substr(ft.FBATCHNO, 3, 8) =
(select to_char(sysdate, ‘yyyymmdd’) from dual)),
‘00000001’),
to_char(sysdate, ‘yyyy-mm-dd’),
‘’,
t.foffcode,
t.fbanktypecode,
t.fbanktypename,
t.fpayopbkname,
t.fpayopbkno,
t.fpaybkno,
t.fpayacct,
t.fpayaccname,
a.fclearno,
a.forgcode,
a.faccname,
a.faccount,
t.ftaxpayercode,
t.ftaxpayername,
u.ftotalamt,
‘0’,
‘’,
a.fbankopenname,
‘’,
‘1’,
‘’ FTAXDATE,
‘’ FRECONCILEDATE,
‘0’,
‘0’,
‘’,
‘’ FTREATYPE,
u.fpaycode,
(select fd.fdeptcode
from fab_agen fa, fab_dept fd
where fa.fdeptid = fd.fid
and fa.fagenidcode = u.fagenidcode),
(select fd.fdeptname
from fab_agen fa, fab_dept fd
where fa.fdeptid = fd.fid
and fa.fagenidcode = u.fagenidcode),
u.fagenidcode,
u.fagencode,
u.fagenname,
‘0’,’1’
from fab_tips_protocol t, fab_treasury_acc a, une_paybook u
where exists (select 1 from fne_paybook fp where fp.fpaycode = u.fpaycode)
and t.fbanktypecode = ‘0102’ —缴库测试银行
and u.fpaycode = ‘2102001600000001149’;
—缴款码(要求已缴款)
———————- fne_treasury_tips_item明细表语句—————————-
insert into fne_treasury_tips_item
select get_uuid,
(select max(ft.fid)
from fne_treasury_tips ft
where ft.fpaycode = p.fpaycode),
t.fsubcode,
t.fsubname,
‘3’,
‘市级’,
‘00000000000000100000000000000000000’,
t.famt,
‘市级:100%’,
‘0’,’1’
from fne_paybook_item t, fne_paybook p
where t.fpid = p.fid
and p.fpaycode = ‘2102001600000001149’;
—-缴款码(要求已缴款)