<?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.landtool.lanbase.modules.res.dao.ZhuanTiZhiTuMapper" >
|
<sql id="Base_Column_List" >
|
CATLOGID, CATLOGCODE, PARENTID, TITLE, PINGYINFIIRST, DESCRIPTION, IMGURL, ORDERID,
|
CREATEUSER, CREATEDATE, REMARK
|
</sql>
|
<!--专题制图 - 底图切换 - 获取底图列表-->
|
<select id="getBaseMapList" resultType="com.landtool.lanbase.modules.res.entity.UserDefined.UserDef_BaseMap">
|
with t as
|
(select row_number() over(partition by RESOURCEID order by ORDERID asc, URLID desc) rn,
|
RESOURCEID,
|
SERVERURL
|
from RES_EXTMAPURL)
|
|
select b.RESOURCEID,
|
b.TITLE,
|
b.IMGURL,
|
b.ESPPROXY,
|
b.token,
|
b.sharprotocol,
|
a.REFMARKINFID,
|
t.SERVERURL
|
from RES_EXTBASEMAP a
|
left join RES_MAININFO b
|
on a.RESOURCEID = b.RESOURCEID
|
left join t
|
on t.RESOURCEID = b.RESOURCEID
|
where t.rn = 1 and
|
RESOURCESTATUS = 0 and AUDITSTATUS = 2 --资源状态:正常,审核状态:审核通过
|
<if test="type == '矢量'">
|
and (a.BaseMapType = '矢量' or a.BaseMapType = '地形')
|
</if>
|
<if test="type == '低精'">
|
and a.BaseMapType = '影像' and a.Imageaccuracy = '低精'
|
</if>
|
<if test="type == '高精'">
|
and a.BaseMapType = '影像' and a.Imageaccuracy = '高精'
|
</if>
|
<if test="type == '其它'">
|
and a.BaseMapType != '矢量' and a.BaseMapType != '地形' and (a.BaseMapType = '影像' and a.Imageaccuracy not in('低精','高精')) and a.BaseMapType != '标注'
|
</if>
|
<if test="supportdynamic == true">
|
and a.SupportDynamic = 1
|
</if>
|
order by b.orderid
|
</select>
|
<!--专题制图 - 数据资源 - 获取我的制图-->
|
<select id="getWoDeZhiTu" resultType="com.landtool.lanbase.modules.res.entity.Res_MainInfo">
|
select a.ResourceId, a.Title from RES_MAININFO a
|
left join RES_EXTTHEMEMAP b on a.ResourceId = b.ResourceId
|
where a.ResourceClass = #{resourceClass} and a.CreateUserId = #{userId}
|
and b.MapJson is not null
|
and b.Type = '系统制作'
|
order by PubDate desc
|
</select>
|
<select id="getYWTCCataLogList" resultType="com.landtool.lanbase.modules.res.entity.Res_Catalog">
|
select distinct b.CATLOGID,b.CATLOGCODE,b.PARENTID,b.TITLE,b.PINGYINFIIRST,b.IMGURL,b.ORDERID,b.CREATEUSER,b.CREATEDATE,b.ICON
|
from RES_CATALOG b
|
left join (
|
SELECT CATLOGCODE
|
FROM RES_MAININFO a left join RES_EXTFILESOURCE c on a.RESOURCEID = c.RESOURCEID
|
<if test="iscollect != null and iscollect == 1">
|
left join RES_ACTIONRECORD b
|
on a.RESOURCEID = b.RESOURCEID where b.ACTIONTYPE = '收藏' and b.userid = #{userid}
|
</if>
|
<if test="iscollect == null">
|
where 1 = 1
|
</if>
|
and a.AUDITSTATUS = 2
|
and a.RESOURCESTATUS = 0
|
and (a.resourceclass='KJ_YWTC' or a.resourceclass='KJ_KJFX' or (a.resourceclass='SJWJ' and NCCONFIG is not null))
|
<if test="title!=null and title != '' ">
|
and (a.TITLE like '%' || #{title} || '%' OR replace(a.KEYWORDS,',','') like '%' || #{title} || '%')
|
</if>
|
<if test="pubdateBegin!=null and pubdateBegin != '' ">
|
and a.PUBDATE >= to_timestamp(#{pubdateBegin} || ' 00:00:00','yyyy-mm-dd hh24:mi:ss')
|
</if>
|
<if test="pubdatefinish!=null and pubdatefinish != '' ">
|
<![CDATA[ and a.PUBDATE <= to_timestamp(#{pubdatefinish} || ' 23:59:59','yyyy-mm-dd hh24:mi:ss') ]]>
|
</if>
|
<if test="createuserid!=null and createuserid != '' ">
|
and a.createuserid = #{createuserid,jdbcType=OTHER}
|
</if>
|
<if test="createuserid ==null and faburen!=null and faburen != '' ">
|
and createuserid in( ${faburen} )
|
</if>
|
and (
|
a.SHARPROTOCOL = '完全公开'
|
or (a.SHARPROTOCOL = '依申请公开' and CREATEUSERID = #{userid})
|
<if test="unitid != null and (unitid == 0 ? '0': unitid)">
|
or (a.SHARPROTOCOL = '单位内公开' and PUBUNITID = #{unitid})
|
</if>
|
or exists(
|
select * from RES_APPLYRECOMMEND b
|
where (
|
(b.APPTYPE = 0 and APPUSERID = #{userid})
|
<if test="unitid != null and (unitid == 0 ? '0': unitid)">
|
or (b.APPTYPE = 1 and APPUNITID = #{unitid})
|
</if>
|
and (b.EFFENDTIME is null or b.EFFENDTIME >= now())
|
and a.RESOURCEID = b.RESOURCEID
|
)
|
)
|
)
|
group by CATLOGCODE
|
) c on b.CATLOGCODE = substr(c.CATLOGCODE, 1, LENGTH(b.CATLOGCODE))
|
where parentid = #{parentid} and c.CATLOGCODE is not null
|
order by ORDERID
|
</select>
|
|
<select id="getCatalogZiYuanList" resultType="com.landtool.lanbase.modules.res.entity.Res_MainInfo">
|
select distinct a.RESOURCEID,a.CATLOGID, a.TITLE,
|
a.ABBREVIATION, a.PINGYINFIIRST, a.CATLOGCODE,
|
a.KEYWORDS, a.DESURL,
|
a.IMGURL, a.RESOURCECLASS,
|
a.DATASOURCES, a.PRODUCTIONTIME,
|
a.UPDATETIMES, a.PUBDATE, a.PUBUNITID,
|
a.CREATEUSERID, a.ADMINISTRATIVEID, a.SECURITYLEV,
|
a.SHARPROTOCOL, a.ESPPROXY, a.USERNAME,
|
a.PASSWORD, a.RESOURCESTATUS,
|
a.AUDITSTATUS, a.DISPLAYBY2D, a.DISPLAYBY3D,
|
a.ORDERID from RES_MAININFO a
|
left join RES_EXTFILESOURCE c on a.RESOURCEID = c.RESOURCEID
|
<if test="iscollect != null and iscollect == 1">
|
left join RES_ACTIONRECORD b
|
on a.RESOURCEID = b.RESOURCEID where b.ACTIONTYPE = '收藏' and b.userid = #{userid}
|
</if>
|
<if test="iscollect == null">
|
where 1 = 1
|
</if>
|
<if test="title!=null and title != '' ">
|
and (a.TITLE like '%' || #{title} || '%' OR replace(a.KEYWORDS,',','') like '%' || #{title} || '%')
|
</if>
|
<if test="createuserid!=null and createuserid != '' ">
|
and a.createuserid = #{createuserid,jdbcType=OTHER}
|
</if>
|
<if test="createuserid ==null and faburen!=null and faburen != '' ">
|
and createuserid in( ${faburen} )
|
</if>
|
|
<if test="pubdateBegin!=null and pubdateBegin != '' ">
|
and a.PUBDATE >= to_timestamp(#{pubdateBegin} || ' 00:00:00','yyyy-mm-dd hh24:mi:ss')
|
</if>
|
<if test="pubdatefinish!=null and pubdatefinish != '' ">
|
<![CDATA[ and a.PUBDATE <= to_timestamp(#{pubdatefinish} || ' 23:59:59','yyyy-mm-dd hh24:mi:ss') ]]>
|
</if>
|
and a.AUDITSTATUS = 2
|
and a.RESOURCESTATUS = 0
|
and (a.resourceclass='KJ_YWTC' or a.resourceclass='KJ_KJFX' or (a.resourceclass='SJWJ' and NCCONFIG is not null))
|
and (
|
a.SHARPROTOCOL = '完全公开'
|
or (a.SHARPROTOCOL = '依申请公开' and CREATEUSERID = #{userid})
|
<if test="unitid != null and (unitid == 0 ? '0': unitid)">
|
or (a.SHARPROTOCOL = '单位内公开' and PUBUNITID = #{unitid})
|
</if>
|
or exists(
|
select * from RES_APPLYRECOMMEND b
|
where (
|
(b.APPTYPE = 0 and APPUSERID = #{userid})
|
<if test="unitid != null and (unitid == 0 ? '0': unitid)">
|
or (b.APPTYPE = 1 and APPUNITID = #{unitid})
|
</if>
|
and (b.EFFENDTIME is null or b.EFFENDTIME >= now())
|
and a.RESOURCEID = b.RESOURCEID
|
)
|
)
|
)
|
and a.CATLOGID = #{parentid,jdbcType=DECIMAL}
|
order by a.ORDERID
|
</select>
|
<select id="getSpaceServerList" resultType="com.landtool.lanbase.modules.res.entity.UserDefined.UserDef_SpaceServer">
|
select b.RESOURCEID, b.TITLE, b.IMGURL, a.serverurl,a.posttype,a.diyparamurl,b.sharprotocol,b.createuserid
|
from RES_EXTSPACESERVER a
|
left join RES_MAININFO b on a.RESOURCEID = b.RESOURCEID
|
where RESOURCESTATUS = 0 and AUDITSTATUS = 2 --资源状态:正常,审核状态:审核通过
|
<if test="userid != null and userid != ''">
|
and createuserid = ${userid}
|
</if>
|
order by b.orderid
|
</select>
|
</mapper>
|