12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958 |
- <?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.cslg.pas.mapper.PatentMapper">
- <select id="getDateTime" resultType="java.lang.Integer">
- select ifnull(${type}(${column}), 0) from os_patent where id in (<trim prefix="" suffixOverrides=",">
- ${ids}</trim>) and ${column} is not null
- </select>
- <select id="getDateTime2" resultType="java.lang.Integer">
- select ifnull(${type}(unix_timestamp(name)), 0) from os_patent_field_text where id in (select fid from
- os_patent_field_patent_link where pid in (<trim prefix="" suffixOverrides=",">${ids}</trim>) and cid = ${field})
- </select>
- <select id="getCustomFieldCount" resultType="java.lang.Integer">
- select distinct b.pid
- from os_patent_field_text a
- left join os_patent_field_patent_link b on a.id = b.fid
- <where>
- and a.cid = #{field} and a.`name` ${mino} #{minv} and a.`name` ${maxo} #{maxv}
- and b.pid in
- <foreach collection="ids" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- </where>
- </select>
- <select id="getCustomFieldTime" resultType="java.lang.Integer">
- select distinct b.pid
- from os_patent_field_text a
- left join os_patent_field_patent_link b on a.id = b.fid
- <where>
- and a.cid = #{field} and (unix_timestamp(a.`name`) between #{startDate} and #{endDate})
- and b.pid in
- <foreach collection="ids" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- </where>
- </select>
- <select id="getPatentListByIdAndColumn" resultType="java.util.Map">
- select ${column}
- from os_patent
- where id = #{id}
- </select>
- <select id="getPageList" parameterType="cn.cslg.pas.common.model.vo.PatentVO"
- resultType="cn.cslg.pas.domain.Patent">
- select a.id, a.`name` as name, a.nameout as name_out, a.patentno as patent_no, a.abstract_path, a.abstract as
- abstract_str, a.abstractout as abstract_out,
- a.publicno as public_no, a.publicdate as public_date, a.simple_family, a.inpadoc_family, a.applicationno as
- application_no, a.appdate as application_date,
- a.`status` as simple_status, a.type, a.publictodate as public_accredit_date, a.fpublicdate as first_public_date,
- a.prioritydate as priority_date, a.publictono as public_accredit_no,
- b.look as `read`, a.agencyid as agency_id, a.num2 as right_num, a.quoteno as quote_num, a.quotedno as
- quoted_num,
- a.patsnap_family as patSnapFamily, a.patsnapfamilynum as patSnapFamilyNum
- from os_patent a
- <if test="params.folder != null and params.folder != ''">
- left join os_portfolio_link b on b.pid = a.id
- </if>
- <if test="params.folder == null or params.folder == ''">
- left join os_thematic_pid b on b.pid = a.id
- </if>
- <if test="params.queryLabel == true">
- left join os_patent_label d on d.pid = a.id and d.tid = b.zid
- </if>
- <if test="params.queryApplicantOriginal == true">
- left join os_applicant_attr e on e.type = 2 and e.pid = a.id
- </if>
- <if test="params.queryApplicantCurrent == true">
- left join os_applicant_attr f on f.type = 1 and f.pid = a.id
- </if>
- <if test="params.queryInventor == true">
- left join os_patent_inventor_relation g on g.pid = a.id
- left join os_patent_inventor g1 on g1.id = g.fid
- </if>
- <if test="params.queryInventorMerge == true">
- left join os_patent_inventor_merge g2 on g2.inventor_id = g.fid
- </if>
- <if test="params.queryApplicantOriginalStandard == true">
- left join os_applicant_attr h on h.type = 2 and h.pid = a.id
- left join os_patent_applicant h1 on h1.id = h.applicantid
- </if>
- <if test="params.queryApplicantCurrentStandard == true">
- left join os_applicant_attr i on i.type = 1 and i.pid = a.id
- left join os_patent_applicant i1 on i1.id = i.applicantid
- </if>
- <if test="params.queryApplicantOriginalMerge == true">
- left join os_associate_applicant j on e.applicantid = j.applicantid
- </if>
- <if test="params.queryApplicantCurrentMerge == true">
- left join os_associate_applicant k on f.applicantid = k.applicantid
- </if>
- <if test="params.queryApplicantAddress == true">
- left join os_applicant_attr m on m.pid = a.id and m.type = 2
- left join os_patent_applicant o on o.id = m.applicantid
- </if>
- <if test="params.queryAffair == true">
- left join os_patent_affair p on p.pid = a.id
- </if>
- <if test="params.queryClassNumberIpc == true">
- left join os_patent_typeno q1 on q1.pid = a.id
- </if>
- <if test="params.queryClassNumberCpc == true">
- left join os_patent_typeno q2 on q2.pid = a.id
- </if>
- <if test="params.queryClassNumberUpc == true">
- left join os_patent_typeno q3 on q3.pid = a.id
- </if>
- <if test="params.queryClassNumberLoc == true">
- left join os_patent_typeno q4 on q4.pid = a.id
- </if>
- <if test="params.selfField !=null and params.selfField.size()>0">
- left join os_patent_field_patent_link a2 on a2.pid = a.id
- </if>
- <where>
- <if test="params.read == 'read'">
- and b.look = 1
- </if>
- <if test="params.read == 'unread'">
- and b.look = 0
- </if>
- <if test="params.projectId != null and params.importTaskId == null">
- and b.zid = #{params.projectId}
- </if>
- <if test="params.importTaskId != null and params.projectId == null">
- and a.patentno in
- ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where IMPORTTASK_ID in
- <foreach item="item" collection="params.importTaskId" index="index" open="(" separator=","
- close=") ">
- #{item}
- </foreach>
- )
- </if>
- <if test="params.importTaskId != null and params.projectId != null">
- and (b.zid = #{params.projectId} or
- a.patentno in
- ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where IMPORTTASK_ID in
- <foreach item="item" collection="params.importTaskId" index="index" open="(" separator=","
- close=") ">
- #{item}
- </foreach>
- )
- )
- </if>
- <if test="params.projectId == null and params.projectId == null">
- and 1 !=1
- </if>
- <if test="params.folder != null and params.folder != ''">
- and b.fid = #{params.folder}
- </if>
- <if test="params.nameSql != null and params.nameSql != ''">
- and (${params.nameSql})
- </if>
- <if test="params.abstractStrSql != null and params.abstractStrSql != ''">
- and (${params.abstractStrSql})
- </if>
- <if test="params.publicNoSql != null and params.publicNoSql != ''">
- and (${params.publicNoSql})
- </if>
- <if test="params.applicationNoSql != null and params.applicationNoSql != ''">
- and (${params.applicationNoSql})
- </if>
- <if test="params.rightContentSql != null and params.rightContentSql != ''">
- and (select count(*) from os_patent_right where a.id = patent_id and (${params.rightContentSql})) > 0
- </if>
- <if test="params.querySimpleFamily == true">
- and (a.simple_family = (select id from os_patent_simplefamily where type = 1 and patent_no = a.patentno)
- or a.simple_family is null)
- </if>
- <if test="params.queryInpadocFamily == true">
- and (a.inpadoc_family = (select id from os_patent_simplefamily where type = 2 and patent_no =
- a.patentno) or a.inpadoc_family is null)
- </if>
- <if test="params.queryPatSnapFamily == true">
- and (a.patsnap_family = (select id from os_patent_simplefamily where type = 3 and patent_no =
- a.patentno) or a.patsnap_family is null)
- </if>
- <if test="params.whereClassNumberIpc != null">
- and q1.type = 1 and
- <foreach collection="params.whereClassNumberIpc" item="item" separator="or" open="(" close=")">
- <if test="params.queryClassNumberIpcMethod == 1">
- left(q1.code, 1)
- </if>
- <if test="params.queryClassNumberIpcMethod == 2">
- left(q1.code, 3)
- </if>
- <if test="params.queryClassNumberIpcMethod == 3">
- left(q1.code, 4)
- </if>
- <if test="params.queryClassNumberIpcMethod == 4">
- substring_index(q1.code, '/', 1)
- </if>
- <if test="params.queryClassNumberIpcMethod == 5">
- q1.code
- </if>
- = #{item}
- </foreach>
- </if>
- <if test="params.whereClassNumberCpc != null">
- and q2.type = 2 and
- <foreach collection="params.whereClassNumberCpc" item="item" separator="or" open="(" close=")">
- <if test="params.queryClassNumberCpcMethod == 1">
- left(q2.code, 1)
- </if>
- <if test="params.queryClassNumberCpcMethod == 2">
- left(q2.code, 3)
- </if>
- <if test="params.queryClassNumberCpcMethod == 3">
- left(q2.code, 4)
- </if>
- <if test="params.queryClassNumberCpcMethod == 4">
- substring_index(q2.code, '/', 1)
- </if>
- <if test="params.queryClassNumberCpcMethod == 5">
- q2.code
- </if>
- = #{item}
- </foreach>
- </if>
- <if test="params.whereClassNumberUpc != null">
- and q3.type = 3 and
- <foreach collection="params.whereClassNumberUpc" item="item" separator="or" open="(" close=")">
- <if test="params.queryClassNumberUpcMethod == 1">
- q3.code
- </if>
- <if test="params.queryClassNumberUpcMethod == 2">
- substring_index(q3.code, '/', 1)
- </if>
- <if test="params.queryClassNumberUpcMethod == 3">
- substring_index(q3.code, '/', -1)
- </if>
- = #{item}
- </foreach>
- </if>
- <if test="params.whereClassNumberLoc != null">
- and q4.type = 4 and
- <foreach collection="params.whereClassNumberLoc" item="item" separator="or" open="(" close=")">
- <if test="params.queryClassNumberLocMethod == 1">
- q4.code
- </if>
- <if test="params.queryClassNumberLocMethod == 2">
- substring_index(q4.code, '/', 1)
- </if>
- <if test="params.queryClassNumberLocMethod == 3">
- substring_index(q4.code, '/', -1)
- </if>
- = #{item}
- </foreach>
- </if>
- <if test="params.whereApplicantOriginal != null">
- and e.applicantid in
- <foreach collection="params.whereApplicantOriginal" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.whereApplicantCurrent != null">
- and f.applicantid in
- <foreach collection="params.whereApplicantCurrent" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.whereInventor != null">
- and g1.id in
- <foreach collection="params.whereInventor" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.whereInventorMerge != null">
- and (
- g2.merge_id in
- <foreach collection="params.whereInventorMerge" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- or
- g.fid in
- <foreach collection="params.whereInventorMerge" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- )
- </if>
- <if test="params.whereApplicantOriginalStandard != null">
- and h1.bname in
- <foreach collection="params.whereApplicantOriginalStandard" item="item" separator="," open="("
- close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.whereApplicantCurrentStandard != null">
- and i1.bname in
- <foreach collection="params.whereApplicantCurrentStandard" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.whereApplicantOriginalMerge != null">
- and (
- j.mergeid in
- <foreach collection="params.whereApplicantOriginalMerge" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- or
- e.applicantid in
- <foreach collection="params.whereApplicantOriginalMerge" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- )
- </if>
- <if test="params.whereApplicantCurrentMerge != null">
- and (
- k.mergeid in
- <foreach collection="params.whereApplicantCurrentMerge" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- or
- f.applicantid in
- <foreach collection="params.whereApplicantCurrentMerge" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- )
- </if>
- <if test="params.whereBureau != null">
- and a.bureau in
- <foreach collection="params.whereBureau" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.whereType != null">
- and a.type in
- <foreach collection="params.whereType" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.whereStatus != null">
- and a.status in
- <foreach collection="params.whereStatus" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.whereAppDate != null">
- and from_unixtime(a.appdate, '%Y') in
- <foreach collection="params.whereAppDate" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.wherePublicDate != null">
- and from_unixtime(a.publicdate, '%Y') in
- <foreach collection="params.wherePublicDate" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.whereCountry != null">
- and o.country in
- <foreach collection="params.whereCountry" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.whereApplicantProvince != null">
- and o.province_id in
- <foreach collection="params.whereApplicantProvince" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.whereAffair != null">
- and p.status REGEXP #{params.whereAffair}
- </if>
- <if test="params.whereLabel != null">
- and d.tagname in
- <foreach collection="params.whereLabel" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.selfField != null and params.selfField.size()>0">
- and
- <foreach collection="params.selfField" item="item" separator=" and " open="(" close=")">
- a.id in (
- select distinct a3.id from os_patent a3 left join os_patent_field_patent_link a4
- on a4.pid = a3.id
- and a4.cid=#{item.key}
- <where>
- a4.fid in
- <foreach collection="item.value" item="item2" separator="," open="(" close=")">
- #{item2}
- </foreach>
- <if test="item.isnull==true">
- or a4.id is null
- </if>
- </where>
- )
- </foreach>
- </if>
- </where>
- group by a.id
- order by
- <if test="params.sort.prop == 'id'">a.id</if>
- <if test="params.sort.prop == 'name'">a.name</if>
- <if test="params.sort.prop == 'patentNo'">a.patentno</if>
- <if test="params.sort.prop == 'applicationNo'">a.applicationno</if>
- <if test="params.sort.prop == 'applicationDate'">a.appdate</if>
- <if test="params.sort.prop == 'publicDate'">a.publicdate</if>
- <if test="params.sort.prop == 'publicAccreditDate'">a.publictodate</if>
- <if test="params.sort.prop == 'rightNum'">a.num2</if>
- <if test="params.sort.prop == 'quoteNum'">a.quoteno</if>
- <if test="params.sort.prop == 'quotedNum'">a.quotedno</if>
- ${params.sort.order}
- </select>
- <select id="getPatentQuerySourcePageList" parameterType="cn.cslg.pas.common.model.vo.PatentQueryFieldSourceVO"
- resultType="cn.cslg.pas.common.model.dto.PatentQueryFieldSourceDTO">
- <if test="params.key == '41-1'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="a.publicno"/>
- <property name="count" value="distinct a.publicno"/>
- <property name="value" value="a.publicno"/>
- </include>
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="a.publicno"/>
- </include>
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="a.publicno"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '41-2'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="a.applicationno"/>
- <property name="count" value="distinct a.applicationno"/>
- <property name="value" value="a.applicationno"/>
- </include>
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="a.applicationno"/>
- </include>
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="a.applicationno"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '18-6' or params.key == '19-6' or params.key == '23-6' or params.key == '24-6'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="e.name"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="e.id"/>
- </include>
- left join os_applicant_attr d on d.pid = a.id and d.type = #{params.applicantType}
- left join os_patent_applicant e on e.id = d.applicantid
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="e.name"/>
- </include>
- and e.name is not null
- <if test="params.key == '23-6' or params.key == '24-6'">
- and d.order = 0
- </if>
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="d.applicantid"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '18-7' or params.key == '19-7' or params.key == '23-7' or params.key == '24-7'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="e.bname"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="e.bname"/>
- </include>
- left join os_applicant_attr d on d.pid = a.id and d.type = #{params.applicantType}
- left join os_patent_applicant e on e.id = d.applicantid
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="e.bname"/>
- </include>
- and e.bname is not null
- <if test="params.key == '23-7' or params.key == '24-7'">
- and d.order = 0
- </if>
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="e.bname"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '20-0'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="e.name"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="e.id"/>
- </include>
- left join os_patent_inventor_relation d on d.pid = a.id
- left join os_patent_inventor e on e.id = d.fid
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="e.name"/>
- </include>
- and e.name is not null
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="d.fid"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '20-1'">
- select temp.* from ((
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="e.name"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="e.id"/>
- </include>
- left join os_patent_inventor_relation d on d.pid = a.id
- left join os_patent_inventor e on e.id = d.fid
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="e.name"/>
- </include>
- and e.name is not null
- and e.id not in (select inventor_id from os_patent_inventor_merge where project_id = b.zid)
- group by d.fid
- ) union all (
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="e.name"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="e.id"/>
- </include>
- left join os_patent_inventor_relation d on d.pid = a.id
- left join os_patent_inventor_merge e1 on e1.inventor_id = d.fid
- left join os_patent_inventor e on e.id = e1.merge_id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="e.name"/>
- </include>
- and e.name is not null
- and e.project_id = b.zid
- group by e.id
- )) as temp where 1 = 1 order by `count` desc, `value` asc
- </if>
- <if test="params.key == '21-0'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="x.name"/>
- <property name="count" value="distinct a.id"/>
- <property name="value" value="x.id"/>
- </include>
- left join os_patent_agency x on x.id = a.agencyid
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="x.name"/>
- </include>
- and a.agencyid is not null
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="a.agencyid"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '22-0'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="x2.name"/>
- <property name="count" value="distinct a.id"/>
- <property name="value" value="x2.id"/>
- </include>
- left join os_patent_agent_link x1 on x1.pid = a.id
- left join os_patent_agent x2 on x2.id = x1.aid
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="x2.name"/>
- </include>
- and x2.id is not null
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="a.agencyid"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '18-8' or params.key == '19-8' or params.key == '23-8' or params.key == '24-8'">
- select temp.* from ((
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="e.name"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="e.id"/>
- </include>
- left join os_applicant_attr d on d.pid = a.id and d.type = #{params.applicantType}
- left join os_patent_applicant e on e.id = d.applicantid
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="e.name"/>
- </include>
- and e.id not in (select applicantid from os_associate_applicant where tid = b.zid) and e.name is not null
- <if test="params.key == '23-8' or params.key == '24-8'">
- and d.order = 0
- </if>
- group by e.id
- ) union all (
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="e.name"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="e.id"/>
- </include>
- left join os_applicant_attr d on d.pid = a.id and d.type = #{params.applicantType}
- left join os_associate_applicant f on f.applicantid = d.applicantid
- left join os_patent_applicant e on e.id = f.mergeid
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="e.name"/>
- </include>
- and e.name is not null and e.project_id = b.zid
- <if test="params.key == '23-8' or params.key == '24-8'">
- and d.order = 0
- </if>
- group by e.id
- )) as temp where 1 = 1 order by `count` desc, `value` asc
- </if>
- <if test="params.key == '13-1'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="left(d.code, 1)"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="left(d.code, 1)"/>
- </include>
- left join os_patent_typeno d on d.pid = a.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="left(d.code, 1)"/>
- </include>
- and d.type = 1
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="left(d.code, 1)"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '13-2'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="left(d.code, 3)"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="left(d.code, 3)"/>
- </include>
- left join os_patent_typeno d on d.pid = a.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="left(d.code, 3)"/>
- </include>
- and d.type = 1
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="left(d.code, 3)"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '13-3'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="left(d.code, 4)"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="left(d.code, 4)"/>
- </include>
- left join os_patent_typeno d on d.pid = a.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="left(d.code, 4)"/>
- </include>
- and d.type = 1
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="left(d.code, 4)"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '13-4'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="substring_index(d.code, '/', 1)"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="substring_index(d.code, '/', 1)"/>
- </include>
- left join os_patent_typeno d on d.pid = a.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="substring_index(d.code, '/', 1)"/>
- </include>
- and d.type = 1
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="substring_index(d.code, '/', 1)"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '13-5'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="d.code"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="d.code"/>
- </include>
- left join os_patent_typeno d on d.pid = a.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="d.code"/>
- </include>
- and d.type = 1
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="d.code"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '14-1'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="left(d.code, 1)"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="left(d.code, 1)"/>
- </include>
- left join os_patent_typeno d on d.pid = a.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="left(d.code, 1)"/>
- </include>
- and d.type = 1 and d.main = 1
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="left(d.code, 1)"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '14-2'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="left(d.code, 3)"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="left(d.code, 3)"/>
- </include>
- left join os_patent_typeno d on d.pid = a.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="left(d.code, 3)"/>
- </include>
- and d.type = 1 and d.main = 1
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="left(d.code, 3)"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '14-3'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="left(d.code, 4)"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="left(d.code, 4)"/>
- </include>
- left join os_patent_typeno d on d.pid = a.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="left(d.code, 4)"/>
- </include>
- and d.type = 1 and d.main = 1
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="left(d.code, 4)"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '14-4'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="substring_index(d.code, '/', 1)"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="substring_index(d.code, '/', 1)"/>
- </include>
- left join os_patent_typeno d on d.pid = a.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="substring_index(d.code, '/', 1)"/>
- </include>
- and d.type = 1 and d.main = 1
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="substring_index(d.code, '/', 1)"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '14-5'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="d.code"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="d.code"/>
- </include>
- left join os_patent_typeno d on d.pid = a.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="d.code"/>
- </include>
- and d.type = 1 and d.main = 1
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="d.code"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '15-1'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="left(d.code, 1)"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="left(d.code, 1)"/>
- </include>
- left join os_patent_typeno d on d.pid = a.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="left(d.code, 1)"/>
- </include>
- and d.type = 2
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="left(d.code, 1)"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '15-2'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="left(d.code, 3)"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="left(d.code, 3)"/>
- </include>
- left join os_patent_typeno d on d.pid = a.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="left(d.code, 3)"/>
- </include>
- and d.type = 2
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="left(d.code, 3)"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '15-3'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="left(d.code, 4)"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="left(d.code, 4)"/>
- </include>
- left join os_patent_typeno d on d.pid = a.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="left(d.code, 4)"/>
- </include>
- and d.type = 2
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="left(d.code, 4)"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '15-4'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="substring_index(d.code, '/', 1)"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="substring_index(d.code, '/', 1)"/>
- </include>
- left join os_patent_typeno d on d.pid = a.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="substring_index(d.code, '/', 1)"/>
- </include>
- and d.type = 2
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="substring_index(d.code, '/', 1)"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '15-5'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="d.code"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="d.code"/>
- </include>
- left join os_patent_typeno d on d.pid = a.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="d.code"/>
- </include>
- and d.type = 2
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="d.code"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '17-1'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="d.code"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="d.code"/>
- </include>
- left join os_patent_typeno d on d.pid = a.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="d.code"/>
- </include>
- and d.type = 3
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="d.code"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '17-2'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="substring_index(d.code, '/', 1)"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="substring_index(d.code, '/', 1)"/>
- </include>
- left join os_patent_typeno d on d.pid = a.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="substring_index(d.code, '/', 1)"/>
- </include>
- and d.type = 3
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="substring_index(d.code, '/', 1)"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '17-3'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="substring_index(d.code, '/', -1)"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="substring_index(d.code, '/', -1)"/>
- </include>
- left join os_patent_typeno d on d.pid = a.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="substring_index(d.code, '/', -1)"/>
- </include>
- and d.type = 3
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="substring_index(d.code, '/', -1)"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '16-1'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="d.code"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="d.code"/>
- </include>
- left join os_patent_typeno d on d.pid = a.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="d.code"/>
- </include>
- and d.type = 4
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="d.code"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '16-2'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="substring_index(d.code, '-', 1)"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="substring_index(d.code, '-', 1)"/>
- </include>
- left join os_patent_typeno d on d.pid = a.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="substring_index(d.code, '-', 1)"/>
- </include>
- and d.type = 4
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="substring_index(d.code, '-', 1)"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '16-3'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="substring_index(d.code, '-', -1)"/>
- <property name="count" value="distinct d.pid"/>
- <property name="value" value="substring_index(d.code, '-', -1)"/>
- </include>
- left join os_patent_typeno d on d.pid = a.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="substring_index(d.code, '-', -1)"/>
- </include>
- and d.type = 4
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="substring_index(d.code, '-', -1)"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '25-12'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="from_unixtime(a.appdate, '%Y')"/>
- <property name="count" value="distinct a.id"/>
- <property name="value" value="from_unixtime(a.appdate, '%Y')"/>
- </include>
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="from_unixtime(a.appdate, '%Y')"/>
- </include>
- and a.appdate > 0
- <if test="params.startDate != '' and params.endDate != '' and params.startDate != null and params.endDate != null">
- and from_unixtime(a.appdate, '%Y') between #{params.startDate} and #{params.endDate}
- </if>
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="from_unixtime(a.appdate, '%Y')"/>
- <property name="orderBy" value="label"/>
- </include>
- </if>
- <if test="params.key == '28-0'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="a.bureau"/>
- <property name="count" value="distinct a.id"/>
- <property name="value" value="a.bureau"/>
- </include>
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="a.bureau"/>
- </include>
- and (a.bureau is not null or a.bureau != '')
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="a.bureau"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '37-0'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="c1.label"/>
- <property name="count" value="distinct a.id"/>
- <property name="value" value="a.type"/>
- </include>
- left join os_system_dict c1 on a.type = c1.value and c1.type = 'PATENT_TYPE'
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="c1.label"/>
- </include>
- and c1.label is not null
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="a.type"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '36-0'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="c1.label"/>
- <property name="count" value="distinct a.id"/>
- <property name="value" value="a.status"/>
- </include>
- left join os_system_dict c1 on a.status = c1.value and c1.type = 'PATENT_SIMPLE_STATUS'
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="c1.label"/>
- </include>
- and c1.label is not null
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="a.status"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '29-17' or params.key == '30-17'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="f.label"/>
- <property name="count" value="distinct a.id"/>
- <property name="value" value="f.value"/>
- </include>
- left join os_applicant_attr c1 on c1.pid = a.id and c1.type = #{params.applicantType}
- left join os_patent_applicant e on e.id = c1.applicantid
- left join os_system_dict f on e.country = f.value and f.type = 'COUNTRIES'
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="f.label"/>
- </include>
- and f.value is not null
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="e.country"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '29-18' or params.key == '30-18'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="f.name"/>
- <property name="count" value="distinct a.id"/>
- <property name="value" value="f.id"/>
- </include>
- left join os_applicant_attr c1 on c1.pid = a.id and c1.type = #{params.applicantType}
- left join os_patent_applicant e on e.id = c1.applicantid
- left join os_area f on e.province_id = f.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="f.name"/>
- </include>
- and f.id is not null
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="e.province_id"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '29-19' or params.key == '30-19'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="f.name"/>
- <property name="count" value="distinct a.id"/>
- <property name="value" value="f.id"/>
- </include>
- left join os_applicant_attr c1 on c1.pid = a.id and c1.type = #{params.applicantType}
- left join os_patent_applicant e on e.id = c1.applicantid
- left join os_area f on e.city_id = f.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="f.name"/>
- </include>
- and f.id is not null
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="e.city_id"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '29-20' or params.key == '30-20'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="f.name"/>
- <property name="count" value="distinct a.id"/>
- <property name="value" value="f.id"/>
- </include>
- left join os_applicant_attr c1 on c1.pid = a.id and c1.type = #{params.applicantType}
- left join os_patent_applicant e on e.id = c1.applicantid
- left join os_area f on e.area_id = f.id
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="f.name"/>
- </include>
- and f.id is not null
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="e.area_id"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '31-0'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="f.label"/>
- <property name="count" value="distinct a.id"/>
- <property name="value" value="f.value"/>
- </include>
- left join os_system_dict f on a.prioritycountry = f.value and f.type = 'COUNTRIES'
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="f.label"/>
- </include>
- and f.value is not null
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="a.prioritycountry"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '26-12'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="from_unixtime(a.publicdate, '%Y')"/>
- <property name="count" value="distinct a.id"/>
- <property name="value" value="from_unixtime(a.publicdate, '%Y')"/>
- </include>
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="from_unixtime(a.publicdate, '%Y')"/>
- </include>
- and a.publicdate > 0
- <if test="params.startDate != '' and params.endDate != '' and params.startDate != null and params.endDate != null">
- and from_unixtime(a.publicdate, '%Y') between #{params.startDate} and #{params.endDate}
- </if>
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="from_unixtime(a.publicdate, '%Y')"/>
- <property name="orderBy" value="label"/>
- </include>
- </if>
- <if test="params.key == '40-0'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="d.label"/>
- <property name="count" value="distinct a.id"/>
- <property name="value" value="d.value"/>
- </include>
- left join os_patent_affair c1 on b.pid = c1.pid
- left join os_system_dict d on d.label = c1.status
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="d.label"/>
- </include>
- and d.value is not null
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="d.value"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.key == '54-0'">
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="c1.tagname"/>
- <property name="count" value="distinct a.id"/>
- <property name="value" value="c1.tagname"/>
- </include>
- left join os_patent_label c1 on b.pid = c1.pid
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="c1.tagname"/>
- </include>
- and c1.tid = #{params.projectId}
- <include refid="Patent_Query_Source_Base_Group">
- <property name="groupBy" value="c1.tagname"/>
- <property name="orderBy" value="count"/>
- </include>
- </if>
- <if test="params.type != 'query'">
- select temp.* from ((
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="null"/>
- <property name="count" value="a.id"/>
- <property name="value" value="null"/>
- </include>
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="null"/>
- </include>
- and a.id not in (select pid from os_patent_field_patent_link where cid = #{params.customFieldId})
- ) union all (
- <include refid="Patent_Query_Source_Base_Select">
- <property name="label" value="d.name"/>
- <property name="count" value="distinct e.pid"/>
- <property name="value" value="d.id"/>
- </include>
- left join os_patent_field_patent_link e on e.pid = b.pid
- left join os_patent_field c1 on c1.id = e.cid
- <if test="params.type == 6">
- left join os_patent_field_tree d on d.cid = e.cid
- </if>
- <if test="params.type == 0 or params.type == 1 or params.type == 2">
- left join os_patent_field_text d on d.cid = e.cid and d.name is not null and d.name != ''
- </if>
- <if test="params.type == 3 or params.type == 4 or params.type == 5">
- left join os_patent_field_multiple d on d.cid = e.cid
- </if>
- <include refid="Patent_Query_Source_Base_Where">
- <property name="label" value="d.name"/>
- </include>
- and c1.id = #{params.customFieldId}
- <if test="params.customFieldTreeType == 0">
- and e.fid in (select id from os_patent_field_tree where cid = c1.id and find_in_set(d.id , replace(path
- , '/', ',')))
- </if>
- <if test="params.customFieldTreeType == null">
- and e.fid = d.id
- </if>
- group by d.id
- )) as temp where 1 = 1 order by `count` desc, `value` asc
- </if>
- </select>
- <sql id="Patent_Query_Source_Base_Select">
- select ifnull(${label}, '未选择') as label, count(${count}) as `count`, ifnull(${value}, 'null') as `value`,
- group_concat(distinct a.id) as ids
- from os_patent a
- <if test="params.folder != null and params.folder != ''">
- left join os_portfolio_link b on b.pid = a.id
- </if>
- <if test="params.folder == null or params.folder == ''">
- left join os_thematic_pid b on b.pid = a.id
- </if>
- </sql>
- <sql id="Patent_Query_Source_Base_Where">
- <where>
- <if test="params.projectId != null">
- and b.zid = #{params.projectId}
- </if>
- <if test="params.folder != '' and params.folder != null">
- and b.fid = #{params.folder}
- </if>
- <if test="params.label != '' and params.label != null">
- and ${label} like concat('%', #{params.label}, '%')
- </if>
- <if test="ids != null and ids.size() != 0">
- and b.pid in
- <foreach collection="ids" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- </where>
- </sql>
- <sql id="Patent_Query_Source_Base_Group">
- group by
- ${groupBy}
- order
- by
- `${orderBy}`
- desc,
- `value`
- asc
- </sql>
- <select id="getListForRMS" resultType="java.lang.String">
- select DISTINCT a.patentno as patent_no
- from os_patent a
- <if test="params.applicationName !=null ">
- left join os_applicant_attr b on a.id=b.pid and b.type =1
- left join os_patent_applicant c on c.id=b.applicantid
- </if>
- <if test=" params.obligeeName !=null">
- left join os_applicant_attr d on a.id=d.pid and d.type =2
- left join os_patent_applicant e on e.id=d.applicantid
- </if>
- <if test="params.numberIpc!=null ">
- left join os_patent_typeno f on f.pid =a.id and f.type =1
- </if>
- <if test=" params.numberCpc!=null ">
- left join os_patent_typeno g on g.pid =a.id and g.type =2
- </if>
- <if test=" params.numberUpc!=null">
- left join os_patent_typeno h on h.pid =a.id and h.type =3
- </if>
- <if test="params.projectId != null and params.pasOptions !=null and params.pasOptions.size()!=0">
- left join os_thematic_pid i on i.pid=a.id left join os_patent_field_patent_link j on a.id=j.pid
- </if>
- <where>
- <choose>
- <when test="params.projectId != null or (params.patentNos != null and params.patentNos.size()!=0) or params.reportId!=null ">
- <if test="params.projectId != null">
- and ( a.id in (select pid from os_thematic_pid where zid = #{params.projectId})
- <if test="params.patentNos != null and params.patentNos.size()!=0">
- or patentno in
- <foreach item="item" collection="params.patentNos" index="index" open="(" separator=","
- close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.reportId != null">
- or patentno in
- ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
- )
- </if>
- )
- </if>
- <if test="params.projectId == null and params.patentNos != null and params.patentNos.size()!=0">
- (patentno in
- <foreach item="item" collection="params.patentNos" index="index" open="(" separator=","
- close=")">
- #{item}
- </foreach>
- <if test="params.reportId != null">
- or patentno in
- ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
- )
- </if>
- )
- </if>
- <if test="params.projectId == null and (params.patentNos == null or params.patentNos.size()==0) and params.reportId != null">
- patentno in
- ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
- )
- </if>
- <if test="params.notInPatentNos != null and params.notInPatentNos.size!=0">
- and patentno not in
- <foreach item="item" collection="params.notInPatentNos" index="index" open="(" separator=","
- close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.conPatentNos != null and params.conPatentNos.size!=0">
- and patentno in
- <foreach item="item" collection="params.conPatentNos" index="index" open="(" separator=","
- close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.applicationName !=null and params.applicationName !='' ">
- and c.name REGEXP #{params.applicationName}
- </if>
- <if test="params.obligeeName !=null and params.obligeeName!=''">
- and e.name REGEXP #{params.obligeeName}
- </if>
- <if test="params.numberIpc !=null and params.numberIpc!=''">
- and f.code like concat("%", #{params.numberIpc}, "%")
- </if>
- <if test="params.numberCpc !=null and params.numberCpc!=''">
- and g.code like concat("%", #{params.numberCpc}, "%")
- </if>
- <if test="params.numberUpc !=null and params.numberUpc!=''">
- and h.code like concat("%", #{params.numberUpc}, "%")
- </if>
- <if test="params.patentNo !=null and params.patentNo !=''">
- and a.patentNo REGEXP #{params.patentNo}
- </if>
- <if test="params.applicationNo !=null and params.applicationNo !=''">
- and a.applicationNo like concat("%", #{params.applicationNo}, "%")
- </if>
- <if test="params.abstractStr !=null and params.abstractStr !=''">
- and a.abstract like concat("%", #{params.abstractStr}, "%")
- </if>
- <if test="params.patentName !=null and params.patentName !=''">
- and a.`name` like concat("%", #{params.patentName}, "%")
- </if>
- <if test="params.PasOptions !=null and params.PasOptions.size()!=0">
- and (
- <foreach item="item" collection="params.PasOptions" index="index" open="(" separator="or"
- close=")">
- <if test="item.key !=null">
- (j.cid=#{item.fieldId} and j.fid =#{item.key})
- </if>
- <if test="item.key ==null">
- (j.cid is null or j.cid !=#{item.fieldId})
- </if>
- </foreach>
- )
- </if>
- <if test="params.orderItem!=null and params.orderItem!='SysOrder'">
- order by #{params.orderItem}
- <if test="params.orderType!=null">
- #{params.orderType}
- </if>
- </if>
- <if test="params.orderItem==null">
- order by a.patentno
- </if>
- <if test="params.orderItem=='SysOrder' and params.patentNos != null and params.patentNos.size()!=0">
- order by field (a.patentno,
- <foreach item="item" collection="params.patentNos" index="index" open="" separator=","
- close=")">
- #{item}
- </foreach>
- </if>
- <if test=" params.endNumber > 0">
- limit #{params.startNumber},#{params.endNumber}
- </if>
- </when>
- <otherwise>
- 1!=1
- </otherwise>
- </choose>
- </where>
- </select>
- <select id="getPageListForRMS2" parameterType="cn.cslg.pas.common.model.vo.PatentVO"
- resultType="cn.cslg.pas.domain.Patent">
- select DISTINCT a.id, a.`name` as name, a.nameout as name_out, a.patentno as patent_no, a.abstract_path,
- a.abstract as
- abstract_str, a.abstractout as abstract_out,
- a.publicno as public_no, a.publicdate as public_date, a.simple_family, a.inpadoc_family, a.applicationno as
- application_no, a.appdate as application_date,
- a.`status` as simple_status, a.type, a.publictodate as public_accredit_date, a.fpublicdate as first_public_date,
- a.prioritydate as priority_date,
- a.agencyid as agency_id, a.num2 as right_num, a.quoteno as quote_num, a.quotedno as quoted_num,
- a.patsnap_family as patSnapFamily, a.patsnapfamilynum as patSnapFamilyNum
- from os_patent a
- <if test="params.applicationName !=null ">
- left join os_applicant_attr b on a.id=b.pid and b.type =1
- left join os_patent_applicant c on c.id=b.applicantid
- </if>
- <if test=" params.obligeeName !=null">
- left join os_applicant_attr d on a.id=d.pid and d.type =2
- left join os_patent_applicant e on e.id=d.applicantid
- </if>
- <if test="params.numberIpc!=null ">
- left join os_patent_typeno f on f.pid =a.id and f.type =1
- </if>
- <if test=" params.numberCpc!=null ">
- left join os_patent_typeno g on g.pid =a.id and g.type =2
- </if>
- <if test=" params.numberUpc!=null">
- left join os_patent_typeno h on h.pid =a.id and h.type =3
- </if>
- <if test="params.projectId != null and params.pasOptions !=null and params.pasOptions.size()!=0">
- left join os_thematic_pid i on i.pid=a.id left join os_patent_field_patent_link j on a.id=j.pid
- </if>
- <where>
- <choose>
- <when test="params.projectId != null or (params.patentNos != null and params.patentNos.size()!=0) or params.reportId!=null ">
- <if test="params.projectId != null">
- and ( a.id in (select pid from os_thematic_pid where zid = #{params.projectId})
- <if test="params.patentNos != null and params.patentNos.size()!=0">
- or patentno in
- <foreach item="item" collection="params.patentNos" index="index" open="(" separator=","
- close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.reportId != null">
- or patentno in
- ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
- )
- </if>
- )
- </if>
- <if test="params.projectId == null and params.patentNos != null and params.patentNos.size()!=0">
- (patentno in
- <foreach item="item" collection="params.patentNos" index="index" open="(" separator=","
- close=")">
- #{item}
- </foreach>
- <if test="params.reportId != null">
- or patentno in
- ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
- )
- </if>
- )
- </if>
- <if test="params.projectId == null and (params.patentNos == null or params.patentNos.size()==0) and params.reportId != null">
- patentno in
- ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
- )
- </if>
- <if test="params.notInPatentNos != null and params.notInPatentNos.size!=0">
- and patentno not in
- <foreach item="item" collection="params.notInPatentNos" index="index" open="(" separator=","
- close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.conPatentNos != null and params.conPatentNos.size!=0">
- and patentno in
- <foreach item="item" collection="params.conPatentNos" index="index" open="(" separator=","
- close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.applicationName !=null and params.applicationName !='' ">
- and c.name REGEXP #{params.applicationName}
- </if>
- <if test="params.obligeeName !=null and params.obligeeName!=''">
- and e.name REGEXP #{params.obligeeName}
- </if>
- <if test="params.numberIpc !=null and params.numberIpc!=''">
- and f.code like concat("%", #{params.numberIpc}, "%")
- </if>
- <if test="params.numberCpc !=null and params.numberCpc!=''">
- and g.code like concat("%", #{params.numberCpc}, "%")
- </if>
- <if test="params.numberUpc !=null and params.numberUpc!=''">
- and h.code like concat("%", #{params.numberUpc}, "%")
- </if>
- <if test="params.patentNo !=null and params.patentNo !=''">
- and a.patentNo REGEXP #{params.patentNo}
- </if>
- <if test="params.applicationNo !=null and params.applicationNo !=''">
- and a.applicationNo like concat("%", #{params.applicationNo}, "%")
- </if>
- <if test="params.abstractStr !=null and params.abstractStr !=''">
- and a.abstract like concat("%", #{params.abstractStr}, "%")
- </if>
- <if test="params.patentName !=null and params.patentName !=''">
- and a.`name` like concat("%", #{params.patentName}, "%")
- </if>
- <if test="params.PasOptions !=null and params.PasOptions.size()!=0">
- and (
- <foreach item="item" collection="params.PasOptions" index="index" open="(" separator="or"
- close=")">
- <if test="item.key !=null">
- (j.cid=#{item.fieldId} and j.fid =#{item.key})
- </if>
- <if test="item.key ==null">
- (j.cid is null or j.cid !=#{item.fieldId})
- </if>
- </foreach>
- )
- </if>
- <if test="params.orderItem!=null and params.orderItem!='SysOrder'">
- order by #{params.orderItem}
- <if test="params.orderType!=null">
- #{params.orderType}
- </if>
- </if>
- <if test="params.orderItem==null">
- order by a.patentno
- </if>
- <if test="params.orderItem=='SysOrder' and params.patentNos != null and params.patentNos.size()!=0">
- order by field (a.patentno,
- <foreach item="item" collection="params.patentNos" index="index" open="" separator=","
- close=")">
- #{item}
- </foreach>
- </if>
- </when>
- <otherwise>
- 1!=1
- </otherwise>
- </choose>
- </where>
- </select>
- <select id="getConPantentNos" parameterType="cn.cslg.pas.common.model.QueryPatentVO"
- resultType="java.lang.String">
- select DISTINCT a.patentno as patent_no
- from os_patent a
- <if test="params.applicationName !=null ">
- left join os_applicant_attr b on a.id=b.pid and b.type =1
- left join os_patent_applicant c on c.id=b.applicantid
- </if>
- <if test=" params.obligeeName !=null">
- left join os_applicant_attr d on a.id=d.pid and d.type =2
- left join os_patent_applicant e on e.id=d.applicantid
- </if>
- <if test="params.numberIpc!=null ">
- left join os_patent_typeno f on f.pid =a.id and f.type =1
- </if>
- <if test=" params.numberCpc!=null ">
- left join os_patent_typeno g on g.pid =a.id and g.type =2
- </if>
- <if test=" params.numberUpc!=null">
- left join os_patent_typeno h on h.pid =a.id and h.type =3
- </if>
- <where>
- <choose>
- <when test="params.projectId != null or (params.patentNos != null and params.patentNos.size()!=0) or params.reportId!=null ">
- <if test="params.projectId != null">
- and ( a.id in (select pid from os_thematic_pid where zid = #{params.projectId})
- <if test="params.patentNos != null and params.patentNos.size()!=0">
- or patentno in
- <foreach item="item" collection="params.patentNos" index="index" open="(" separator=","
- close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.reportId != null">
- or patentno in
- ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
- )
- </if>
- )
- </if>
- <if test="params.projectId == null and params.patentNos != null and params.patentNos.size()!=0">
- (patentno in
- <foreach item="item" collection="params.patentNos" index="index" open="(" separator=","
- close=")">
- #{item}
- </foreach>
- <if test="params.reportId != null">
- or patentno in
- ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
- )
- </if>
- )
- </if>
- <if test="params.projectId == null and (params.patentNos == null or params.patentNos.size()==0) and params.reportId != null">
- patentno in
- ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
- )
- </if>
- <if test="params.notInPatentNos != null and params.notInPatentNos.size!=0">
- and patentno not in
- <foreach item="item" collection="params.notInPatentNos" index="index" open="(" separator=","
- close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.conPatentNos != null and params.conPatentNos.size!=0">
- and patentno in
- <foreach item="item" collection="params.conPatentNos" index="index" open="(" separator=","
- close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.applicationName !=null and params.applicationName !='' ">
- and c.name like concat("%",#{params.applicationName}, "%")
- </if>
- <if test="params.obligeeName !=null and params.obligeeName!=''">
- and e.name like concat("%", #{params.obligeeName}, "%")
- </if>
- <if test="params.numberIpc !=null and params.numberIpc!=''">
- and f.code like concat("%", #{params.numberIpc}, "%")
- </if>
- <if test="params.numberCpc !=null and params.numberCpc!=''">
- and g.code like concat("%", #{params.numberCpc}, "%")
- </if>
- <if test="params.numberUpc !=null and params.numberUpc!=''">
- and h.code like concat("%", #{params.numberUpc}, "%")
- </if>
- <if test="params.patentNo !=null and params.patentNo !=''">
- and a.patentNo like concat("%",#{params.patentNo}, "%")
- </if>
- <if test="params.applicationNo !=null and params.applicationNo !=''">
- and a.applicationNo like concat("%", #{params.applicationNo}, "%")
- </if>
- <if test="params.abstractStr !=null and params.abstractStr !=''">
- and a.abstract like concat("%", #{params.abstractStr}, "%")
- </if>
- <if test="params.patentName !=null and params.patentName !=''">
- and a.`name` like concat("%", #{params.patentName}, "%")
- </if>
- <if test="params.startNumber!=null and params.endNumber!=null">
- limit #{params.startNumber} , #{params.endNumber}
- </if>
- </when>
- <otherwise>
- 1!=1
- </otherwise>
- </choose>
- </where>
- </select>
- <select id="getConPantents" parameterType="cn.cslg.pas.common.model.QueryPatentVO" resultType="cn.cslg.pas.domain.Patent">
- select DISTINCT a.id, a.`name` as name, a.nameout as name_out, a.patentno as patent_no, a.abstract_path,
- a.abstract as
- abstract_str, a.abstractout as abstract_out,
- a.publicno as public_no, a.publicdate as public_date, a.simple_family, a.inpadoc_family, a.applicationno as
- application_no, a.appdate as application_date,
- a.`status` as simple_status, a.type, a.publictodate as public_accredit_date, a.fpublicdate as first_public_date,
- a.prioritydate as priority_date,
- a.agencyid as agency_id, a.num2 as right_num, a.quoteno as quote_num, a.quotedno as quoted_num,
- a.patsnap_family as patSnapFamily, a.patsnapfamilynum as patSnapFamilyNum
- from os_patent a
- <if test="params.applicationName !=null ">
- left join os_applicant_attr b on a.id=b.pid and b.type =1
- left join os_patent_applicant c on c.id=b.applicantid
- </if>
- <if test=" params.obligeeName !=null">
- left join os_applicant_attr d on a.id=d.pid and d.type =2
- left join os_patent_applicant e on e.id=d.applicantid
- </if>
- <if test="params.numberIpc!=null ">
- left join os_patent_typeno f on f.pid =a.id and f.type =1
- </if>
- <if test=" params.numberCpc!=null ">
- left join os_patent_typeno g on g.pid =a.id and g.type =2
- </if>
- <if test=" params.numberUpc!=null">
- left join os_patent_typeno h on h.pid =a.id and h.type =3
- </if>
- <if test="params.projectId != null and params.pasOptions !=null and params.pasOptions.size()!=0">
- left join os_thematic_pid i on i.pid=a.id left join os_patent_field_patent_link j on a.id=j.pid
- </if>
- <where>
- <choose>
- <when test="params.projectId != null or (params.patentNos != null and params.patentNos.size()!=0) or params.reportId!=null ">
- <if test="params.projectId != null">
- and ( a.id in (select pid from os_thematic_pid where zid = #{params.projectId})
- <if test="params.patentNos != null and params.patentNos.size()!=0">
- or patentno in
- <foreach item="item" collection="params.patentNos" index="index" open="(" separator=","
- close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.reportId != null">
- or patentno in
- ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
- )
- </if>
- )
- </if>
- <if test="params.projectId == null and params.patentNos != null and params.patentNos.size()!=0">
- (patentno in
- <foreach item="item" collection="params.patentNos" index="index" open="(" separator=","
- close=")">
- #{item}
- </foreach>
- <if test="params.reportId != null">
- or patentno in
- ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
- )
- </if>
- )
- </if>
- <if test="params.projectId == null and (params.patentNos == null or params.patentNos.size()==0) and params.reportId != null">
- patentno in
- ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
- )
- </if>
- <if test="params.notInPatentNos != null and params.notInPatentNos.size!=0">
- and patentno not in
- <foreach item="item" collection="params.notInPatentNos" index="index" open="(" separator=","
- close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.conPatentNos != null and params.conPatentNos.size!=0">
- and patentno in
- <foreach item="item" collection="params.conPatentNos" index="index" open="(" separator=","
- close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.applicationName !=null and params.applicationName !='' ">
- and c.name REGEXP #{params.applicationName}
- </if>
- <if test="params.obligeeName !=null and params.obligeeName!=''">
- and e.name REGEXP #{params.obligeeName}
- </if>
- <if test="params.numberIpc !=null and params.numberIpc!=''">
- and f.code like concat("%", #{params.numberIpc}, "%")
- </if>
- <if test="params.numberCpc !=null and params.numberCpc!=''">
- and g.code like concat("%", #{params.numberCpc}, "%")
- </if>
- <if test="params.numberUpc !=null and params.numberUpc!=''">
- and h.code like concat("%", #{params.numberUpc}, "%")
- </if>
- <if test="params.patentNo !=null and params.patentNo !=''">
- and a.patentNo REGEXP #{params.patentNo}
- </if>
- <if test="params.applicationNo !=null and params.applicationNo !=''">
- and a.applicationNo like concat("%", #{params.applicationNo}, "%")
- </if>
- <if test="params.abstractStr !=null and params.abstractStr !=''">
- and a.abstract like concat("%", #{params.abstractStr}, "%")
- </if>
- <if test="params.patentName !=null and params.patentName !=''">
- and a.`name` like concat("%", #{params.patentName}, "%")
- </if>
- <if test="params.PasOptions !=null and params.PasOptions.size()!=0">
- and (
- <foreach item="item" collection="params.PasOptions" index="index" open="(" separator="or"
- close=")">
- <if test="item.key !=null">
- (j.cid=#{item.fieldId} and j.fid =#{item.key})
- </if>
- <if test="item.key ==null">
- (j.cid is null or j.cid !=#{item.fieldId})
- </if>
- </foreach>
- )
- </if>
- <if test="params.orderItem!=null and params.orderItem!='SysOrder'">
- order by #{params.orderItem}
- <if test="params.orderType!=null">
- #{params.orderType}
- </if>
- </if>
- <if test="params.orderItem==null">
- order by a.patentno
- </if>
- <if test="params.orderItem=='SysOrder' and params.patentNos != null and params.patentNos.size()!=0">
- order by field (a.patentno,
- <foreach item="item" collection="params.patentNos" index="index" open="" separator=","
- close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.startNumber!=null and params.endNumber!=null">
- limit #{params.startNumber} , #{params.endNumber}
- </if>
- </when>
- <otherwise>
- 1!=1
- </otherwise>
- </choose>
- </where>
- </select>
- <select id="getConPantentsCount" parameterType="cn.cslg.pas.common.model.QueryPatentVO" resultType="java.lang.Integer">
- select count(*)
- from os_patent a
- <if test="params.applicationName !=null ">
- left join os_applicant_attr b on a.id=b.pid and b.type =1
- left join os_patent_applicant c on c.id=b.applicantid
- </if>
- <if test=" params.obligeeName !=null">
- left join os_applicant_attr d on a.id=d.pid and d.type =2
- left join os_patent_applicant e on e.id=d.applicantid
- </if>
- <if test="params.numberIpc!=null ">
- left join os_patent_typeno f on f.pid =a.id and f.type =1
- </if>
- <if test=" params.numberCpc!=null ">
- left join os_patent_typeno g on g.pid =a.id and g.type =2
- </if>
- <if test=" params.numberUpc!=null">
- left join os_patent_typeno h on h.pid =a.id and h.type =3
- </if>
- <if test="params.projectId != null and params.pasOptions !=null and params.pasOptions.size()!=0">
- left join os_thematic_pid i on i.pid=a.id left join os_patent_field_patent_link j on a.id=j.pid
- </if>
- <where>
- <choose>
- <when test="params.projectId != null or (params.patentNos != null and params.patentNos.size()!=0) or params.reportId!=null ">
- <if test="params.projectId != null">
- and ( a.id in (select pid from os_thematic_pid where zid = #{params.projectId})
- <if test="params.patentNos != null and params.patentNos.size()!=0">
- or patentno in
- <foreach item="item" collection="params.patentNos" index="index" open="(" separator=","
- close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.reportId != null">
- or patentno in
- ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
- )
- </if>
- )
- </if>
- <if test="params.projectId == null and params.patentNos != null and params.patentNos.size()!=0">
- (patentno in
- <foreach item="item" collection="params.patentNos" index="index" open="(" separator=","
- close=")">
- #{item}
- </foreach>
- <if test="params.reportId != null">
- or patentno in
- ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
- )
- </if>
- )
- </if>
- <if test="params.projectId == null and (params.patentNos == null or params.patentNos.size()==0) and params.reportId != null">
- patentno in
- ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
- )
- </if>
- <if test="params.notInPatentNos != null and params.notInPatentNos.size!=0">
- and patentno not in
- <foreach item="item" collection="params.notInPatentNos" index="index" open="(" separator=","
- close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.conPatentNos != null and params.conPatentNos.size!=0">
- and patentno in
- <foreach item="item" collection="params.conPatentNos" index="index" open="(" separator=","
- close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.applicationName !=null and params.applicationName !='' ">
- and c.name REGEXP #{params.applicationName}
- </if>
- <if test="params.obligeeName !=null and params.obligeeName!=''">
- and e.name REGEXP #{params.obligeeName}
- </if>
- <if test="params.numberIpc !=null and params.numberIpc!=''">
- and f.code like concat("%", #{params.numberIpc}, "%")
- </if>
- <if test="params.numberCpc !=null and params.numberCpc!=''">
- and g.code like concat("%", #{params.numberCpc}, "%")
- </if>
- <if test="params.numberUpc !=null and params.numberUpc!=''">
- and h.code like concat("%", #{params.numberUpc}, "%")
- </if>
- <if test="params.patentNo !=null and params.patentNo !=''">
- and a.patentNo REGEXP #{params.patentNo}
- </if>
- <if test="params.applicationNo !=null and params.applicationNo !=''">
- and a.applicationNo like concat("%", #{params.applicationNo}, "%")
- </if>
- <if test="params.abstractStr !=null and params.abstractStr !=''">
- and a.abstract like concat("%", #{params.abstractStr}, "%")
- </if>
- <if test="params.patentName !=null and params.patentName !=''">
- and a.`name` like concat("%", #{params.patentName}, "%")
- </if>
- <if test="params.PasOptions !=null and params.PasOptions.size()!=0">
- and (
- <foreach item="item" collection="params.PasOptions" index="index" open="(" separator="or"
- close=")">
- <if test="item.key !=null">
- (j.cid=#{item.fieldId} and j.fid =#{item.key})
- </if>
- <if test="item.key ==null">
- (j.cid is null or j.cid !=#{item.fieldId})
- </if>
- </foreach>
- )
- </if>
- <if test="params.orderItem!=null and params.orderItem!='SysOrder'">
- order by #{params.orderItem}
- <if test="params.orderType!=null">
- #{params.orderType}
- </if>
- </if>
- <if test="params.orderItem==null">
- order by a.patentno
- </if>
- <if test="params.orderItem=='SysOrder' and params.patentNos != null and params.patentNos.size()!=0">
- order by field (a.patentno,
- <foreach item="item" collection="params.patentNos" index="index" open="" separator=","
- close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.startNumber!=null and params.endNumber!=null">
- limit #{params.startNumber} , #{params.endNumber}
- </if>
- </when>
- <otherwise>
- 1!=1
- </otherwise>
- </choose>
- </where>
- </select>
- <select id="getPatent" parameterType="java.util.List" resultType="cn.cslg.pas.domain.Patent">
- select a.id, a.`name` as name, a.nameout as name_out, a.patentno as patent_no, a.abstract_path, a.abstract as
- abstract_str, a.abstractout as abstract_out,
- a.publicno as public_no, a.publicdate as public_date, a.simple_family, a.inpadoc_family, a.applicationno as
- application_no, a.appdate as application_date,
- a.`status` as simple_status, a.type, a.publictodate as public_accredit_date, a.fpublicdate as first_public_date,
- a.prioritydate as priority_date,
- a.agencyid as agency_id, a.num2 as right_num, a.quoteno as quote_num, a.quotedno as quoted_num,
- a.quote,
- a.patsnap_family as patSnapFamily, a.patsnapfamilynum as patSnapFamilyNum
- from os_patent a
- <where>
- <if test="patentNo != null and patentNo.size!=0">
- patentno in
- <foreach item="item" collection="patentNo" index="index" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="patentNo == null or patentNo.size==0">
- 1!=1
- </if>
- <if test="n!=-1 and p!=-1">
- limit #{n},#{p}
- </if>
- </where>
- </select>
- <!-- int getPatentNumber(@Param("patentNo")List<String> patentNo);-->
- <select id="getPatentNumber" resultType="java.lang.Integer">
- select count(*) from os_patent
- where patentno in
- <foreach item="item" collection="patentNo" index="index" open="(" separator="," close=")">
- #{item}
- </foreach>
- </select>
- </mapper>
|