[selectRecords]
select 
	uh.den_no,
	(1+um.row_no) as row_no,
	to_char(to_date(uh.input_ymd, 'YYYYMMDD'), 'yyyy/mm/dd') as input_ymd,
	to_char(to_date(uh.syori_ymd, 'YYYYMMDD'), 'yyyy/mm/dd') as syori_ymd,
	uh.zeinuki_gaku,
	uh.zei_gaku,
	uh.zeikomi_gaku,
	um.hin_cd,
	replace(um.hin_nm,chr(10),'')as hin_nm,
	um.suryo,
	um.tanka,
	um.kingaku,
	uh.tok_cd,
	t.tok_nm,
	t.addr1,
	t.addr2,
	t.addr3,
	t.addr4,
	t.tori_cond,
	t.biko1,
	t.biko2,
	t.biko3,
	t.biko4
from t_uri uh
left join m_tokui t on(uh.tok_cd = t.tok_cd)
left join t_uri_m um on(uh.den_no = um.den_no)
where 1 = 1
and ((uh.syori_ymd >= '&1') or ('&1' = ''))
and ((uh.syori_ymd <= '&2') or ('&2' = ''))
and ((cast(uh.den_no as char(6)) = '&3') or ('&3' = ''))
and ((uh.tok_cd = '&4') or ('&4' = ''))
and ((um.hin_nm like '%&5%') or ('&5' = ''))
order by uh.den_no,um.row_no;

