Browse Source

优化上一页,下一页

lwhhszx 2 năm trước cách đây
mục cha
commit
174546db59

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

@@ -76,6 +76,11 @@ public class SystemController {
         return patentService.getConPantents(params);
     }
 
+    @PostMapping("getConPantentsCount")
+    @Operation(summary = "获得条件过滤的专利")
+    public String getConPantentsCount(@RequestBody QueryPatentVO params) {
+        return patentService.getConPantentsCount(params);
+    }
     @PostMapping("getPatentDTOListForRMS")
     @Operation(summary = "获得所有对比文件详细信息")
     public String getPatentDTOListForRMS(@RequestBody PatentVO params) {

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

@@ -57,6 +57,6 @@ public interface PatentMapper extends BaseMapper<Patent> {
     int getPatentNumber(@Param("patentNo")List<String> patentNo);
     List<String> getConPantentNos(@Param("params") QueryPatentVO params);
     List<Patent> getConPantents(@Param("params") QueryPatentVO params);
-
+    Integer getConPantentsCount(@Param("params") QueryPatentVO params);
 }
 

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

@@ -707,7 +707,13 @@ public class PatentService extends ServiceImpl<PatentMapper, Patent> {
         List<Patent> patents = baseMapper.getConPantents(params);
         return Response.success(patents);
     }
-
+    public String getConPantentsCount(QueryPatentVO params) {
+        if (params.getStartNumber() != null && params.getEndNumber() != null) {
+            params.setEndNumber(params.getEndNumber() - params.getStartNumber() + 1);
+        }
+        Integer count = baseMapper.getConPantentsCount(params);
+        return Response.success(count);
+    }
     public PatentDTO getPatentDTOById(Integer id, Integer projectId) {
         //根据id查询专利
         Patent patent = baseMapper.selectById(id);

+ 142 - 0
PAS/src/main/resources/mapper/PatentMapper.xml

@@ -1776,7 +1776,149 @@
             </choose>
         </where>
     </select>
+    <select id="getConPantentsCount" parameterType="cn.cslg.pas.common.model.QueryPatentVO" resultType="java.lang.Integer">
+        select count(*)
+        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>
+            <choose>
+                <when test="params.projectId != null or (params.patentNos != null and params.patentNos.size()!=0) or params.reportId!=null ">
+                    <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.reportId != null">
+                            or patentno in
+                            ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
+                            )
+
+                        </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.reportId != null">
+                            or patentno in
+                            ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
+                            )
+                        </if>
+                        )
+                    </if>
+                    <if test="params.projectId == null and (params.patentNos == null or params.patentNos.size()==0) and params.reportId != null">
+                        patentno in
+                        ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where REPORT_ID =#{params.reportId}
+                        )
+                    </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.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.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>
+                    <if test="params.startNumber!=null and params.endNumber!=null">
+                        limit #{params.startNumber} , #{params.endNumber}
+                    </if>
+                </when>
 
+                <otherwise>
+                    1!=1
+                </otherwise>
+            </choose>
+        </where>
+    </select>
     <select id="getPatent" parameterType="java.util.List" resultType="cn.cslg.pas.domain.Patent">
         select 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,