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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<?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.Res_ExtBusinessLayerMapper" >
  <resultMap id="BaseResultMap" type="com.landtool.lanbase.modules.res.entity.Res_ExtBusinessLayer" >
    <id column="RESOURCEID" property="resourceid" jdbcType="DECIMAL" />
    <result column="PUBLISHSOFT" property="publishsoft" jdbcType="OTHER" />
    <result column="LAYERNAME" property="layername" jdbcType="OTHER" />
    <result column="DATALOADTYPE" property="dataloadtype" jdbcType="OTHER" />
    <result column="ADVANCEQUERYURL" property="advancequeryurl" jdbcType="OTHER" />
    <result column="DIYQUERYURL" property="diyqueryurl" jdbcType="OTHER" />
    <result column="DIYBUBBLEURL" property="diybubbleurl" jdbcType="OTHER" />
    <result column="SERVICECONFIG" property="ServiceConfig" jdbcType="VARCHAR" />
    <result column="SERVICEHTML" property="ServiceHTML" jdbcType="VARCHAR" />
    <result column="CACHE" property="Cache" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    RESOURCEID, PUBLISHSOFT, LAYERNAME, DATALOADTYPE, ADVANCEQUERYURL,
    DIYQUERYURL, DIYBUBBLEURL,SERVICECONFIG,SERVICEHTML,CACHE
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    from RES_EXTBUSINESSLAYER
    where RESOURCEID = #{resourceid,jdbcType=DECIMAL}
  </select>
 
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from RES_EXTBUSINESSLAYER
    where RESOURCEID = #{resourceid,jdbcType=DECIMAL}
  </delete>
  <insert id="insert" parameterType="com.landtool.lanbase.modules.res.entity.Res_ExtBusinessLayer" >
    insert into RES_EXTBUSINESSLAYER (RESOURCEID, PUBLISHSOFT,
      LAYERNAME, DATALOADTYPE,
      ADVANCEQUERYURL, DIYQUERYURL, DIYBUBBLEURL
      )
    values (#{resourceid,jdbcType=DECIMAL}, #{publishsoft,jdbcType=OTHER},
       #{layername,jdbcType=OTHER}, #{dataloadtype,jdbcType=OTHER},
      #{advancequeryurl,jdbcType=OTHER}, #{diyqueryurl,jdbcType=OTHER}, #{diybubbleurl,jdbcType=OTHER}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.landtool.lanbase.modules.res.entity.Res_ExtBusinessLayer" >
    insert into RES_EXTBUSINESSLAYER
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="resourceid != null" >
        RESOURCEID,
      </if>
      <if test="publishsoft != null" >
        PUBLISHSOFT,
      </if>
      <if test="layername != null" >
        LAYERNAME,
      </if>
      <if test="dataloadtype != null" >
        DATALOADTYPE,
      </if>
      <if test="advancequeryurl != null" >
        ADVANCEQUERYURL,
      </if>
      <if test="diyqueryurl != null" >
        DIYQUERYURL,
      </if>
      <if test="diybubbleurl != null" >
        DIYBUBBLEURL,
      </if>
      <if test="Cache != null" >
        CACHE
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="resourceid != null" >
        #{resourceid,jdbcType=DECIMAL},
      </if>
      <if test="publishsoft != null" >
        #{publishsoft,jdbcType=OTHER},
      </if>
      <if test="layername != null" >
        #{layername,jdbcType=OTHER},
      </if>
      <if test="dataloadtype != null" >
        #{dataloadtype,jdbcType=OTHER},
      </if>
      <if test="advancequeryurl != null" >
        #{advancequeryurl,jdbcType=OTHER},
      </if>
      <if test="diyqueryurl != null" >
        #{diyqueryurl,jdbcType=OTHER},
      </if>
      <if test="diybubbleurl != null" >
        #{diybubbleurl,jdbcType=OTHER},
      </if>
    <if test="Cache != null" >
       #{Cache,jdbcType=OTHER},
    </if>
 
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.landtool.lanbase.modules.res.entity.Res_ExtBusinessLayer" >
    update RES_EXTBUSINESSLAYER
    <set >
      <if test="publishsoft != null" >
        PUBLISHSOFT = #{publishsoft,jdbcType=OTHER},
      </if>
      <if test="layername != null" >
        LAYERNAME = #{layername,jdbcType=OTHER},
      </if>
      <if test="dataloadtype != null" >
        DATALOADTYPE = #{dataloadtype,jdbcType=OTHER},
      </if>
      <if test="advancequeryurl != null" >
        ADVANCEQUERYURL = #{advancequeryurl,jdbcType=OTHER},
      </if>
      <if test="diyqueryurl != null" >
        DIYQUERYURL = #{diyqueryurl,jdbcType=OTHER},
      </if>
      <if test="diybubbleurl != null" >
        DIYBUBBLEURL = #{diybubbleurl,jdbcType=OTHER},
      </if>
      <if test="ServiceConfig != null" >
        ServiceConfig = #{ServiceConfig,jdbcType=OTHER},
      </if>
      <if test="ServiceHTML != null" >
        ServiceHTML = #{ServiceHTML,jdbcType=OTHER},
      </if>
      <if test="Cache != null" >
        Cache = #{Cache,jdbcType=OTHER},
      </if>
    </set>
    where RESOURCEID = #{resourceid,jdbcType=DECIMAL}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.landtool.lanbase.modules.res.entity.Res_ExtBusinessLayer" >
    update RES_EXTBUSINESSLAYER
    set PUBLISHSOFT = #{publishsoft,jdbcType=OTHER},
      LAYERNAME = #{layername,jdbcType=OTHER},
      DATALOADTYPE = #{dataloadtype,jdbcType=OTHER},
      ADVANCEQUERYURL = #{advancequeryurl,jdbcType=OTHER},
      DIYQUERYURL = #{diyqueryurl,jdbcType=OTHER},
      DIYBUBBLEURL = #{diybubbleurl,jdbcType=OTHER}
    where RESOURCEID = #{resourceid,jdbcType=DECIMAL}
  </update>
 
  <select id="selectBusinessLayerJoinMainInfoCount" parameterType="com.landtool.lanbase.modules.res.entity.Res_MainInfo" resultType="java.lang.Integer">
    select COUNT(*) from RES_EXTBUSINESSLAYER  a left join RES_MAININFO b on(a.RESOURCEID = b.RESOURCEID)
    <where>
      RESOURCESTATUS = 0 and AUDITSTATUS = 2
      <if test="title!=null and title != '' ">
        and b.TITLE like '%${title}%'
      </if>
      <if test="datasources !=null and datasources != '' ">
        and b.DATASOURCES=#{datasources,jdbcType=OTHER}
      </if>
    </where>
  </select>
 
  <select id="selectBusinessLayerJoinMainInfo" parameterType="com.landtool.lanbase.modules.res.entity.Res_MainInfo" resultType="com.landtool.lanbase.modules.res.entity.Res_MainInfo">
    select  b.TITLE,b.RESOURCEID,b.DATASOURCES from RES_EXTBUSINESSLAYER  a left join RES_MAININFO b on(a.RESOURCEID = b.RESOURCEID)
    <where>
      RESOURCESTATUS = 0 and AUDITSTATUS = 2
      <if test="title!=null and title != '' ">
        and b.TITLE like '%${title}%'
      </if>
      <if test="datasources !=null and datasources != '' ">
        and b.DATASOURCES = #{datasources,jdbcType=OTHER}
      </if>
    </where>
    order by b.RESOURCEID
  </select>
 
  <select id="selectBusinessLayerJoinMainInfoTree" resultType="com.landtool.lanbase.modules.res.entity.Res_MainInfo">
    select distinct b.TITLE,b.RESOURCEID,b.DATASOURCES,b.resourceclass,b.CATLOGID from RES_EXTBUSINESSLAYER  a left join RES_MAININFO b on(a.RESOURCEID = b.RESOURCEID)
    <where>
      RESOURCESTATUS = 0 and AUDITSTATUS = 2
      <if test="title!=null and title != '' ">
        and b.TITLE like '%${title}%'
      </if>
      <if test="datasources !=null and datasources != '' ">
        and b.DATASOURCES = #{datasources,jdbcType=OTHER}
      </if>
      <if test="parentid != null and parentid != ''">
        and b.CATLOGID = #{parentid}
      </if>
      <if test="keyWord != null and keyWord != ''">
        and (b.PINGYINFIIRST like '%'||#{keyWord}||'%' or b.TITLE like '%'||#{keyWord}||'%')
      </if>
    </where>
    order by b.RESOURCEID
  </select>
 
  <select id="selectBusinessLayerJoinMainInfoNode" 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 b.CATLOGCODE from RES_EXTBUSINESSLAYER a left join RES_MAININFO b on(a.RESOURCEID =
    b.RESOURCEID)
    where RESOURCESTATUS = 0 and AUDITSTATUS = 2
    <if test="title!=null and title != '' ">
      and b.TITLE like '%${title}%'
    </if>
    group by CATLOGCODE
    ) r on b.CATLOGCODE = substr(r.CATLOGCODE, 1, LENGTH(b.CATLOGCODE))
    where parentid = #{parentid} and r.CATLOGCODE is not null
    order by ORDERID
  </select>
 
  <select id="selectBusinessLayerList" resultType="com.landtool.lanbase.modules.res.entity.Res_MainInfo">
    select distinct  b.RESOURCEID,b.CATLOGID, b.TITLE,
    b.ABBREVIATION, b.PINGYINFIIRST, b.CATLOGCODE,
    b.KEYWORDS, b.DESURL,
    b.IMGURL, b.RESOURCECLASS,
    b.DATASOURCES, b.PRODUCTIONTIME,
    b.UPDATETIMES, b.PUBDATE, b.PUBUNITID,
    b.CREATEUSERID, b.ADMINISTRATIVEID, b.SECURITYLEV,
    b.SHARPROTOCOL, b.ESPPROXY, b.USERNAME,
    b.PASSWORD, b.RESOURCESTATUS,
    b.AUDITSTATUS, b.DISPLAYBY2D, b.DISPLAYBY3D,
    b.ORDERID from RES_EXTBUSINESSLAYER  a left join RES_MAININFO b on(a.RESOURCEID = b.RESOURCEID)
 
    <where>
      exists(select * from RES_EXTINTEGRATE t where INTEGRATETYPE = '数据集成' and t.resourceid=b.resourceid) or
      (b.AUDITSTATUS = 2 and b.RESOURCESTATUS = 0
      and (
      (b.SHARPROTOCOL = '依申请公开' and b.CREATEUSERID = #{userid})
      or (b.SHARPROTOCOL = '单位内公开' and b.PUBUNITID = #{unitid})
      or exists(
      select * from RES_APPLYRECOMMEND c
      where (
      (c.APPTYPE = 0 and APPUSERID = #{userid})
      or (c.APPTYPE = 1 and APPUNITID = #{unitid})
      )
      and (c.EFFENDTIME is null or c.EFFENDTIME >= now())
      and b.RESOURCEID = c.RESOURCEID
      )
      )
      )
      <if test="title!=null and title != '' ">
        and b.TITLE like '%${title}%'
      </if>
      <if test="datasources !=null and datasources != '' ">
        and b.DATASOURCES = #{datasources,jdbcType=OTHER}
      </if>
      <if test="selectids!=null and selectids != '' ">
        and b.RESOURCEID not in (${selectids})
      </if>
      <if test="parentid != null and parentid != ''">
      and b.CATLOGID = #{parentid}
      </if>
      <if test="keyWord != null and keyWord != ''">
        and (b.PINGYINFIIRST like '%'||#{keyWord}||'%' or b.TITLE like '%'||#{keyWord}||'%')
      </if>
    </where>
    order by ORDERID
  </select>
 
  <select id="selectBusinessLayerNode" 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_EXTBUSINESSLAYER c on(a.RESOURCEID = c.RESOURCEID)
    WHERE 1=1 and
    exists(select * from RES_EXTINTEGRATE t where INTEGRATETYPE = '数据集成' and t.resourceid=a.resourceid) or
      (a.AUDITSTATUS = 2 and a.RESOURCESTATUS = 0
      and (
      (a.SHARPROTOCOL = '依申请公开' and a.CREATEUSERID = #{userid})
      or (a.SHARPROTOCOL = '单位内公开' and a.PUBUNITID = #{unitid})
      or exists(
      select * from RES_APPLYRECOMMEND c
      where (
      (c.APPTYPE = 0 and APPUSERID = #{userid})
      or (c.APPTYPE = 1 and APPUNITID = #{unitid})
      )
      and (c.EFFENDTIME is null or c.EFFENDTIME >= now())
      and a.RESOURCEID = c.RESOURCEID
      )
      )
      )
      <if test="title!=null and title != '' ">
        and a.TITLE like '%${title}%'
      </if>
      <if test="datasources !=null and datasources != '' ">
        and a.DATASOURCES = #{datasources,jdbcType=OTHER}
      </if>
      <if test="selectids!=null and selectids != '' ">
        and a.RESOURCEID not in (${selectids})
      </if>
    group by CATLOGCODE
    ) r on b.CATLOGCODE = substr(r.CATLOGCODE, 1, LENGTH(b.CATLOGCODE))
    where parentid = #{parentid} and r.CATLOGCODE is not null
    order by ORDERID
  </select>
</mapper>