<?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.DiTuFuWuMapper" >
|
<select id="getZuiXinZiYuanGD" parameterType="com.landtool.lanbase.modules.res.entity.Res_MainInfo" resultType="com.landtool.lanbase.modules.res.entity.Res_MainInfo">
|
|
select *
|
from RES_MAININFO
|
where RESOURCESTATUS=0
|
and AUDITSTATUS=2
|
<if test="isDiTuFuwu != '' and isDiTuFuwu != null">
|
and RESOURCECLASS in ( ${isDiTuFuwu} )
|
</if>
|
<if test="title!=null and title != '' ">
|
and (TITLE like '%'||#{title}||'%' OR replace(KEYWORDS,',','') like '%'||#{title}||'%' OR ABBREVIATION like '%'||#{title}||'%')
|
</if>
|
<if test="resourceclass !=null and resourceclass != '' ">
|
and (resourceclass like #{resourceclass} || '%' )
|
</if>
|
<if test="pubdateBegin!=null and pubdateBegin != '' ">
|
and PUBDATE >= to_timestamp(#{pubdateBegin} || ' 00:00:00' ,'yyyy-mm-dd hh24:mi:ss')
|
</if>
|
<if test="pubdatefinish!=null and pubdatefinish != '' ">
|
<![CDATA[ and PUBDATE <= to_timestamp(#{pubdatefinish} || ' 23:59:59' ,'yyyy-mm-dd hh24:mi:ss') ]]>
|
</if>
|
order by PUBDATE desc
|
</select>
|
|
<select id="getWoDeZiYuan" resultType="com.landtool.lanbase.modules.res.entity.UserDefined.MainInfoJoinApplyRecommend">
|
WITH tab as(
|
SELECT row_number() over(ORDER BY b.APPDATE desc) rn, a.RESOURCEID, a.TITLE, a.RESOURCECLASS, b.AUDITOPINION, b.AUDITRESULT, b.AUDITTIME from RES_MAININFO a
|
left join RES_APPLYRECOMMEND b on(a.resourceid=b.resourceid)
|
where APPUSERID = ${appuserid} and RESOURCESTATUS=0
|
<!--我的申请只显示自己申请的个人申请部分 alert ykm 2018/12/25-->
|
and apptype = 0 AND ISRECOMMEND = 0
|
<if test="isDiTuFuwu != '' and isDiTuFuwu != null">
|
and RESOURCECLASS in ( ${isDiTuFuwu} )
|
</if>
|
)
|
SELECT * FROM tab WHERE <![CDATA[ rn <= ${num} ]]>
|
</select>
|
|
<select id="getWoDeSQZiYuan" resultType="com.landtool.lanbase.modules.res.entity.UserDefined.MainInfoJoinApplyRecommend">
|
select a.RESOURCEID, a.TITLE, a.ABBREVIATION, a.RESOURCECLASS, a.PUBUNITID, a.PUBDATE,b.APPDATE,b.AUDITOPINION,
|
b.AUDITRESULT, b.AUDITTIME,b.appid
|
from RES_MAININFO a inner join RES_APPLYRECOMMEND b on(a.resourceid=b.resourceid)
|
<where>
|
and APPUSERID = #{appuserid,jdbcType=OTHER} and RESOURCESTATUS=0
|
<!--我的申请只显示自己申请的个人申请部分 alert ykm 2018/12/25-->
|
and apptype = 0 and ISRECOMMEND = 0
|
<if test="isDiTuFuwu != '' and isDiTuFuwu != null">
|
and RESOURCECLASS in ( ${isDiTuFuwu} )
|
</if>
|
<if test="title!=null and title != '' ">
|
and (TITLE like '%'||#{title}||'%' OR replace(KEYWORDS,',','') like '%'||#{title}||'%' OR ABBREVIATION like
|
'%'||#{title}||'%')
|
</if>
|
<if test="resourceclass !=null and resourceclass != '' ">
|
and (resourceclass like #{resourceclass} || '%' )
|
</if>
|
<if test="auditresult !=null and (auditresult==0 ? '0' : auditresult) ">
|
and auditresult = #{auditresult}
|
</if>
|
<if test="pubdateBegin!=null and pubdateBegin != '' ">
|
and APPDATE >= to_timestamp(#{pubdateBegin} || ' 00:00:00','yyyy-mm-dd hh24:mi:ss')
|
</if>
|
<if test="pubdatefinish!=null and pubdatefinish != '' ">
|
<![CDATA[ and APPDATE <= to_timestamp(#{pubdatefinish} || ' 23:59:59','yyyy-mm-dd hh24:mi:ss') ]]>
|
</if>
|
order by b.appdate desc
|
</where>
|
</select>
|
|
<select id="getZuiXinZiYuan" resultType="com.landtool.lanbase.modules.res.entity.Res_MainInfo">
|
WITH tab as(
|
SELECT row_number() over(ORDER BY PUBDATE DESC) rn, a.* from RES_MAININFO a
|
<where>
|
RESOURCESTATUS=0 and AUDITSTATUS=2
|
<if test="isDiTuFuwu != '' and isDiTuFuwu != null">
|
and RESOURCECLASS in ( ${isDiTuFuwu} )
|
</if>
|
</where>
|
ORDER BY PUBDATE DESC
|
)
|
SELECT * from tab WHERE <![CDATA[ rn <= ${num} ]]>
|
</select>
|
</mapper>
|