[load_grdList]
select
	 m22.han_cd as auth_kbn
	,m22.han_name as option_keiyaku
	,m22.han_name || '/' || m21.han_name as koutei_koumoku
	,m22.han_cd || '/' || m21.han_cd as han_cd
	--,m21.han_name as koutei_koumoku
	,m23.koumoku3 as nissu
from m_hanyo m22
left join m_hanyo m21 on (m21.mst_kbn = '21')
left join m_hanyo m23 on (m23.han_cd = m22.han_cd || '/' || m21.han_cd)
where 1=1
and m22.mst_kbn = '22'
and m22.han_cd = ':auth_kbn'
order by m22.han_cd || '/' || m21.han_cd 

[existKengen]
select
	  m1.kino_id
	, m1.kino_nm
	, (case when(m2.kino_id is not null)then(1)else(0) end) as checkbox
from v_kino m1
left join m_kengen m2 on (m2.auth_kbn = '98' and m2.kino_id = m1.kino_id)
where 1=1
;

[updateBeforeChecked]
delete from m_hanyo
where mst_kbn = '23'
and koumoku1 = ':koumoku1'

[updateRecord]
insert into m_hanyo
	(mst_kbn, han_cd, han_name, koumoku1, koumoku2, koumoku3, sort_key, del_flg, cre_id, cre_time, upd_id, upd_time)
values
	('23', ':han_cd', ':koutei_koumoku', ':koumoku1', ':koumoku2', ':nissu', ':han_cd', 0, ':login_id', now(), ':login_id', now());


