123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.onemap.apply.mapper.fzss.HgxfxMapper">
- <select id="GetPage" parameterType="java.lang.String" resultType="com.onemap.apply.domain.config.fzss.HgxfxDTO">
- select t.bsm as "bsm",
- t.fxmj as "fxmj",
- t.xmmc as "xmmc",
- t.xmlx as "xmlx",
- t.jsdw as "jsdw",
- t.ydxz_bsm as "ydxz_bsm",
- t.fxbg as "fxbg",
- t.rwzt as "rwzt",
- t.cjsj as "cjsj",
- public.st_asewkt(t1.geom) AS geom
- from t_fzss_hgxfx t
- left join t_fzss_zhxz_file t1 on t1.id = t.xzfw
- where t.scsj is null
- <if test="kssj != null and kssj != ''">
- and t.cjsj >= to_date(#{kssj}, 'yyyy-MM-dd hh24:mi:ss')
- </if>
- <if test="jssj != null and jssj != ''">
- and t.cjsj <= to_date(#{jssj}, 'yyyy-MM-dd hh24:mi:ss')
- </if>
- <if test="xmmc != null and xmmc != ''">
- and t.xmmc like '%'||#{xmmc}||'%'
- </if>
- <if test="username != null and username != ''">
- and t.cjyh = #{username}
- </if>
- order by t.cjsj is null,t.cjsj desc
- </select>
- <insert id="insertXzfw">
- 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))
- </insert>
- <select id="getXzfw" parameterType="java.lang.String" resultType="map">
- SELECT id,
- public.st_asewkt(geom) AS geom,
- area,
- create_time
- FROM t_fzss_zhxz_file
- WHERE id = #{id}
- </select>
- <select id="getJcxs" parameterType="java.lang.String" resultType="com.onemap.apply.domain.config.fzss.HgxfxJcxsDTO">
- select t.bsm as "bsm",
- t.rwbsm as "rwbsm",
- t.scxbsm as "scxbsm",
- t.zdmj as "zdmj",
- t.jcjg as "jcjg",
- scx.kzxjb as "kzxjb",
- case when scx.kzxjb = 1 then '一级控制线'
- when scx.kzxjb = 2 then '二级控制线'
- else scx.tjzd end as "classify",
- scx.ysmc as "ysmc" from t_fzss_hgxfx_hgscx t
- left join t_fzss_hgxfx_scx scx on scx.bsm = t.scxbsm
- where t.rwbsm = #{bsm} and scx.kzxjb > 0
- order by scx.kzxjb
- </select>
- <select id="getFxtb" parameterType="java.lang.String" resultType="com.onemap.apply.domain.config.fzss.HgxfxFxtbDTO">
- select xz.ydyhfldm as "dldm2",
- xz.ydyhflmc as "dlmc2",
- (select d.dldm from t_dict_dldm d where d.fzbs = 'GH' and d.dldm = substr(xz.ydyhfldm,0,2)) as "dldm1",
- (select d.dlmc from t_dict_dldm d where d.fzbs = 'GH' and d.dldm = substr(xz.ydyhfldm,0,2)) as "dlmc1",
- sum(t.yzmj) as "yzmj",
- sum(xz.mj) as "mj"
- from (select * from t_fzss_hgxfx_jg_gis t where t.scxbsm = (select hgscx.bsm from t_fzss_hgxfx_hgscx hgscx left join t_fzss_hgxfx_scx scx on scx.bsm = hgscx.scxbsm where scx.kzxjb = 0
- and hgscx.rwbsm = #{bsm})) t
- inner join (select * from sde.xzydyh x where x.objectid in (select objid from t_fzss_hgxfx_jg_gis gis where gis.scxbsm = (select hgscx.bsm from t_fzss_hgxfx_hgscx hgscx left join t_fzss_hgxfx_scx scx on scx.bsm = hgscx.scxbsm where scx.kzxjb = 0
- and hgscx.rwbsm = #{bsm}))
- ) xz on xz.objectid = t.objid
- group by xz.ydyhfldm,xz.ydyhflmc
- order by xz.ydyhfldm
- </select>
- <select id="getScrwCount" resultType="java.lang.Integer">
- select count(1) count from t_fzss_hgxfx t where 1 >= t.rwzt
- </select>
- <delete id="deleteResourceScx">
- delete from t_fzss_hgxfx_scx where kzxjb > 2
- </delete>
- <insert id="unionResourceScx">
- 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'
- </insert>
- </mapper>
|