<?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>
|