update afr3123
set kbat=:kbat,
	sts='3',
	hpno=0,
	kpno=0,
	zpno=nvl(zpno,0)+nvl(mvpno,0),
	skpno=mvpno,
	ddat=case when nvl(ddat,nvl(to_date(:ddat, 'yyyy/mm/dd'),climit))<to_date(:sdday, 'yyyy/mm/dd') then to_date(:sdday, 'yyyy/mm/dd')+1 else nvl(ddat,nvl(to_date(:ddat, 'yyyy/mm/dd'),climit)) end,
	vdat=to_date(:sdday, 'yyyy/mm/dd'),
	sdat=to_date(:sdday, 'yyyy/mm/dd'),
	jend=null,
	otsts=decode(:syflg,1,' ',null)
where iseq=:iseq3123
