--api/Corporate/CorpCommonSetWaitDoc

--{"applNo":"CA00039-210316-00001","appstate":996,"wDoctyp":"02","remark":"ทดสอบ WD  ส่วนสนับสนุน","CreateBy":"user540606"}

--exec usp_CorpCommonSetWaitDoc 'CA00039-210316-00001' , 996 , '02' , 'ทดสอบ WD  ส่วนสนับสนุน99' , 'user540606' ,'localhost'

--api/Corporate/CorpCommonCheckHoldFlag
--{"applNo":"CA00039-210316-00001"}
--api/PreApplication/GetListPreApplicationForPage
--{"Application_State":560,"FrmMain_MKTUserID":"user530467","Page":1,"RecInPage":10,"search":""}


--- ส่งงานออก ถ้าจะปลด waiting doc---
--/api/Corporate/CorpCommonSetWaitDoc
--{"applNo":"CA00039-210316-00001","appstate":996,"CreateBy":"user530467","wDoctyp":98}


declare @app nvarchar(20)='CA00039-210316-00001'

select  curEmpNo,applNo,curUsrId,curActorName,appState,startTime,endTime,slaStartTime from CBMSAPP210 where  applNo=@app  and endTime is null
order by startTime desc


/*  todo list

exec [usp_GetListPreApplicationForPage]
@FrmMain_MKTUserID ='user540606'
,@Page				=1
,@RecInPage		=10
,@Application_State =561
,@search			= NULL 
*/



