123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?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="cn.ubitech.ttc.dao.ResourcelibraryMapper">
- <!-- 开启二级缓存 -->
- <cache type="org.mybatis.caches.ehcache.EhcacheCache">
- <property name="timeToIdleSeconds" value="3600"/>
- <property name="timeToLiveSeconds" value="3600"/>
- <property name="maxEntriesLocalHeap" value="1000"/>
- <property name="maxEntriesLocalDisk" value="10000000"/>
- <property name="memoryStoreEvictionPolicy" value="LRU"/>
- </cache>
- <select id="getResourceLibrary" resultType="cn.ubitech.ttc.entity.Resourcelibrary">
- select r.* from resourcelibrary r
- </select>
- <select id="getMyCollectResourceLibrary" resultType="cn.ubitech.ttc.entity.Resourcelibrary">
- SELECT r.*
- FROM click_record cr, resourcelibrary r
- WHERE
- cr.moduleid = #{moduleid} AND cr.clicktype = #{clicktype} AND r.id = cr.targetid AND cr.userid = #{userid}
- AND r.restype = #{restype} AND r.title like #{keyword} order by cr.createtime desc
- </select>
- <select id="getMyCollectResourceLibraryCount" resultType="java.lang.Integer">
- select count(*)
- from (SELECT r.*
- FROM click_record cr, resourcelibrary r
- WHERE
- cr.moduleid = #{moduleid} AND cr.clicktype = #{clicktype} AND r.id = cr.targetid AND
- cr.userid = #{userid}
- AND r.restype = #{restype} AND r.title like #{keyword}) a
- </select>
- <select id="getResourceLibraryByConnId" resultType="cn.ubitech.ttc.entity.Resourcelibrary">
- select l.*
- from resourcelibrary l inner join res_dt_lk r
- on l.id = r.resid
- where r.resid != 0
- <if test="resConnId != null and resConnId != '' and resConnId != 'null' ">
- and r.connid = ${resConnId}
- </if>
- </select>
- <select id="getDistinctRestype" resultType="java.lang.Integer">
- select distinct restype from resourcelibrary
- </select>
- <select id="getResourceByTitle" resultType="cn.ubitech.ttc.entity.Resourcelibrary">
- select * from resourcelibrary
- where title = #{title}
- and oid = #{oid}
- </select>
- <select id="getHaveIntellectureNum" resultType="java.lang.Integer">
- select count(*)
- from resourcelibrary
- where comefrom = #{node}
- and restype = 6
- and (patentcount > 0
- or patentforutilitycount > 0
- or patentfordesigncount > 0
- or patentforsoftwarecount > 0)
- </select>
- <select id="getHaveDemandOrgList" resultType="java.lang.Long">
- select DISTINCT oid
- from resourcelibrary
- where restype = #{restype}
- and comefrom = #{node}
- and oid != 0
- </select>
- <select id="getOrgList" resultType="java.lang.Long">
- select DISTINCT oid
- from resourcelibrary
- where comefrom = #{node}
- and oid != 0
- </select>
- </mapper>
|