PatentApplicantMapper.xml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="cn.cslg.pas.mapper.PatentApplicantMapper">
  4. <select id="getPageList" parameterType="cn.cslg.pas.common.model.vo.PatentApplicantVO" resultType="cn.cslg.pas.domain.PatentApplicant">
  5. select a.id, a.name, a.bname as short_name, a.remark, a.type, a.country, a.address as address_str, a.merge,
  6. a.project_id, a.update_time
  7. from os_patent_applicant a
  8. <where>
  9. <if test="params.name != '' and params.name != null">
  10. and a.name like concat('%', #{params.name}, '%')
  11. </if>
  12. <if test="params.country != '' and params.country != null">
  13. and a.country = #{params.country}
  14. </if>
  15. <if test="params.shortName != '' and params.shortName != null">
  16. and a.bname like concat('%', #{params.shortName}, '%')
  17. </if>
  18. <if test="params.from == 'exist'">
  19. and a.id in (
  20. select applicantid from os_applicant_attr c
  21. left join os_thematic_pid b on b.zid = #{params.projectId}
  22. where
  23. c.pid = b.pid and
  24. c.applicantid in (select applicantid from os_associate_applicant d where d.mergeid = #{params.mergeId})
  25. )
  26. and a.id != #{params.mergeId}
  27. </if>
  28. <if test="params.from == 'select'">
  29. and (a.id in (
  30. select applicantid from os_applicant_attr c
  31. left join os_thematic_pid b on b.zid = #{params.projectId}
  32. where
  33. c.pid = b.pid and
  34. c.applicantid not in (select applicantid from os_associate_applicant d where d.tid = #{params.projectId})
  35. ) or a.project_id = #{params.projectId})
  36. and a.id != #{params.mergeId}
  37. </if>
  38. <if test="params.from == 'merge'">
  39. and a.project_id = #{params.projectId} and a.merge = 1
  40. </if>
  41. order by a.`${params.prop}` ${params.order}
  42. </where>
  43. </select>
  44. <select id="getNames" resultType="java.lang.String">
  45. select a.name from os_patent_applicant a GROUP BY a.name having count(*)>1;
  46. </select>
  47. </mapper>