<?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.KeShiHuaFuWuMapper" >
|
<sql id="Base_Column_List" >
|
CATLOGID, CATLOGCODE, PARENTID, TITLE, PINGYINFIIRST, DESCRIPTION, IMGURL, ORDERID,
|
CREATEUSER, CREATEDATE, REMARK
|
</sql>
|
<select id="getYWTCAndZTDTCataLogList" 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
|
<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
|
<if test="type != null and type == 0">
|
and (a.resourceclass = 'KJ_ZTDT' or (a.resourceclass = 'YWJC'
|
and exists(select * from RES_EXTINTEGRATE t where INTEGRATETYPE = '数据集成' and t.resourceid=a.resourceid)))
|
</if>
|
<if test="type != null and type == 1">
|
and a.resourceclass = 'KJ_YWTC'
|
</if>
|
<if test="type != null and type == 2">
|
and a.resourceclass = 'KJ_JCDT'
|
</if>
|
<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
|
<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
|
<if test="type != null and type == 0">
|
and (a.resourceclass = 'KJ_ZTDT' or (a.resourceclass = 'YWJC'
|
and exists(select * from RES_EXTINTEGRATE t where INTEGRATETYPE = '数据集成' and t.resourceid=a.resourceid)))
|
</if>
|
<if test="type != null and type == 1">
|
and a.resourceclass = 'KJ_YWTC'
|
</if>
|
<if test="type != null and type == 2">
|
and a.resourceclass = 'KJ_JCDT'
|
</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
|
)
|
)
|
)
|
and a.CATLOGID = #{parentid,jdbcType=DECIMAL}
|
order by a.ORDERID
|
</select>
|
<select id="getJSONYWJCList" resultType="com.landtool.lanbase.modules.res.entity.Res_MainInfo">
|
select a.* from RES_MAININFO a
|
left join RES_EXTINTEGRATE b on a.RESOURCEID=b.RESOURCEID
|
where a.RESOURCECLASS='YWJC' and a.RESOURCESTATUS=0 and a.AUDITSTATUS =2
|
and b.INTEGRATETYPE='数据集成'
|
</select>
|
</mapper>
|