Преглед изворни кода

查询对比文件修改 2023/2/24

lwhhszx пре 2 година
родитељ
комит
c2b49bba34

+ 2 - 9
PAS/src/main/java/cn/cslg/pas/common/model/QueryPatentVO.java

@@ -1,6 +1,7 @@
 package cn.cslg.pas.common.model;
 
 import cn.cslg.pas.common.model.vo.BaseVO;
+import cn.cslg.pas.common.model.vo.SourceVO;
 import com.baomidou.mybatisplus.annotation.TableField;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
@@ -37,8 +38,7 @@ public class QueryPatentVO extends BaseVO {
     private String orderItem;
 
     @Schema(description = "专题库自定义选项列表")
-    private List<SourceVO> PasOptions;
-
+    private List<SourceVO> pasOptions;
     @Schema(description = "专利号")
     private String patentNo;
 
@@ -56,11 +56,4 @@ public class QueryPatentVO extends BaseVO {
     @Schema(description = "标题")
     private String patentName;
 
-    @Data
-    public static class SourceVO {
-        //字段Id
-        private Integer fieldId;
-        //选项Id
-        private List<Integer>  key;
-    }
 }

+ 11 - 0
PAS/src/main/java/cn/cslg/pas/common/model/vo/SourceVO.java

@@ -0,0 +1,11 @@
+package cn.cslg.pas.common.model.vo;
+
+import lombok.Data;
+
+@Data
+public class SourceVO {
+    //字段Id
+    private Integer fieldId;
+    //选项Id
+    private Integer  key;
+}

+ 1 - 1
PAS/src/main/java/cn/cslg/pas/controller/SystemController.java

@@ -59,7 +59,7 @@ public class SystemController {
 
     @PostMapping("getComPantentNos")
     @Operation(summary = "获得对比专利号")
-    public String getComPantentNos(@RequestBody PatentVO params) {
+    public String getComPantentNos( @RequestBody QueryPatentVO params) {
         return patentService.getComPantentNos(params);
     }
 

+ 1 - 1
PAS/src/main/java/cn/cslg/pas/mapper/PatentMapper.java

@@ -38,7 +38,7 @@ public interface PatentMapper extends BaseMapper<Patent> {
 
     IPage<Patent> getPageList(Page<Patent> page, @Param("params") PatentVO params);
     IPage<Patent> getPageListForRMS2(Page<Patent> page, @Param("params") QueryPatentVO params);
-    List<String> getListForRMS( @Param("params") PatentVO params);
+    List<String> getListForRMS( @Param("params")QueryPatentVO params);
     List<Patent> getPageList(@Param("params") PatentVO params);
 
     IPage<PatentQueryFieldSourceDTO> getPatentQuerySourcePageList(Page<Patent> page, @Param("params") PatentQueryFieldSourceVO params, @Param("ids") List<Integer> patentIds);

+ 3 - 2
PAS/src/main/java/cn/cslg/pas/service/OAuth2Service.java

@@ -179,8 +179,8 @@ public class OAuth2Service {
     }
 
     /**
-     * @title 获得专题库筛选列表
-     * @description 获得分析系统自定义字段选项
+     * @title 获得专题库成员列表
+     * @description 获得专题库成员列表
      * @autor lrj
      */
 
@@ -194,4 +194,5 @@ public class OAuth2Service {
                 .build();
         return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
     }
+
 }

+ 1 - 2
PAS/src/main/java/cn/cslg/pas/service/PatentService.java

@@ -617,7 +617,7 @@ public class PatentService extends ServiceImpl<PatentMapper, Patent> {
     }
 
 // 获得对比专利号
-public String getComPantentNos(PatentVO params){
+public String getComPantentNos(QueryPatentVO params){
   List<String> patents = baseMapper.getListForRMS(params);
   return Response.success(patents);
 }
@@ -625,7 +625,6 @@ public String getComPantentNos(PatentVO params){
 // 获得带筛选条件的对比专利号
 public String getConPantentNos(QueryPatentVO params){
     List<String> patents = baseMapper.getConPantentNos(params);
-    System.out.println("你好");
     return Response.success(patents);
 }
     public PatentDTO getPatentDTOById(Integer id, Integer projectId) {

+ 157 - 28
PAS/src/main/resources/mapper/PatentMapper.xml

@@ -1280,30 +1280,153 @@
     <select id="getListForRMS" resultType="java.lang.String">
         select DISTINCT a.patentno as patent_no
         from os_patent a
+        <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>
+        <if test="params.projectId != null and params.pasOptions !=null and params.pasOptions.size()!=0">
+            left join os_thematic_pid i on i.pid=a.id left join os_patent_field_patent_link j on a.id=j.pid
+        </if>
         <where>
-             1 != 1
-            <if test="params.projectId != null">
-                or a.id in (select pid from os_thematic_pid where zid = #{params.projectId})
-            </if>
+            <choose>
+                <when test="params.projectId != null or (params.patentNos != null and params.patentNos.size()!=0) or (params.importTaskId != null and params.importTaskId.size()!=0)">
+                    <if test="params.projectId != null">
+                        and ( a.id in (select pid from os_thematic_pid where zid = #{params.projectId})
+                        <if test="params.patentNos != null and params.patentNos.size()!=0">
+                            or patentno in
+                            <foreach item="item" collection="params.patentNos" index="index" open="(" separator=","
+                                     close=")">
+                                #{item}
+                            </foreach>
+                        </if>
+                        <if test="params.importTaskId != null and params.importTaskId.size()!=0">
+                            or patentno in
+                            ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where IMPORTTASK_ID in
+                            <foreach item="item" collection="params.importTaskId" index="index" open="(" separator=","
+                                     close=") ">
+                                #{item}
+                            </foreach>
+                            )
+                        </if>
+                        )
+                    </if>
+                    <if test="params.projectId == null and params.patentNos != null and params.patentNos.size()!=0">
+                        (patentno in
+                        <foreach item="item" collection="params.patentNos" index="index" open="(" separator=","
+                                 close=")">
+                            #{item}
+                        </foreach>
+                        <if test="params.importTaskId != null and params.importTaskId.size()!=0">
+                            or patentno in
+                            ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where IMPORTTASK_ID in
+                            <foreach item="item" collection="params.importTaskId" index="index" open="(" separator=","
+                                     close=") ">
+                                #{item}
+                            </foreach>
+                            )
+                        </if>
+                        )
+                    </if>
+                    <if test="params.projectId == null and (params.patentNos == null or params.patentNos.size()==0) and params.importTaskId != null and params.importTaskId.size()!=0">
+                        patentno in
+                        ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where IMPORTTASK_ID in
+                        <foreach item="item" collection="params.importTaskId" index="index" open="(" separator=","
+                                 close=") ">
+                            #{item}
+                        </foreach>
+                        )
+                    </if>
+                    <if test="params.notInPatentNos != null and params.notInPatentNos.size!=0">
+                        and patentno not in
+                        <foreach item="item" collection="params.notInPatentNos" index="index" open="(" separator=","
+                                 close=")">
+                            #{item}
+                        </foreach>
+                    </if>
+                    <if test="params.conPatentNos != null and params.conPatentNos.size!=0">
+                        and patentno in
+                        <foreach item="item" collection="params.conPatentNos" index="index" open="(" separator=","
+                                 close=")">
+                            #{item}
+                        </foreach>
+                    </if>
 
-            <if test="params.patentNos != null and params.patentNos.size()!=0">
-                or patentno in
-                <foreach item="item" collection="params.patentNos" index="index" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
-            <if test="params.importTaskId != null and params.importTaskId.size()!=0">
-                or a.patentno in
-                ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where IMPORTTASK_ID in
-                <foreach item="item" collection="params.importTaskId" index="index" open="(" separator="," close=") ">
-                    #{item}
-                </foreach>
-                )
-            </if>
-            order by a.patentno
-            <if test="params.startNumber!=null and params.endNumber!=null">
-                limit #{params.startNumber} , #{params.endNumber}
-            </if>
+                    <if test="params.applicationName !=null and params.applicationName !=''  ">
+                        and c.name like concat("%",#{params.applicationName}, "%")
+                    </if>
+                    <if test="params.obligeeName !=null and params.obligeeName!=''">
+                        and e.name like concat("%", #{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 like concat("%",#{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.PasOptions !=null and params.PasOptions.size()!=0">
+                        and (
+                        <foreach item="item" collection="params.PasOptions" index="index" open="(" separator="or"
+                                 close=")">
+                            <if test="item.key !=null">
+                                (j.cid=#{item.fieldId} and j.fid =#{item.key})
+                            </if>
+                            <if test="item.key ==null">
+                                (j.cid is null or j.cid !=#{item.fieldId})
+                            </if>
+                        </foreach>
+                        )
+                    </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>
+                    limit #{params.startNumber-1},#{params.endNumber-1}
+                </when>
+
+                <otherwise>
+                    1!=1
+                </otherwise>
+            </choose>
         </where>
     </select>
 
@@ -1336,9 +1459,8 @@
         <if test=" params.numberUpc!=null">
             left join os_patent_typeno h on h.pid =a.id and h.type =3
         </if>
-        <if test="params.projectId != null and params.PasOptions !=null and params.PasOptions.size()!=0">
+        <if test="params.projectId != null and params.pasOptions !=null and params.pasOptions.size()!=0">
             left join os_thematic_pid i on i.pid=a.id left join os_patent_field_patent_link j on a.id=j.pid
-
         </if>
         <where>
             <choose>
@@ -1432,12 +1554,20 @@
                         and a.`name` like concat("%", #{params.patentName}, "%")
                     </if>
                     <if test="params.PasOptions !=null and params.PasOptions.size()!=0">
-                        and
-                        <foreach item="item" collection="params.PasOptions" index="index" open="(" separator="and"
+                        and (
+                        <foreach item="item" collection="params.PasOptions" index="index" open="(" separator="or"
                                  close=")">
-                            and #{item.fieldId}
+                        <if test="item.key !=null">
+                             (j.cid=#{item.fieldId} and j.fid =#{item.key})
+                        </if>
+                            <if test="item.key ==null">
+                                (j.cid is null or j.cid !=#{item.fieldId})
+                            </if>
                         </foreach>
+                        )
                     </if>
+
+
                     <if test="params.orderItem!=null and params.orderItem!='SysOrder'">
                         order by #{params.orderItem}
                         <if test="params.orderType!=null">
@@ -1446,7 +1576,6 @@
                     </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,