[loadOriginal]
select fnc_load_basv0230(:s_id, :nyukin_no)

[updateOriginal]
select fnc_update_basv0230(:s_id)

[doDelete]
select fnc_delete_basv0230(:nyukin_no, ':login_id')

[getMaxDenNo]
select
  (select max(den_no) from m_saiban where saiban_kbn = 5) as last_den_no

[getUriDen]
select uh.tok_cd, uh.zeikomi_gaku as seikyu_gaku
, COALESCE(nk.keshi_gaku,0) as keshi_gaku
, COALESCE(uh.zeikomi_gaku,0) - COALESCE(nk.keshi_gaku,0) as seikyu_zan
from t_uri uh
left join (
	select uri_no, sum(nyukin_gaku) as keshi_gaku
	from t_nyu_keshi
	where uri_no = :uri_no
	and nyukin_no != fnc_to_number(':w_nyukin_no')
	group by uri_no
) nk on (nk.uri_no = uh.den_no)
where uh.den_no = :uri_no
and uh.jucyu_flg = 0

[load_grdList_den]
select k.nyukin_no, n.nyukin_ymd, n.total_gaku
from t_nyu_keshi k
inner join t_nyukin n on (n.nyukin_no = k.nyukin_no)
where k.uri_no = :uri_no
and k.nyukin_no != fnc_to_number(':w_nyukin_no')
order by k.nyukin_no




