create or replace procedure delete_date
(
applycode varchar2 --输入参数
)
as
applycode_var varchar2(100);
instanceid_var varchar2(100);
t_ywsloid_var varchar2(100);
Entity_GDBoid_var varchar2(100);
begin
applycode_var:=applycode;
--查出 工作流实例
select Instanceid into instanceid_var from t_ywsl where applycode=applycode_var;
--删除 工作流实例对应的任务表(待办和已办)
delete from AssignTask where AssignTasK.Instanceid=instanceid_var;
commit;
--查询业务受理oid
select t_ywsloid into t_ywsloid_var from t_ywsl where applycode=applycode_var;
--找出对应的供地表的OID
select Entity_GDBoid into Entity_GDBoid_var from Entity_GDB where T_YWSL_FK=t_ywsloid_var;
--循环删除对应的左边范围
for L_RECORD in (select Entity_DKLBoid from Entity_DKLB where Entity_GDB_FK=Entity_GDBoid_var)
loop
delete from Entity_ZBFW where Entity_DKLB_FK=L_RECORD.Entity_DKLBoid;
commit;
end loop;
--删除对应的地块列表
delete from Entity_DKLB where Entity_GDB_FK=Entity_GDBoid_var;
commit;
--删除对应的附件管理
delete from Entity_FJGL where T_YWSL_FK=t_ywsloid_var;
commit;
--删除宗地来源
delete from Entity_ZDLY where Entity_GDB_FK=Entity_GDBoid_var;
commit;
--删除划拨土地价款支付情况
delete from Entity_TDJKZFQK where Entity_GDB_FK=Entity_GDBoid_var;
commit;
--删除供地表(供地方案会审表、及各类型供地表)
delete from Entity_GDB where T_YWSL_FK=t_ywsloid_var;
commit;
--流程意见
--工作流实例记录本
delete from FlowInstance where Instanceid=instanceid_var;
commit;
--活动转移条件集
for L_RECORD in (select TaskTicketoid from TaskTicket where Instanceid=instanceid_var)
loop
delete from TransConditionEx where TaskTicket_FK=L_RECORD.TASKTICKETOID;
commit;
end loop;
--任务表
delete from TaskTicket where Instanceid=instanceid_var;
commit;
--业务受理表
delete from t_ywsl where applycode=applycode_var;
commit;
end;