<?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.ZiYuanFaBuMapper" >
|
<resultMap id="BaseResultMap" type="com.landtool.lanbase.modules.res.entity.Res_MainInfo" >
|
<id column="RESOURCEID" property="resourceid" jdbcType="DECIMAL" />
|
<result column="CATLOGID" property="catlogid" jdbcType="DECIMAL" />
|
<result column="TITLE" property="title" jdbcType="OTHER" />
|
<result column="ABBREVIATION" property="abbreviation" jdbcType="OTHER" />
|
<result column="PINGYINFIIRST" property="pingyinfiirst" jdbcType="OTHER" />
|
<result column="CATLOGCODE" property="catlogcode" jdbcType="OTHER" />
|
<result column="KEYWORDS" property="keywords" jdbcType="OTHER" />
|
<result column="DESCRIPTION" property="description" jdbcType="OTHER" />
|
<result column="DESURL" property="desurl" jdbcType="OTHER" />
|
<result column="IMGURL" property="imgurl" jdbcType="OTHER" />
|
<result column="RESOURCECLASS" property="resourceclass" jdbcType="OTHER" />
|
<result column="DATASOURCES" property="datasources" jdbcType="DECIMAL" />
|
<result column="PRODUCTIONTIME" property="productiontime" jdbcType="TIMESTAMP" />
|
<result column="UPDATETIMES" property="updatetimes" jdbcType="OTHER" />
|
<result column="PUBDATE" property="pubdate" jdbcType="TIMESTAMP" />
|
<result column="PUBUNITID" property="pubunitid" jdbcType="OTHER" />
|
<result column="CREATEUSERID" property="createuserid" jdbcType="OTHER" />
|
<result column="ADMINISTRATIVEID" property="administrativeid" jdbcType="OTHER" />
|
<result column="SECURITYLEV" property="securitylev" jdbcType="OTHER" />
|
<result column="SHARPROTOCOL" property="sharprotocol" jdbcType="OTHER" />
|
<result column="ESPPROXY" property="espproxy" jdbcType="DECIMAL" />
|
<result column="USERNAME" property="username" jdbcType="OTHER" />
|
<result column="PASSWORD" property="password" jdbcType="OTHER" />
|
<result column="TOKEN" property="token" jdbcType="OTHER" />
|
<result column="RESOURCESTATUS" property="resourcestatus" jdbcType="DECIMAL" />
|
<result column="AUDITSTATUS" property="auditstatus" jdbcType="DECIMAL" />
|
<result column="DISPLAYBY2D" property="displayby2d" jdbcType="DECIMAL" />
|
<result column="DISPLAYBY3D" property="displayby3d" jdbcType="DECIMAL" />
|
<result column="ORDERID" property="orderid" jdbcType="DECIMAL" />
|
<result column="CREATEDATE" property="createdate" jdbcType="TIMESTAMP" />
|
<result column="LASTEDITDATE" property="lasteditdate" jdbcType="TIMESTAMP" />
|
<result column="REMARK" property="remark" jdbcType="OTHER" />
|
<result column="INSTEADAUDIT" property="insteadaudit" jdbcType="OTHER" />
|
</resultMap>
|
<sql id="Base_Column_List" >
|
RES_MAININFO.RESOURCEID, CATLOGID, TITLE, ABBREVIATION, PINGYINFIIRST, CATLOGCODE, KEYWORDS, DESCRIPTION,
|
DESURL, IMGURL, RESOURCECLASS, DATASOURCES, PRODUCTIONTIME,
|
UPDATETIMES, PUBDATE, PUBUNITID, CREATEUSERID, ADMINISTRATIVEID, SECURITYLEV, SHARPROTOCOL,
|
ESPPROXY, USERNAME, PASSWORD, TOKEN, RESOURCESTATUS, AUDITSTATUS, DISPLAYBY2D, DISPLAYBY3D,
|
ORDERID, CREATEDATE, LASTEDITDATE, REMARK,INSTEADAUDIT
|
</sql>
|
<select id="selectResMainInfo" parameterType="com.landtool.lanbase.modules.res.entity.Res_MainInfo"
|
resultType="com.landtool.lanbase.modules.res.entity.Res_MainInfo">
|
select <include refid="Base_Column_List" />,
|
case when readcount > 0 then readcount else 0 end as readcount ,
|
case when applycount > 0 then applycount else 0 end as applycount
|
from RES_MAININFO
|
left join (select b.RESOURCEID,count(*) as readcount from RES_ACTIONRECORD b where ACTIONTYPE = '浏览' group by b.RESOURCEID)t2 on RES_MAININFO.RESOURCEID = t2.RESOURCEID
|
left join (select c.RESOURCEID,count(*) as applycount from RES_APPLYRECOMMEND c group by c.RESOURCEID)t3 on RES_MAININFO.RESOURCEID = t3.RESOURCEID
|
<where>
|
|
<if test="title!=null and title != '' ">
|
and (TITLE like '%'||#{title}||'%' OR replace(KEYWORDS,',','') like '%'||#{title}||'%')
|
</if>
|
<if test="resourceclass !=null and resourceclass != '' ">
|
and (resourceclass like #{resourceclass} || '%' )
|
</if>
|
<if test="createuserid!=null and createuserid != '' ">
|
and createuserid = #{createuserid,jdbcType=OTHER}
|
</if>
|
<if test="catlogid!=null and catlogid != '' ">
|
and catlogid = #{catlogid,jdbcType=DECIMAL}
|
</if>
|
<if test="pubdateBegin!=null and pubdateBegin != '' ">
|
and PUBDATE >= to_timestamp(#{pubdateBegin} ,'yyyy-mm-dd hh24:mi:ss')
|
</if>
|
<if test="pubdatefinish!=null and pubdatefinish != '' ">
|
<![CDATA[ and PUBDATE <= to_timestamp(#{pubdatefinish} ,'yyyy-mm-dd hh24:mi:ss') ]]>
|
</if>
|
<if test="auditstatus !=null and (auditstatus==0 ? '0' : auditstatus) ">
|
and auditstatus=#{auditstatus,jdbcType=DECIMAL}
|
</if>
|
<if test="ExistPermission !=null">
|
and cast(CREATEUSERID as varchar)=#{ExistPermission}
|
</if>
|
</where>
|
<if test="sort!=null and sort != '' ">
|
order by ${sort}
|
</if>
|
<if test="sort==null or sort == '' ">
|
order by CREATEDATE DESC
|
</if>
|
</select>
|
<select id="getAll" resultType="com.landtool.lanbase.modules.res.entity.Res_MainInfo">
|
SELECT
|
<include refid="Base_Column_List" />
|
FROM RES_MAININFO
|
</select>
|
</mapper>
|