
insert into ur_sys_dw (ver_id,dw_id,dw_type,dw_code,dw_name,p_code,l_code,crt_user_id,crt_date,
upd_time,bmfl_code,xzjc_code,credit_no) 
select '***',dw.dw_code||'434','1',dw.dw_code||'434','人民政府',dw.dw_code,dw.l_code||'4340',
'*','2011-06-30','2011-06-30 00:00:00','0103',dw.xzjc_code, '434'
from ur_sys_dw dw where length(dw.dw_code)=9 and dw.xzjc_code in ('51','52','53') 
and not exists(select 1 from ur_sys_dw xzbm where xzbm.dw_code=dw.dw_code||'434' 
and length(xzbm.dw_code)=12 and xzbm.credit_no='434')
and (exists(select 1 from UR_DA_ZJZW_01 zjzw where dw.dw_id=zjzw.dw)
or exists(select 1 from ur_da_dwxx_01 dwxx where dw.dw_id=dwxx.dw));


insert into ur_sys_dw (ver_id,dw_id,dw_type,dw_code,dw_name,p_code,l_code,crt_user_id,crt_date,
upd_time,bmfl_code,xzjc_code,credit_no) 
select '***',dw.dw_code||'434001','1',dw.dw_code||'434001',dw.dw_name||'人民政府',dw.dw_code||'434',dw.l_code||'43400001',
'*','2011-06-30','2011-06-30 00:00:00','0103',dw.xzjc_code, '434'
from ur_sys_dw dw where length(dw.dw_code)=9 and dw.xzjc_code in ('51','52','53') 
and not exists(select 1 from ur_sys_dw xzdw where xzdw.dw_code=dw.dw_code||'434001' 
and length(xzdw.dw_code)=15 and xzdw.credit_no='434')
and (exists(select 1 from UR_DA_ZJZW_01 zjzw where dw.dw_id=zjzw.dw)
or exists(select 1 from ur_da_dwxx_01 dwxx where dw.dw_id=dwxx.dw));


delete from UR_TASK_DW  
where   exists (select dw from (select xz.dw_id as dw from ur_sys_dw xz,ur_sys_dw xzdw where  length(xz.dw_code)=9 
and xz.xzjc_code in ('51','52','53') and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='*'
) xz where  xz.dw=dw_id) and task_id  in ('A78565FB0F59464F9E6550C15115E41E','C576BF58AAC144E2B905A961F006681F',
'24641D70878B4E05B403F68DBDD9A44B','15B938E9CB0348179394DC0E5D266557','5EB008FC2CA24C0FBBC829A0D83B9268');
delete from UR_TASK_DW_RPT 
where   exists (select dw from (select xz.dw_id as dw from ur_sys_dw xz,ur_sys_dw xzdw where  length(xz.dw_code)=9 
and xz.xzjc_code in ('51','52','53') and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='*'
) xz where  xz.dw=dw_id) and task_id  in ('A78565FB0F59464F9E6550C15115E41E','C576BF58AAC144E2B905A961F006681F',
'24641D70878B4E05B403F68DBDD9A44B','15B938E9CB0348179394DC0E5D266557','5EB008FC2CA24C0FBBC829A0D83B9268');
delete from UR_TASK_DW_RPT_CHK 
where   exists (select dw from (select xz.dw_id as dw from ur_sys_dw xz,ur_sys_dw xzdw where  length(xz.dw_code)=9 
and xz.xzjc_code in ('51','52','53') and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='*'
) xz where  xz.dw=dw_id) and task_id  in ('A78565FB0F59464F9E6550C15115E41E','C576BF58AAC144E2B905A961F006681F',
'24641D70878B4E05B403F68DBDD9A44B','15B938E9CB0348179394DC0E5D266557','5EB008FC2CA24C0FBBC829A0D83B9268');
delete from UR_TASK_DW_RPT_CHK_REASON 
where   exists (select dw from (select xz.dw_id as dw from ur_sys_dw xz,ur_sys_dw xzdw where  length(xz.dw_code)=9 
and xz.xzjc_code in ('51','52','53') and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='*'
) xz where  xz.dw=dw_id) and task_id  in ('A78565FB0F59464F9E6550C15115E41E','C576BF58AAC144E2B905A961F006681F',
'24641D70878B4E05B403F68DBDD9A44B','15B938E9CB0348179394DC0E5D266557','5EB008FC2CA24C0FBBC829A0D83B9268');


delete from  UR_DA_DWXX_01 
where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw where dw=xz.dw_id and length(xz.dw_code)=9 
and xz.xzjc_code in ('51','52','53') and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='*');

delete from  UR_DA_ZCFZB_XZ_01 
where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw where dw=xz.dw_id and length(xz.dw_code)=9 
and xz.xzjc_code in ('51','52','53') and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='*');
delete from  UR_DA_ZCFZB_SY_01 
where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw where dw=xz.dw_id and length(xz.dw_code)=9 
and xz.xzjc_code in ('51','52','53') and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='*');
delete from  UR_DA_ZCFZB_GS_01 
where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw where dw=xz.dw_id and length(xz.dw_code)=9 
and xz.xzjc_code in ('51','52','53') and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='*');
delete from  UR_DA_LRB_01 
where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw where dw=xz.dw_id and length(xz.dw_code)=9 
and xz.xzjc_code in ('51','52','53') and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='*');
delete from  UR_DA_XJLLB_01 
where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw where dw=xz.dw_id and length(xz.dw_code)=9 
and xz.xzjc_code in ('51','52','53') and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='*');
delete from  UR_DA_SYZQY_01 
where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw where dw=xz.dw_id and length(xz.dw_code)=9 
and xz.xzjc_code in ('51','52','53') and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='*');
delete from  UR_DA_SYZQY_02 
where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw where dw=xz.dw_id and length(xz.dw_code)=9 
and xz.xzjc_code in ('51','52','53') and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='*');
delete from  UR_DA_SZZB_XZ_01 
where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw where dw=xz.dw_id and length(xz.dw_code)=9 
and xz.xzjc_code in ('51','52','53') and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='*');
delete from  UR_DA_SZZB_SY_01 
where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw where dw=xz.dw_id and length(xz.dw_code)=9 
and xz.xzjc_code in ('51','52','53') and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='*');

delete from  UR_DA_ZCGC_01 
where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw where dw=xz.dw_id and length(xz.dw_code)=9 
and xz.xzjc_code in ('51','52','53') and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='*');

delete from  UR_DA_ZCXGZ_01 
where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw where dw=xz.dw_id and length(xz.dw_code)=9 
and xz.xzjc_code in ('51','52','53') and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='*');
delete from  UR_DA_SDHHJ_01 
where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw where dw=xz.dw_id and length(xz.dw_code)=9 
and xz.xzjc_code in ('51','52','53') and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='*');
delete from  UR_DA_TQGZ_01 
where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw where dw=xz.dw_id and length(xz.dw_code)=9 
and xz.xzjc_code in ('51','52','53') and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='*');


update UR_TASK_DW set dw_id = 
(select dw from(select xzdw.dw_id as dw,xz.dw_id as xz_id  from ur_sys_dw xzdw,ur_sys_dw xz 
where xzdw.dw_code=xz.dw_code||'434001' and length(xz.dw_code)=9) xzdw where dw_id=xzdw.xz_id )
where  exists (select dw from(select dw.dw_id as dw from ur_sys_dw dw where length(dw.dw_code)=9 and 
dw.xzjc_code in ('51','52','53')) xz where xz.dw=dw_id) and task_id  in ('19B24A779FBB4EDA9F5FE029B0E41923',
'A2978165DD63470ABCBAB215ED8A1C42','082A6FFDB766473B89B059F7C8A988EB','DBA1CCC9CA2B4E55887DCB697316AA82');
update UR_TASK_DW_RPT set dw_id = 
(select dw from(select xzdw.dw_id as dw,xz.dw_id as xz_id  from ur_sys_dw xzdw,ur_sys_dw xz 
where xzdw.dw_code=xz.dw_code||'434001' and length(xz.dw_code)=9) xzdw where dw_id=xzdw.xz_id )
where  exists (select dw from(select dw.dw_id as dw from ur_sys_dw dw where length(dw.dw_code)=9 and 
dw.xzjc_code in ('51','52','53')) xz where xz.dw=dw_id) and task_id  in ('19B24A779FBB4EDA9F5FE029B0E41923',
'A2978165DD63470ABCBAB215ED8A1C42','082A6FFDB766473B89B059F7C8A988EB','DBA1CCC9CA2B4E55887DCB697316AA82');
update UR_TASK_DW_RPT_CHK set dw_id = 
(select dw from(select xzdw.dw_id as dw,xz.dw_id as xz_id  from ur_sys_dw xzdw,ur_sys_dw xz 
where xzdw.dw_code=xz.dw_code||'434001' and length(xz.dw_code)=9) xzdw where dw_id=xzdw.xz_id )
where  exists (select dw from(select dw.dw_id as dw from ur_sys_dw dw where length(dw.dw_code)=9 and 
dw.xzjc_code in ('51','52','53')) xz where xz.dw=dw_id) and task_id  in ('19B24A779FBB4EDA9F5FE029B0E41923',
'A2978165DD63470ABCBAB215ED8A1C42','082A6FFDB766473B89B059F7C8A988EB','DBA1CCC9CA2B4E55887DCB697316AA82');
update UR_TASK_DW_RPT_CHK_REASON set dw_id = 
(select dw from(select xzdw.dw_id as dw,xz.dw_id as xz_id  from ur_sys_dw xzdw,ur_sys_dw xz 
where xzdw.dw_code=xz.dw_code||'434001' and length(xz.dw_code)=9) xzdw where dw_id=xzdw.xz_id )
where  exists (select dw from(select dw.dw_id as dw from ur_sys_dw dw where length(dw.dw_code)=9 and 
dw.xzjc_code in ('51','52','53')) xz where xz.dw=dw_id) and task_id  in ('19B24A779FBB4EDA9F5FE029B0E41923',
'A2978165DD63470ABCBAB215ED8A1C42','082A6FFDB766473B89B059F7C8A988EB','DBA1CCC9CA2B4E55887DCB697316AA82');


update UR_TASK_DW set dw_id = 
(select dw from(select xzdw.dw_id as dw,xz.dw_id as xz_id  from ur_sys_dw xzdw,ur_sys_dw xz 
where xzdw.dw_code=xz.dw_code||'434001' and length(xz.dw_code)=9) xzdw where dw_id=xzdw.xz_id )
where   exists (select dw from(select xz.dw_id as dw from ur_sys_dw xz,ur_sys_dw xzdw where  length(xz.dw_code)=9 
and xz.xzjc_code in ('51','52','53') and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='***') xz
where xz.dw=dw_id) and task_id  in ('A78565FB0F59464F9E6550C15115E41E','C576BF58AAC144E2B905A961F006681F',
'24641D70878B4E05B403F68DBDD9A44B','15B938E9CB0348179394DC0E5D266557','5EB008FC2CA24C0FBBC829A0D83B9268');
update UR_TASK_DW_RPT set dw_id = 
(select dw from(select xzdw.dw_id as dw,xz.dw_id as xz_id  from ur_sys_dw xzdw,ur_sys_dw xz 
where xzdw.dw_code=xz.dw_code||'434001' and length(xz.dw_code)=9) xzdw where dw_id=xzdw.xz_id )
where   exists (select dw from(select xz.dw_id as dw from ur_sys_dw xz,ur_sys_dw xzdw where  length(xz.dw_code)=9 
and xz.xzjc_code in ('51','52','53') and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='***') xz
where xz.dw=dw_id) and task_id  in ('A78565FB0F59464F9E6550C15115E41E','C576BF58AAC144E2B905A961F006681F',
'24641D70878B4E05B403F68DBDD9A44B','15B938E9CB0348179394DC0E5D266557','5EB008FC2CA24C0FBBC829A0D83B9268');
update UR_TASK_DW_RPT_CHK set dw_id = 
(select dw from(select xzdw.dw_id as dw,xz.dw_id as xz_id  from ur_sys_dw xzdw,ur_sys_dw xz 
where xzdw.dw_code=xz.dw_code||'434001' and length(xz.dw_code)=9) xzdw where dw_id=xzdw.xz_id )
where   exists (select dw from(select xz.dw_id as dw from ur_sys_dw xz,ur_sys_dw xzdw where  length(xz.dw_code)=9 
and xz.xzjc_code in ('51','52','53') and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='***') xz
where xz.dw=dw_id) and task_id  in ('A78565FB0F59464F9E6550C15115E41E','C576BF58AAC144E2B905A961F006681F',
'24641D70878B4E05B403F68DBDD9A44B','15B938E9CB0348179394DC0E5D266557','5EB008FC2CA24C0FBBC829A0D83B9268');
update UR_TASK_DW_RPT_CHK_REASON set dw_id = 
(select dw from(select xzdw.dw_id as dw,xz.dw_id as xz_id  from ur_sys_dw xzdw,ur_sys_dw xz 
where xzdw.dw_code=xz.dw_code||'434001' and length(xz.dw_code)=9) xzdw where dw_id=xzdw.xz_id )
where   exists (select dw from(select xz.dw_id as dw from ur_sys_dw xz,ur_sys_dw xzdw where  length(xz.dw_code)=9 
and xz.xzjc_code in ('51','52','53') and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='***') xz
where xz.dw=dw_id) and task_id  in ('A78565FB0F59464F9E6550C15115E41E','C576BF58AAC144E2B905A961F006681F',
'24641D70878B4E05B403F68DBDD9A44B','15B938E9CB0348179394DC0E5D266557','5EB008FC2CA24C0FBBC829A0D83B9268');


update UR_DA_ZJZW_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz where dw=xz.dw_id 
and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53'));
update UR_DA_GCXMXX_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz where dw=xz.dw_id 
and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53'));
update UR_DA_GCXMXX_02 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz where dw=xz.dw_id 
and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53'));
update UR_DA_JJXX_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz where dw=xz.dw_id 
and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53'));
update UR_DA_JJXX_02 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz where dw=xz.dw_id 
and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53'));
update UR_DA_HKJH_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz where dw=xz.dw_id 
and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53'));
update UR_DA_HKJH_02 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz where dw=xz.dw_id 
and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53'));
update UR_DA_CHBJ_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz where dw=xz.dw_id 
and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53'));
update UR_DA_CHBJ_02 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz where dw=xz.dw_id 
and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53'));
update UR_DA_ZFLXFX_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz where dw=xz.dw_id 
and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53'));
update UR_DA_ZFLXFX_02 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz where dw=xz.dw_id 
and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53'));
update UR_DA_ZFFY_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz where dw=xz.dw_id 
and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53'));
update UR_DA_ZFFY_02 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz where dw=xz.dw_id 
and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53'));
update UR_DA_ZCXX_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz where dw=xz.dw_id 
and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53'));
update UR_DA_ZCXX_02 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz where dw=xz.dw_id 
and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53'));

update UR_DA_DBZW_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz where dw=xz.dw_id 
and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53'));

update UR_DA_ZDZW_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz where dw=xz.dw_id 
and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53'));
update UR_DA_ZDZWZC_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz where dw=xz.dw_id 
and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53'));
update UR_DA_ZDZWZC_02 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz where dw=xz.dw_id 
and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53'));
update UR_DA_ZDZW_SHBX_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz where dw=xz.dw_id 
and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53'));
update UR_DA_ZDZW_SHBX_02 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz where dw=xz.dw_id 
and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53'));

update UR_DA_GCXM_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz where dw=xz.dw_id 
and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53'));


update UR_DA_DWXX_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw 
where dw=xz.dw_id and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53') 
and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='***');

update UR_DA_ZCFZB_XZ_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw 
where dw=xz.dw_id and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53') 
and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='***');
update UR_DA_ZCFZB_SY_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw 
where dw=xz.dw_id and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53') 
and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='***');
update UR_DA_ZCFZB_GS_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw 
where dw=xz.dw_id and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53') 
and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='***');
update UR_DA_LRB_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw 
where dw=xz.dw_id and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53') 
and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='***');
update UR_DA_XJLLB_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw 
where dw=xz.dw_id and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53') 
and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='***');
update UR_DA_SYZQY_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw 
where dw=xz.dw_id and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53') 
and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='***');
update UR_DA_SYZQY_02 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw 
where dw=xz.dw_id and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53') 
and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='***');
update UR_DA_SZZB_XZ_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw 
where dw=xz.dw_id and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53') 
and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='***');
update UR_DA_SZZB_SY_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw 
where dw=xz.dw_id and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53') 
and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='***');

update UR_DA_ZCGC_01  set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw 
where dw=xz.dw_id and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53') 
and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='***');

update UR_DA_ZCXGZ_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw 
where dw=xz.dw_id and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53') 
and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='***');
update UR_DA_SDHHJ_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw 
where dw=xz.dw_id and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53') 
and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='***');
update UR_DA_TQGZ_01 set dw = 
(select xzdw.dw_id from ur_sys_dw xzdw,ur_sys_dw xz where xzdw.dw_code=xz.dw_code||'434001' 
and length(xz.dw_code)=9 and dw=xz.dw_id ) where  exists (select 1 from ur_sys_dw xz,ur_sys_dw xzdw 
where dw=xz.dw_id and length(xz.dw_code)=9 and xz.xzjc_code in ('51','52','53') 
and xzdw.dw_code=xz.dw_code||'434001' and xzdw.ver_id='***');


update ur_sys_dw set ver_id='*' where ver_id='***';

