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
delete from OS_PATENT_FIELD where REPORT_ID=#{reportId} and ID=#{id}
update OS_PATENT_FIELD set`NAME`=#{name},PTYPE=#{ptype},`TYPE`=#{type},STATUS=#{status},REMARK=#{remark},
CID=#{createBy},CREATE_TIME=#{createTime},REPORT_TYPE=#{reportType} where REPORT_ID=#{reportId} and ID=#{id}