123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286 |
- <?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.asso.AssoProductPatentMapper">
- <!--批量插入数据-->
- <!--int insertBatch(List<AssoProductPicture> assoProductPictures);-->
- <insert id="insertBatch">
- insert into asso_product_patent (product_id,patent_no)
- values
- <foreach collection="patentNos" item="item" separator=",">
- (#{productId},#{item})
- </foreach>
- </insert>
- <select id="getPageListProductPatent" 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.productId !=null">
- left join asso_product_patent i on i.patent_no=a.patentno
- </if>
- <if test="params.structureId !=null and params.structureId !=''">
- left join asso_structure_patent t on t.patent_no =a.patentno
- </if>
- <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>
- <if test="params.productId !=null">
- and i.product_id =#{params.productId}
- </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.structureId !=null and params.structureId !=''">
- and find_in_set(#{params.structureId}, t.path)
- </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>
- </where>
- </select>
- <select id="getPageListStructurePatent" 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.productId !=null and params.productId !=''">
- left join asso_structure_patent t on t.patent_no =a.patentno
- </if>
- <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>
- <if test="params.productId !=null">
- and t.product_id =#{params.productId}
- </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.structureId !=null and params.structureId !=''">
- and find_in_set(#{params.structureId}, t.path)
- </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>
- </where>
- </select>
- <select id="getPatentNos" resultType="java.lang.String">
- select a.patentno as patent_no
- from os_patent a
- left join asso_product_patent i on i.patent_no=a.patentno
- and i.product_id =#{params.productId}
- <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>
- <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.isIn ==0">
- and (i.product_id is null)
- </if>
- <if test="params.isIn !=0">
- and (i.product_id =#{params.productId})
- </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>
- </where>
- </select>
- <!--插入数据-->
- <!--int insert(AssoProductPatent assoProductPatent);-->
- <insert id="insert" useGeneratedKeys="true" keyProperty="id">
- insert into asso_product_patent (patent_no, product_id)
- values (#{patentNo}, #{productId});
- </insert>
- <!--根据产品id删除数据-->
- <!--int deleteByProductId(Integer productId);-->
- <delete id="deleteByProductId">
- delete
- from asso_product_patent
- where product_id = #{productId};
- </delete>
- </mapper>
|