select ifnull(${type}(${column}), 0) from os_patent where id in (
${ids} ) and ${column} is not null
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 (${ids} ) and cid = ${field})
select distinct b.pid
from os_patent_field_text a
left join os_patent_field_patent_link b on a.id = b.fid
and a.cid = #{field} and a.`name` ${mino} #{minv} and a.`name` ${maxo} #{maxv}
and b.pid in
#{item}
select distinct b.pid
from os_patent_field_text a
left join os_patent_field_patent_link b on a.id = b.fid
and a.cid = #{field} and (unix_timestamp(a.`name`) between #{startDate} and #{endDate})
and b.pid in
#{item}
select ${column}
from os_patent
where id = #{id}
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
left join os_portfolio_link b on b.pid = a.id
left join os_thematic_pid b on b.pid = a.id
left join os_patent_label d on d.pid = a.id and d.tid = b.zid
left join os_applicant_attr e on e.type = 2 and e.pid = a.id
left join os_applicant_attr f on f.type = 1 and f.pid = a.id
left join os_patent_inventor_relation g on g.pid = a.id
left join os_patent_inventor g1 on g1.id = g.fid
left join os_patent_inventor_merge g2 on g2.inventor_id = g.fid
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
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
left join os_associate_applicant j on e.applicantid = j.applicantid
left join os_associate_applicant k on f.applicantid = k.applicantid
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
left join os_patent_affair p on p.pid = a.id
left join os_patent_typeno q1 on q1.pid = a.id
left join os_patent_typeno q2 on q2.pid = a.id
left join os_patent_typeno q3 on q3.pid = a.id
left join os_patent_typeno q4 on q4.pid = a.id
left join os_patent_field_patent_link a2 on a2.pid = a.id
and b.look = 1
and b.look = 0
and b.zid = #{params.projectId}
and a.patentno in
( select PATENT_NO from ASSO_IMPORTTASK_PATENT where IMPORTTASK_ID in
#{item}
)
and (b.zid = #{params.projectId} or
a.patentno in
( select PATENT_NO from ASSO_IMPORTTASK_PATENT where IMPORTTASK_ID in
#{item}
)
)
and 1 !=1
and b.fid = #{params.folder}
and (${params.nameSql})
and (${params.abstractStrSql})
and (${params.publicNoSql})
and (${params.applicationNoSql})
and (select count(*) from os_patent_right where a.id = patent_id and (${params.rightContentSql})) > 0
and (a.simple_family = (select id from os_patent_simplefamily where type = 1 and patent_no = a.patentno)
or a.simple_family is null)
and (a.inpadoc_family = (select id from os_patent_simplefamily where type = 2 and patent_no =
a.patentno) or a.inpadoc_family is null)
and (a.patsnap_family = (select id from os_patent_simplefamily where type = 3 and patent_no =
a.patentno) or a.patsnap_family is null)
and q1.type = 1 and
left(q1.code, 1)
left(q1.code, 3)
left(q1.code, 4)
substring_index(q1.code, '/', 1)
q1.code
= #{item}
and q2.type = 2 and
left(q2.code, 1)
left(q2.code, 3)
left(q2.code, 4)
substring_index(q2.code, '/', 1)
q2.code
= #{item}
and q3.type = 3 and
q3.code
substring_index(q3.code, '/', 1)
substring_index(q3.code, '/', -1)
= #{item}
and q4.type = 4 and
q4.code
substring_index(q4.code, '/', 1)
substring_index(q4.code, '/', -1)
= #{item}
and e.applicantid in
#{item}
and f.applicantid in
#{item}
and g1.id in
#{item}
and (
g2.merge_id in
#{item}
or
g.fid in
#{item}
)
and h1.bname in
#{item}
and i1.bname in
#{item}
and (
j.mergeid in
#{item}
or
e.applicantid in
#{item}
)
and (
k.mergeid in
#{item}
or
f.applicantid in
#{item}
)
and a.bureau in
#{item}
and a.type in
#{item}
and a.status in
#{item}
and from_unixtime(a.appdate, '%Y') in
#{item}
and from_unixtime(a.publicdate, '%Y') in
#{item}
and o.country in
#{item}
and o.province_id in
#{item}
and p.status REGEXP #{params.whereAffair}
and d.tagname in
#{item}
and
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}
a4.fid in
#{item2}
or a4.id is null
)
group by a.id
order by
a.id
a.name
a.patentno
a.applicationno
a.appdate
a.publicdate
a.publictodate
a.num2
a.quoteno
a.quotedno
${params.sort.order}
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
and e.name is not null
and d.order = 0
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
and e.bname is not null
and d.order = 0
left join os_patent_inventor_relation d on d.pid = a.id
left join os_patent_inventor e on e.id = d.fid
and e.name is not null
select temp.* from ((
left join os_patent_inventor_relation d on d.pid = a.id
left join os_patent_inventor e on e.id = d.fid
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 (
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
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
left join os_patent_agency x on x.id = a.agencyid
and a.agencyid is not null
left join os_patent_agent_link x1 on x1.pid = a.id
left join os_patent_agent x2 on x2.id = x1.aid
and x2.id is not null
select temp.* from ((
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
and e.id not in (select applicantid from os_associate_applicant where tid = b.zid) and e.name is not null
and d.order = 0
group by e.id
) union all (
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
and e.name is not null and e.project_id = b.zid
and d.order = 0
group by e.id
)) as temp where 1 = 1 order by `count` desc, `value` asc
left join os_patent_typeno d on d.pid = a.id
and d.type = 1
left join os_patent_typeno d on d.pid = a.id
and d.type = 1
left join os_patent_typeno d on d.pid = a.id
and d.type = 1
left join os_patent_typeno d on d.pid = a.id
and d.type = 1
left join os_patent_typeno d on d.pid = a.id
and d.type = 1
left join os_patent_typeno d on d.pid = a.id
and d.type = 1 and d.main = 1
left join os_patent_typeno d on d.pid = a.id
and d.type = 1 and d.main = 1
left join os_patent_typeno d on d.pid = a.id
and d.type = 1 and d.main = 1
left join os_patent_typeno d on d.pid = a.id
and d.type = 1 and d.main = 1
left join os_patent_typeno d on d.pid = a.id
and d.type = 1 and d.main = 1
left join os_patent_typeno d on d.pid = a.id
and d.type = 2
left join os_patent_typeno d on d.pid = a.id
and d.type = 2
left join os_patent_typeno d on d.pid = a.id
and d.type = 2
left join os_patent_typeno d on d.pid = a.id
and d.type = 2
left join os_patent_typeno d on d.pid = a.id
and d.type = 2
left join os_patent_typeno d on d.pid = a.id
and d.type = 3
left join os_patent_typeno d on d.pid = a.id
and d.type = 3
left join os_patent_typeno d on d.pid = a.id
and d.type = 3
left join os_patent_typeno d on d.pid = a.id
and d.type = 4
left join os_patent_typeno d on d.pid = a.id
and d.type = 4
left join os_patent_typeno d on d.pid = a.id
and d.type = 4
and a.appdate > 0
and from_unixtime(a.appdate, '%Y') between #{params.startDate} and #{params.endDate}
and (a.bureau is not null or a.bureau != '')
left join os_system_dict c1 on a.type = c1.value and c1.type = 'PATENT_TYPE'
and c1.label is not null
left join os_system_dict c1 on a.status = c1.value and c1.type = 'PATENT_SIMPLE_STATUS'
and c1.label is not null
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'
and f.value is not null
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
and f.id is not null
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
and f.id is not null
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
and f.id is not null
left join os_system_dict f on a.prioritycountry = f.value and f.type = 'COUNTRIES'
and f.value is not null
and a.publicdate > 0
and from_unixtime(a.publicdate, '%Y') between #{params.startDate} and #{params.endDate}
left join os_patent_affair c1 on b.pid = c1.pid
left join os_system_dict d on d.label = c1.status
and d.value is not null
left join os_patent_label c1 on b.pid = c1.pid
and c1.tid = #{params.projectId}
select temp.* from ((
and a.id not in (select pid from os_patent_field_patent_link where cid = #{params.customFieldId})
) union all (
left join os_patent_field_patent_link e on e.pid = b.pid
left join os_patent_field c1 on c1.id = e.cid
left join os_patent_field_tree d on d.cid = e.cid
left join os_patent_field_text d on d.cid = e.cid and d.name is not null and d.name != ''
left join os_patent_field_multiple d on d.cid = e.cid
and c1.id = #{params.customFieldId}
and e.fid in (select id from os_patent_field_tree where cid = c1.id and find_in_set(d.id , replace(path
, '/', ',')))
and e.fid = d.id
group by d.id
)) as temp where 1 = 1 order by `count` desc, `value` asc
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
left join os_portfolio_link b on b.pid = a.id
left join os_thematic_pid b on b.pid = a.id
and b.zid = #{params.projectId}
and b.fid = #{params.folder}
and ${label} like concat('%', #{params.label}, '%')
and b.pid in
#{item}
group by
${groupBy}
order
by
`${orderBy}`
desc,
`value`
asc
select DISTINCT a.patentno as patent_no
from os_patent a
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
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
left join os_patent_typeno f on f.pid =a.id and f.type =1
left join os_patent_typeno g on g.pid =a.id and g.type =2
left join os_patent_typeno h on h.pid =a.id and h.type =3
left join os_thematic_pid i on i.pid=a.id left join os_patent_field_patent_link j on a.id=j.pid
and ( a.id in (select pid from os_thematic_pid where zid = #{params.projectId})
or patentno in
#{item}
or patentno in
( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
)
)
(patentno in
#{item}
or patentno in
( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
)
)
patentno in
( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
)
and patentno not in
#{item}
and patentno in
#{item}
and c.name REGEXP #{params.applicationName}
and e.name REGEXP #{params.obligeeName}
and f.code like concat("%", #{params.numberIpc}, "%")
and g.code like concat("%", #{params.numberCpc}, "%")
and h.code like concat("%", #{params.numberUpc}, "%")
and a.patentNo REGEXP #{params.patentNo}
and a.applicationNo like concat("%", #{params.applicationNo}, "%")
and a.abstract like concat("%", #{params.abstractStr}, "%")
and a.`name` like concat("%", #{params.patentName}, "%")
and (
(j.cid=#{item.fieldId} and j.fid =#{item.key})
(j.cid is null or j.cid !=#{item.fieldId})
)
order by #{params.orderItem}
#{params.orderType}
order by a.patentno
order by field (a.patentno,
#{item}
limit #{params.startNumber},#{params.endNumber}
1!=1
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
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
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
left join os_patent_typeno f on f.pid =a.id and f.type =1
left join os_patent_typeno g on g.pid =a.id and g.type =2
left join os_patent_typeno h on h.pid =a.id and h.type =3
left join os_thematic_pid i on i.pid=a.id left join os_patent_field_patent_link j on a.id=j.pid
and ( a.id in (select pid from os_thematic_pid where zid = #{params.projectId})
or patentno in
#{item}
or patentno in
( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
)
)
(patentno in
#{item}
or patentno in
( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
)
)
patentno in
( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
)
and patentno not in
#{item}
and patentno in
#{item}
and c.name REGEXP #{params.applicationName}
and e.name REGEXP #{params.obligeeName}
and f.code like concat("%", #{params.numberIpc}, "%")
and g.code like concat("%", #{params.numberCpc}, "%")
and h.code like concat("%", #{params.numberUpc}, "%")
and a.patentNo REGEXP #{params.patentNo}
and a.applicationNo like concat("%", #{params.applicationNo}, "%")
and a.abstract like concat("%", #{params.abstractStr}, "%")
and a.`name` like concat("%", #{params.patentName}, "%")
and (
(j.cid=#{item.fieldId} and j.fid =#{item.key})
(j.cid is null or j.cid !=#{item.fieldId})
)
order by #{params.orderItem}
#{params.orderType}
order by a.patentno
order by field (a.patentno,
#{item}
1!=1
select DISTINCT a.patentno as patent_no
from os_patent a
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
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
left join os_patent_typeno f on f.pid =a.id and f.type =1
left join os_patent_typeno g on g.pid =a.id and g.type =2
left join os_patent_typeno h on h.pid =a.id and h.type =3
and ( a.id in (select pid from os_thematic_pid where zid = #{params.projectId})
or patentno in
#{item}
or patentno in
( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
)
)
(patentno in
#{item}
or patentno in
( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
)
)
patentno in
( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
)
and patentno not in
#{item}
and patentno in
#{item}
and c.name like concat("%",#{params.applicationName}, "%")
and e.name like concat("%", #{params.obligeeName}, "%")
and f.code like concat("%", #{params.numberIpc}, "%")
and g.code like concat("%", #{params.numberCpc}, "%")
and h.code like concat("%", #{params.numberUpc}, "%")
and a.patentNo like concat("%",#{params.patentNo}, "%")
and a.applicationNo like concat("%", #{params.applicationNo}, "%")
and a.abstract like concat("%", #{params.abstractStr}, "%")
and a.`name` like concat("%", #{params.patentName}, "%")
limit #{params.startNumber} , #{params.endNumber}
1!=1
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
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
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
left join os_patent_typeno f on f.pid =a.id and f.type =1
left join os_patent_typeno g on g.pid =a.id and g.type =2
left join os_patent_typeno h on h.pid =a.id and h.type =3
left join os_thematic_pid i on i.pid=a.id left join os_patent_field_patent_link j on a.id=j.pid
and ( a.id in (select pid from os_thematic_pid where zid = #{params.projectId})
or patentno in
#{item}
or patentno in
( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
)
)
(patentno in
#{item}
or patentno in
( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
)
)
patentno in
( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
)
and patentno not in
#{item}
and patentno in
#{item}
and c.name REGEXP #{params.applicationName}
and e.name REGEXP #{params.obligeeName}
and f.code like concat("%", #{params.numberIpc}, "%")
and g.code like concat("%", #{params.numberCpc}, "%")
and h.code like concat("%", #{params.numberUpc}, "%")
and a.patentNo REGEXP #{params.patentNo}
and a.applicationNo like concat("%", #{params.applicationNo}, "%")
and a.abstract like concat("%", #{params.abstractStr}, "%")
and a.`name` like concat("%", #{params.patentName}, "%")
and (
(j.cid=#{item.fieldId} and j.fid =#{item.key})
(j.cid is null or j.cid !=#{item.fieldId})
)
order by #{params.orderItem}
#{params.orderType}
order by a.patentno
order by field (a.patentno,
#{item}
limit #{params.startNumber} , #{params.endNumber}
1!=1
select count(*)
from os_patent a
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
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
left join os_patent_typeno f on f.pid =a.id and f.type =1
left join os_patent_typeno g on g.pid =a.id and g.type =2
left join os_patent_typeno h on h.pid =a.id and h.type =3
left join os_thematic_pid i on i.pid=a.id left join os_patent_field_patent_link j on a.id=j.pid
and ( a.id in (select pid from os_thematic_pid where zid = #{params.projectId})
or patentno in
#{item}
or patentno in
( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
)
)
(patentno in
#{item}
or patentno in
( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
)
)
patentno in
( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
)
and patentno not in
#{item}
and patentno in
#{item}
and c.name REGEXP #{params.applicationName}
and e.name REGEXP #{params.obligeeName}
and f.code like concat("%", #{params.numberIpc}, "%")
and g.code like concat("%", #{params.numberCpc}, "%")
and h.code like concat("%", #{params.numberUpc}, "%")
and a.patentNo REGEXP #{params.patentNo}
and a.applicationNo like concat("%", #{params.applicationNo}, "%")
and a.abstract like concat("%", #{params.abstractStr}, "%")
and a.`name` like concat("%", #{params.patentName}, "%")
and (
(j.cid=#{item.fieldId} and j.fid =#{item.key})
(j.cid is null or j.cid !=#{item.fieldId})
)
order by #{params.orderItem}
#{params.orderType}
order by a.patentno
order by field (a.patentno,
#{item}
limit #{params.startNumber} , #{params.endNumber}
1!=1
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
patentno in
#{item}
1!=1
limit #{n},#{p}
select count(*) from os_patent
where patentno in
#{item}