CommandText=@"MERGE INTO essen_customer WITH(HOLDLOCK) as target USING(select * from essen_customer a where a.customer_id=@customer_id) as source (customer_id,request_customer_id)
CommandText=@"delete from essen_request_info where request_id=@request_id;"
on(target.customer_id = source.customer_id )
WHEN MATCHED THEN UPDATE SET request_customer_id = @request_customer_id
WHEN NOT MATCHED THEN INSERT(customer_id,request_customer_id)
,StepType_id =(select id from esn_todos_Flow_StepType a where a.Map_Class='HR') output INSERTED.id INTO @TempTable where esn_todos_sn =@SN{0};
,StepType_id =(select id from esn_todos_Flow_StepType a where a.Map_Class='HR') output INSERTED.id INTO @TempTable where esn_todos_sn =@SN{0};
select @FlowId=id from @TempTable;
select @FlowId=id from @TempTable;
insert into esn_todos_Flow_his(Flow_id,ConfirmTime,FromType_id,ToType_id,ConfirmUserId,ConfirmUserClass,ConfirmMethod,Description,Create_User_id,Create_time)
insert into esn_todos_Flow_his(Flow_id,ConfirmTime,FromType_id,ToType_id,ConfirmUserId,ConfirmUserClass,ConfirmMethod,Description,Create_User_id,Create_time)
select id as Flow_id,GETDATE(),a.StepType_id_Previous,StepType_id,@gWadeID,'HR','SL','結算日期:' + @valueText,@gWadeID,GETDATE() from esn_todos_Flow a where a.id=@FlowId;
select id as Flow_id,GETDATE(),a.StepType_id_Previous,StepType_id,@gWadeID,'HR','SL','結算日期:' + @value,@gWadeID,GETDATE() from esn_todos_Flow a where a.id=@FlowId;