2
13693261870
2022-09-16 653761a31dfeb50dd3d007e892d69c90bf0cdafc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<?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>