insert into t_fzss_zhxz_file (id, geom, from_type, create_time,area) values (#{id}, public.st_geomfromewkt(#{geom}), #{from_type}, now(),public.st_area(public.st_geomfromewkt(#{geom})::public.geography)) delete from t_fzss_hgxfx_scx where kzxjb > 2 insert into t_fzss_hgxfx_scx (bsm,ysdm,ysmc,sjy,kzxjb,xssx,tjzd, status ) -- select to_char(t.layername) bsm, -- '202400000000' ysdm, -- to_char(t.layeralias) ysmc, -- to_char(t.source) sjy, -- ( select (select * from (select to_number(bsm) from t_yzt_zyml -- start with bsm = o.bsm -- connect by prior pbsm = bsm order by pbsm desc) where 1 >= rownum) -- from t_yzt_zyml o where o.bsm = m.bsm) kzxjb, -- rownum xssx, -- ( select (select * from (select name from t_yzt_zyml -- start with bsm = o.bsm -- connect by prior pbsm = bsm order by pbsm desc) where 1 >= rownum) -- from t_yzt_zyml o where o.bsm = m.bsm) tjzd, -- '1' status -- from t_yzt_db_layer t -- left join t_yzt_zyml m -- on m.sde = t.id -- where t.id in (select distinct(sde) from t_yzt_zyml) -- union all select to_char(substr(t.sde,INSTR(t.sde,'.') + 1)) bsm, '202400000000' ysdm, to_char(t.name) ysmc, to_char(t.sde) sjy, ( select (select * from (select to_number(bsm) from t_yzt_zyml start with bsm = o.bsm connect by prior pbsm = bsm order by pbsm desc) where 1 >= rownum) from t_yzt_zyml o where o.bsm = t.bsm) kzxjb, rownum xssx, ( select (select * from (select name from t_yzt_zyml start with bsm = o.bsm connect by prior pbsm = bsm order by pbsm desc) where 1 >= rownum) from t_yzt_zyml o where o.bsm = t.bsm) tjzd, '1' status from t_yzt_zyml t where t.sde like '%.%' and t.parent = '0'