[load_grdList]
select
  w.hin_cd
, w.hin_nm
, w.hin_rnm
, w.jan_cd
, w.brand_cd
, w.brand_nm
, w.htanka
, w.tanka
, w.cat_cd
, w.cat_nm
, w.htanka_f2
, w.tanka_f2
, w.sir_cd
, w.row_no
, w.sir_nm
, w.stanka_f2
, w.sirhin_biko
from (
select
  m.hin_cd
, m.hin_nm
, m.hin_rnm
, m.jan_cd
, m.brand_cd
, h1.han_name as brand_nm
, m.htanka
, m.tanka
, m.cat_cd
, h2.han_name as cat_nm
, m.htanka as htanka_f2
, m.tanka as tanka_f2
, sh.sir_cd
, sh.row_no
, ms.sir_nm
, sh.tanka as stanka_f2
, sh.biko as sirhin_biko
from m_hin m
inner join m_sirhin sh on (sh.hin_cd = m.hin_cd)
left join m_hanyo h1 on (h1.mst_kbn = '06' and h1.han_cd = m.brand_cd)
left join m_hanyo h2 on (h2.mst_kbn = '05' and h2.han_cd = m.cat_cd)
left join m_sir ms on (ms.sir_cd = sh.sir_cd)
WHERE 1 = 1
AND ((m.jan_cd LIKE '%:jan_cd%') or (':jan_cd' = ''))
AND (((':hin-srcmid' != '1') or (m.hin_cd LIKE '%:hin_cd%' or m.jan_cd LIKE '%:hin_cd%')) or (':hin_cd' = ''))
AND (((':hin-srcmid' = '1') or (m.hin_cd LIKE ':hin_cd%' or m.jan_cd LIKE ':hin_cd%' or m.jan_cd LIKE '%/ :hin_cd%' or m.jan_cd LIKE '%/:hin_cd%')) or (':hin_cd' = ''))
AND ((m.hin_nm LIKE '%:hin_nm%' or m.hin_rnm LIKE '%:hin_nm%') or (':hin_nm' = ''))
AND ((m.brand_cd = ':brand_cd') or (':brand_cd' = ''))
AND ((h2.han_cd is not null and h2.koumoku1 = ':dcat_cd') or (':dcat_cd' = ''))
AND ((m.cat_cd = ':cat_cd') or (':cat_cd' = ''))
AND ((m.price_kbn = ':price_kbn') or (':price_kbn' = ''))
AND ((m.hin_sts = ':hin_sts') or (':hin_sts' = ''))
AND ((':stop_cond' != '0') or (m.stop_flg = 0))
AND ((':stop_cond' != '1') or (m.stop_flg = 1))
AND ((':inner_cond' != '0') or (m.inner_flg = 0))
AND ((':inner_cond' != '1') or (m.inner_flg = 1))
and (('' = ':sir_cd') or (sh.sir_cd = ':sir_cd'))
and ((ms.sir_nm like '%:sir_nm%') or ('' = ':sir_nm'))
and m.del_flg = 0
and sh.del_flg = 0
) w
order by hin_cd, sir_cd, row_no



[deleteHacyuWork]
delete from w_basv0220_load_m where s_id = :s_id

[insertHacyuWork]
insert into w_basv0220_load_m (s_id, row_no, hin_cd, hin_nm, suryo, hacyu_su, del_flg, cre_id, cre_time, upd_id, upd_time)
values (:s_id, 0, ':hin_cd', null, null, 0, 0, ':login_id', now(), ':login_id', now())



