1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?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.PatentApplicantMapper">
- <select id="getPageList" parameterType="cn.cslg.pas.common.model.vo.PatentApplicantVO" resultType="cn.cslg.pas.domain.PatentApplicant">
- select a.id, a.name, a.bname as short_name, a.remark, a.type, a.country, a.address as address_str, a.merge,
- a.project_id, a.update_time
- from os_patent_applicant a
- <where>
- <if test="params.name != '' and params.name != null">
- and a.name like concat('%', #{params.name}, '%')
- </if>
- <if test="params.country != '' and params.country != null">
- and a.country = #{params.country}
- </if>
- <if test="params.shortName != '' and params.shortName != null">
- and a.bname like concat('%', #{params.shortName}, '%')
- </if>
- <if test="params.from == 'exist'">
- and a.id in (
- select applicantid from os_applicant_attr c
- left join os_thematic_pid b on b.zid = #{params.projectId}
- where
- c.pid = b.pid and
- c.applicantid in (select applicantid from os_associate_applicant d where d.mergeid = #{params.mergeId})
- )
- and a.id != #{params.mergeId}
- </if>
- <if test="params.from == 'select'">
- and (a.id in (
- select applicantid from os_applicant_attr c
- left join os_thematic_pid b on b.zid = #{params.projectId}
- where
- c.pid = b.pid and
- c.applicantid not in (select applicantid from os_associate_applicant d where d.tid = #{params.projectId})
- ) or a.project_id = #{params.projectId})
- and a.id != #{params.mergeId}
- </if>
- <if test="params.from == 'merge'">
- and a.project_id = #{params.projectId} and a.merge = 1
- </if>
- order by a.`${params.prop}` ${params.order}
- </where>
- </select>
- <select id="getNames" resultType="java.lang.String">
- select a.name from os_patent_applicant a GROUP BY a.name having count(*)>1;
- </select>
- </mapper>
|