[load_grdList]
select
  um.den_no
, row_number() over(order by um.row_no, vh.row_no) 
, um.row_no
, vh.chin_cd as hin_cd
, mh.hin_nm
, um.jucyu_su * vh.set_su as suryo
, vsir.hacyu_su as haccyu_suryo
, mh.stanka
, (um.jucyu_su * vh.set_su) * mh.stanka as kingaku
, (case when (um.jucyu_su * vh.set_su) <= vsir.hacyu_su then 1 else 0 end) as hacyu_flg
from t_uri_m um
inner join v_sethin vh on (vh.hin_cd = um.hin_cd)
inner join m_hin mh on (mh.hin_cd = vh.chin_cd)
inner join m_hanyo h1 on (h1.mst_kbn = '04' and h1.han_cd = mh.hin_sts)
left join v_jyucyu_mihaccyu vsir on (um.den_no = vsir.jucyu_no and um.row_no = vsir.jucyu_row_no and vh.chin_cd = vsir.hin_cd)
where um.den_no = :jucyu_no
and h1.koumoku1 = '1'
order by um.row_no, vh.row_no

[delete_w_basv0211]
delete from w_basv0211
where s_id = :s_id
;
delete from w_basv0211
where den_no = :w_den_no
;

[insert_w_basv0211]
insert into w_basv0211
(s_id, den_no, row_no, hin_cd, del_flg, cre_id, cre_time, upd_id, upd_time)
values(:s_id, :w_den_no, :w_row_no, ':w_hin_cd', 0, ':login_id', now(), ':login_id', now());