Ver código fonte

分配人员接口 2022/11/11

lwhhszx 2 anos atrás
pai
commit
710d395159

+ 3 - 1
PAS/src/main/java/cn/cslg/pas/common/model/vo/PatentVO.java

@@ -88,7 +88,9 @@ public class PatentVO extends BaseVO {
     private Boolean querySimpleFamily;
     private Boolean queryInpadocFamily;
     private Boolean queryPatSnapFamily;
-
+    private List<Integer> importTaskId;
+    private List<String> patentNos;
+    private List<String> notInPatentNos;
     @Data
     public static class Sort {
         private String order;

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

@@ -52,7 +52,7 @@ public class ClientController {
         return clientService.delete(id);
     }
 
-    @GetMapping("/getAllClient")
+    @GetMapping("/getAllClient1")
     @Operation(summary = "获取所有的客户列表")
     public String getAllClient() {
         return clientService.getAllClient();

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

@@ -177,6 +177,6 @@ public class PatentController {
     @Operation(summary = "根据专题库号获得专利号")
     public String getPatentNos(Integer projectId) {
       String res =patentService.getPatentNos(projectId);
-        return Response.success(res);
+        return res;
     }
 }

+ 6 - 0
PAS/src/main/java/cn/cslg/pas/controller/ProjectController.java

@@ -20,6 +20,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -44,6 +45,11 @@ public class ProjectController {
     public String getPageList(@RequestBody ProjectVO params) throws IOException {
         return Response.success(projectService.getPageList(params));
     }
+    @GetMapping("getProjectById")
+    @Operation(summary = "根据Id获得专题库")
+    public String getProject(Integer id ) throws IOException {
+        return Response.success(projectService.getProjectByIds(Arrays.asList(id)));
+    }
 
     @checkAuth(FunId = "/workspace/project/add")
     @PostMapping("add")

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

@@ -31,10 +31,9 @@ import org.springframework.web.bind.annotation.*;
 @RequiredArgsConstructor(onConstructor_ = {@Lazy})
 public class ProjectFieldOptionController {
 
-    private final ProjectFieldService projectFieldService;
     private final ProjectFieldTreeService projectFieldTreeService;
     private final ProjectFieldOptionService projectFieldOptionService;
-    private final ProjectFieldTextService projectFieldTextService;
+
 
 
     @GetMapping("list")

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

@@ -0,0 +1,58 @@
+package cn.cslg.pas.controller;
+
+import cn.cslg.pas.common.core.base.Constants;
+import cn.cslg.pas.common.model.vo.PatentVO;
+import cn.cslg.pas.common.model.vo.TaskVO;
+import cn.cslg.pas.common.utils.Response;
+import cn.cslg.pas.domain.SystemDict;
+import cn.cslg.pas.domain.Task;
+import cn.cslg.pas.service.PatentService;
+import cn.cslg.pas.service.SystemDictService;
+import cn.cslg.pas.service.TaskService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.RequiredArgsConstructor;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * <p>
+ * 任务 前端控制器
+ * </p>
+ *
+ * @author 王岩
+ * @since 2022-02-17
+ */
+@Tag(name = "系统任务")
+@RestController
+@RequestMapping(Constants.API_VERSION_V2 + "/system")
+@RequiredArgsConstructor(onConstructor_ = {@Lazy})
+public class SystemController {
+
+    private final SystemDictService systemDictService;
+    private final PatentService patentService;
+    @PostMapping("dict")
+    @Operation(summary = "根据类型获得字典")
+    public String getPageList(@RequestBody  List<String> dicts) {
+        List<SystemDict> systemDictList = systemDictService.getSystemDictListByType(dicts);
+//        Arrays.asList(Constants.ENTERPRISE_APPLICATION_SCENARIO)
+        return Response.success(systemDictList);
+    }
+
+    @PostMapping("patentList")
+    @Operation(summary = "专利列表")
+    public String getList(@RequestBody PatentVO params) {
+        return Response.success(patentService.getPageListForRMS(params));
+    }
+
+    @PostMapping("getComPantentNos")
+    @Operation(summary = "获得对比专利号")
+    public String getComPantentNos(@RequestBody PatentVO params) {
+        return patentService.getComPantentNos(params);
+    }
+
+}
+

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

@@ -36,7 +36,8 @@ public interface PatentMapper extends BaseMapper<Patent> {
     Map<String, Object> getPatentListByIdAndColumn(Integer id, String column);
 
     IPage<Patent> getPageList(Page<Patent> page, @Param("params") PatentVO params);
-
+    IPage<Patent> getPageListForRMS(Page<Patent> page, @Param("params") PatentVO params);
+    List<String> getListForRMS( @Param("params") PatentVO params);
     List<Patent> getPageList(@Param("params") PatentVO params);
 
     IPage<PatentQueryFieldSourceDTO> getPatentQuerySourcePageList(Page<Patent> page, @Param("params") PatentQueryFieldSourceVO params, @Param("ids") List<Integer> patentIds);

+ 84 - 14
PAS/src/main/java/cn/cslg/pas/service/PatentService.java

@@ -19,6 +19,7 @@ import cn.cslg.pas.common.utils.CacheUtils;
 import cn.cslg.pas.common.utils.PatentUtils;
 import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.util.IdUtil;
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -111,7 +112,7 @@ public class PatentService extends ServiceImpl<PatentMapper, Patent> {
     public List<Patent> getPublicDateAndPatentNoByPatentNo(List<String> patentNo) {
         LambdaQueryWrapper<Patent> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.select(Patent::getPublicDate, Patent::getPatentNo, Patent::getId, Patent::getPublicNo
-                ,Patent::getSimpleFamily,Patent::getInpadocFamily,Patent::getPatSnapFamily);
+                , Patent::getSimpleFamily, Patent::getInpadocFamily, Patent::getPatSnapFamily);
         queryWrapper.in(Patent::getPatentNo, patentNo);
         queryWrapper.last(" order by appdate, patentno");
         return this.list(queryWrapper);
@@ -345,7 +346,7 @@ public class PatentService extends ServiceImpl<PatentMapper, Patent> {
                     for (String s : queryList) {
                         str.append(s).append("|");
                     }
-                    params.setWhereAffair(str.substring(0,str.length()-1));
+                    params.setWhereAffair(str.substring(0, str.length() - 1));
                     break;
                 case "54-0":
                     params.setQueryLabel(true);
@@ -467,6 +468,69 @@ public class PatentService extends ServiceImpl<PatentMapper, Patent> {
         pageList.setCurrent(dataPage.getCurrent());
         return pageList;
     }
+    public IPage<PatentDTO> getPageListForRMS(PatentVO params) {
+        IPage<Patent> dataPage = baseMapper.getPageListForRMS(new Page<>(params.getCurrent(), params.getSize()), params);
+        IPage<PatentDTO> pageList = new Page<>();
+        List<PatentDTO> records = new ArrayList<>();
+        List<Integer> patentIds = dataPage.getRecords().stream().map(Patent::getId).collect(Collectors.toList());
+        List<PatentApplicant> patentApplicantList = patentApplicantService.getPatentApplicantByPatentIds(patentIds);
+        List<PatentInventor> patentInventorList = patentInventorService.getPatentInventorByPatentIds(patentIds);
+        List<PatentLabel> patentLabelList = patentLabelService.getPatentLabelByPatentIdsAndProjectId(patentIds, params.getProjectId());
+        List<PatentClassNumberLink> patentClassNumberLinkList = patentClassNumberLinkService.getPatentClassNumberLinkByPatentIds(patentIds);
+        List<PatentAgent> patentAgentList = patentAgentService.getPatentAgentByPatentIds(patentIds);
+        List<PatentAgency> patentAgencyList = patentAgencyService.getPatentAgencyByIds(dataPage.getRecords().stream().filter(item -> StringUtils.isNotEmpty(item.getAgencyId())).map(item -> Integer.parseInt(item.getAgencyId())).distinct().collect(Collectors.toList()));
+        List<PatentSimpleFamilyLink> patentSimpleFamilyLinkList = patentSimpleFamilyLinkService.getPatentSimpleFamilyLinkByFamilyIds(dataPage.getRecords().stream().map(Patent::getSimpleFamily).collect(Collectors.toList()));
+        List<PatentSimpleFamilyLink> patentInpadocFamilyLinkList = patentSimpleFamilyLinkService.getPatentSimpleFamilyLinkByFamilyIds(dataPage.getRecords().stream().map(Patent::getInpadocFamily).collect(Collectors.toList()));
+        List<PatentSimpleFamilyLink> patentPatSnapFamilyLinkList = patentSimpleFamilyLinkService.getPatentSimpleFamilyLinkByFamilyIds(dataPage.getRecords().stream().map(Patent::getPatSnapFamily).collect(Collectors.toList()));
+        List<SystemDict> systemDictList = systemDictService.getSystemDictListByType(Arrays.asList(Constants.PATENT_TYPE, Constants.PATENT_SIMPLE_STATUS));
+        dataPage.getRecords().forEach(item -> {
+            PatentDTO patentDTO = new PatentDTO();
+            BeanUtils.copyProperties(item, patentDTO);
+            patentDTO.setApplicationDate(DateUtils.formatDate(item.getApplicationDate(), DateUtils.YYYY_MM_DD));
+            patentDTO.setPriorityDate(DateUtils.formatDate(item.getPriorityDate(), DateUtils.YYYY_MM_DD));
+            patentDTO.setPublicDate(DateUtils.formatDate(item.getPublicDate(), DateUtils.YYYY_MM_DD));
+            patentDTO.setPublicAccreditDate(DateUtils.formatDate(item.getPublicAccreditDate(), DateUtils.YYYY_MM_DD));
+            patentDTO.setFirstPublicDate(DateUtils.formatDate(item.getFirstPublicDate(), DateUtils.YYYY_MM_DD));
+            patentDTO.setSimpleStatus(systemDictList.stream().filter(systemDict -> systemDict.getType().equals(Constants.PATENT_SIMPLE_STATUS) && systemDict.getValue().equals(String.valueOf(item.getSimpleStatus()))).findFirst().orElse(new SystemDict()).getLabel());
+            patentDTO.setType(systemDictList.stream().filter(systemDict -> systemDict.getType().equals(Constants.PATENT_TYPE) && systemDict.getValue().equals(String.valueOf(item.getType()))).findFirst().orElse(new SystemDict()).getLabel());
+            patentDTO.setApplicant(patentApplicantList.stream().filter(patentApplicant -> patentApplicant.getPatentId().equals(item.getId())).collect(Collectors.toList()));
+            patentDTO.setInventor(patentInventorList.stream().filter(patentInventor -> patentInventor.getPatentId().equals(item.getId())).collect(Collectors.toList()));
+            patentDTO.setLabel(patentLabelList.stream().filter(patentLabel -> patentLabel.getPatentId().equals(item.getId())).collect(Collectors.toList()));
+            patentDTO.setIpcList(patentClassNumberLinkList.stream().filter(patentClassNumber -> patentClassNumber.getPatentId().equals(item.getId()) && patentClassNumber.getType().equals(Constants.PATENT_CLASS_NUMBER_IPC)).map(PatentClassNumberLink::getCode).distinct().collect(Collectors.toList()));
+            patentDTO.setCpcList(patentClassNumberLinkList.stream().filter(patentClassNumber -> patentClassNumber.getPatentId().equals(item.getId()) && patentClassNumber.getType().equals(Constants.PATENT_CLASS_NUMBER_CPC)).map(PatentClassNumberLink::getCode).distinct().collect(Collectors.toList()));
+            patentDTO.setUpcList(patentClassNumberLinkList.stream().filter(patentClassNumber -> patentClassNumber.getPatentId().equals(item.getId()) && patentClassNumber.getType().equals(Constants.PATENT_CLASS_NUMBER_UPC)).map(PatentClassNumberLink::getCode).distinct().collect(Collectors.toList()));
+            patentDTO.setLocList(patentClassNumberLinkList.stream().filter(patentClassNumber -> patentClassNumber.getPatentId().equals(item.getId()) && patentClassNumber.getType().equals(Constants.PATENT_CLASS_NUMBER_LOC)).map(PatentClassNumberLink::getCode).distinct().collect(Collectors.toList()));
+            if (StringUtils.isNotEmpty(item.getAgencyId())) {
+                patentDTO.setAgency(patentAgencyList.stream().filter(patentAgency -> patentAgency.getId().equals(Integer.parseInt(item.getAgencyId()))).findFirst().orElse(null));
+            }
+            PatentDTO.PatentFamily patentFamily = new PatentDTO.PatentFamily();
+            patentFamily.setSimple(patentSimpleFamilyLinkList.stream().filter(patentSimpleFamilyLink -> patentSimpleFamilyLink.getFamilyId().equals(item.getSimpleFamily())).map(PatentSimpleFamilyLink::getPatentNo).collect(Collectors.toList()));
+            patentFamily.setInpadoc(patentInpadocFamilyLinkList.stream().filter(patentSimpleFamilyLink -> patentSimpleFamilyLink.getFamilyId().equals(item.getInpadocFamily())).map(PatentSimpleFamilyLink::getPatentNo).collect(Collectors.toList()));
+            patentFamily.setPatSnap(patentPatSnapFamilyLinkList.stream().filter(patentSimpleFamilyLink -> patentSimpleFamilyLink.getFamilyId().equals(item.getPatSnapFamily())).map(PatentSimpleFamilyLink::getPatentNo).collect(Collectors.toList()));
+            patentDTO.setFamily(patentFamily);
+            patentDTO.setAgent(patentAgentList.stream().filter(patentAgent -> patentAgent.getPatentId().equals(item.getId())).collect(Collectors.toList()));
+            // TODO 性能优化
+            patentDTO.setField(projectFieldService.getPatentFieldByPatentIdAndProjectId(params.getProjectId(), item.getId()));
+            records.add(patentDTO);
+        });
+        pageList.setTotal(dataPage.getTotal());
+        pageList.setRecords(records);
+        pageList.setPages(dataPage.getPages());
+        pageList.setSize(dataPage.getSize());
+        pageList.setCurrent(dataPage.getCurrent());
+        return pageList;
+    }
+
+public String getComPantentNos(PatentVO params){
+  List<String> patents = baseMapper.getListForRMS(params);
+  return Response.success(patents);
+
+}
+
+
+
+
+
 
     public PatentDTO getPatentDTOById(Integer id, Integer projectId) {
         Patent patent = baseMapper.selectById(id);
@@ -542,12 +606,13 @@ public class PatentService extends ServiceImpl<PatentMapper, Patent> {
     }
 
     public PatentDTO getPatentDTOById(String patentNo) {
-        LambdaQueryWrapper<Patent> wrapper =new LambdaQueryWrapper<>();
-        wrapper.eq(Patent::getPatentNo,patentNo);
+        LambdaQueryWrapper<Patent> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(Patent::getPatentNo, patentNo);
         Patent patent = this.list(wrapper).get(0);
         //如果未查出专利则返回为空
-        if(patent ==null)
-        {return null;}
+        if (patent == null) {
+            return null;
+        }
         PatentDTO patentDTO = new PatentDTO();
         BeanUtils.copyProperties(patent, patentDTO);
         List<SystemDict> systemDictList = systemDictService.getSystemDictListByType(Arrays.asList(Constants.PATENT_TYPE, Constants.PATENT_SIMPLE_STATUS, Constants.COUNTRIES));
@@ -616,8 +681,6 @@ public class PatentService extends ServiceImpl<PatentMapper, Patent> {
     }
 
 
-
-
     public List<Integer> getQueryPatentIds(PatentVO params) {
         if (params.getSelected() != null && params.getSelected().size() != 0 && params.getSelectId() != null && params.getSelectId()) {
             return params.getSelected().stream().distinct().collect(Collectors.toList());
@@ -1246,13 +1309,20 @@ public class PatentService extends ServiceImpl<PatentMapper, Patent> {
         patentInventorMergeService.importPatentInventorMergeLink(projectId, importPatentInventorList, importPatentInventorMergeList);
         patentApplicantMergeLinkService.importPatentApplicantMergeLink(projectId, importPatentApplicantList, importPatentApplicantMergeLinkList);
     }
-    public  String  getPatentNos(Integer projectId){
-        LambdaQueryWrapper<ProjectPatentLink> wrapper =new LambdaQueryWrapper<>();
-   wrapper.select(ProjectPatentLink::getPatentId).eq(ProjectPatentLink::getProjectId,projectId);
-    List<ProjectPatentLink>    projectPatentLinkList = projectPatentLinkService.list(wrapper);
-   List<Integer>  patentId =  projectPatentLinkList.stream().map(ProjectPatentLink::getPatentId).collect(Collectors.toList());
 
-        return Response.success();
+    public String getPatentNos(Integer projectId) {
+        //根据专题库号获得专利id
+        LambdaQueryWrapper<ProjectPatentLink> wrapper = new LambdaQueryWrapper<>();
+        wrapper.select(ProjectPatentLink::getPatentId).eq(ProjectPatentLink::getProjectId, projectId);
+        List<ProjectPatentLink> projectPatentLinkList = projectPatentLinkService.list(wrapper);
+        List<Integer> patentIds = projectPatentLinkList.stream().map(ProjectPatentLink::getPatentId).collect(Collectors.toList());
+        //根据专利Id获得专利号
+        LambdaQueryWrapper<Patent> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.in(Patent::getId, patentIds);
+        List<Patent> patents = this.list(queryWrapper);
+        List<String> patentNos = patents.stream().map(Patent::getPatentNo).collect(Collectors.toList());
+
+        return Response.success(patentNos);
     }
 
 }

+ 34 - 4
PAS/src/main/java/cn/cslg/pas/service/ProjectService.java

@@ -173,7 +173,40 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
         }
         LambdaQueryWrapper<Project> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.in(Project::getId, ids);
-        return this.list(queryWrapper);
+        List<Project> dataList = this.list(queryWrapper);
+        try {
+            //获取所属部门对应信息
+            String jsonObject = requestService.getDepartmentFromPCS(dataList);
+            JSONArray jsonArray1 = JSON.parseArray(jsonObject);
+            List<ProjectVO.Department> departmentList = jsonArray1.toJavaList(ProjectVO.Department.class);
+            for (Project project : dataList) {
+                for (ProjectVO.Department department : departmentList) {
+                    if (project.getDepartmentId() != null) {
+                        if (project.getDepartmentId().equals(department.getId())) {
+                            project.setDepartmentName(department.getDepartmentName());
+                        }
+                    }
+                }
+            }
+
+            //获取专题库负责人对应信息
+            String jsonObject1 = requestService.getPersonnelFromPCS(dataList);
+            JSONArray jsonArray = JSON.parseArray(jsonObject1);
+            List<ProjectVO.Personnel> personnelList = jsonArray.toJavaList(ProjectVO.Personnel.class);
+            for (Project project : dataList) {
+                for (ProjectVO.Personnel personnel : personnelList) {
+                    if (project.getPersonnelId() != null) {
+                        if (project.getPersonnelId().equals(personnel.getId())) {
+                            project.setPersonnelName(personnel.getPersonnelName());
+                        }
+                    }
+                }
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        this.setDataList(dataList);
+        return dataList;
     }
 
     public List<Project> getProjectByCreateId(Integer createBy) {
@@ -522,9 +555,6 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
     }
 
 
-
-
-
     @Transactional(propagation = Propagation.NOT_SUPPORTED)
     public void setImportPatentTaskStatus(Integer status, Integer taskId) {
         taskService.updateStatus(taskId, status, DateUtils.getDateTime());

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

@@ -3,11 +3,13 @@
 <mapper namespace="cn.cslg.pas.mapper.PatentMapper">
 
     <select id="getDateTime" resultType="java.lang.Integer">
-        select ifnull(${type}(${column}), 0) from os_patent where id in (<trim prefix="" suffixOverrides=",">${ids}</trim>) and ${column} is not null
+        select ifnull(${type}(${column}), 0) from os_patent where id in (<trim prefix="" suffixOverrides=",">
+        ${ids}</trim>) and ${column} is not null
     </select>
 
     <select id="getDateTime2" resultType="java.lang.Integer">
-        select ifnull(${type}(unix_timestamp(name)), 0) from os_patent_field_text where id in (select fid from os_patent_field_patent_link where pid in (<trim prefix="" suffixOverrides=",">${ids}</trim>) and cid = ${field})
+        select ifnull(${type}(unix_timestamp(name)), 0) from os_patent_field_text where id in (select fid from
+        os_patent_field_patent_link where pid in (<trim prefix="" suffixOverrides=",">${ids}</trim>) and cid = ${field})
     </select>
 
     <select id="getCustomFieldCount" resultType="java.lang.Integer">
@@ -37,14 +39,21 @@
     </select>
 
     <select id="getPatentListByIdAndColumn" resultType="java.util.Map">
-        select ${column} from os_patent where id = #{id}
+        select ${column}
+        from os_patent
+        where id = #{id}
     </select>
 
-    <select id="getPageList" parameterType="cn.cslg.pas.common.model.vo.PatentVO" 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,
-        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,
-        b.look as `read`, a.agencyid as agency_id, a.num2 as right_num, a.quoteno as quote_num, a.quotedno as quoted_num,
+    <select id="getPageList" parameterType="cn.cslg.pas.common.model.vo.PatentVO"
+            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,
+        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,
+        b.look as `read`, 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.folder != null and params.folder != ''">
@@ -180,13 +189,16 @@
                 and (select count(*) from os_patent_right where a.id = patent_id and (${params.rightContentSql})) > 0
             </if>
             <if test="params.querySimpleFamily == true">
-                and (a.simple_family = (select id from os_patent_simplefamily where type = 1 and patent_no = a.patentno) or a.simple_family is null)
+                and (a.simple_family = (select id from os_patent_simplefamily where type = 1 and patent_no = a.patentno)
+                or a.simple_family is null)
             </if>
             <if test="params.queryInpadocFamily == true">
-                and (a.inpadoc_family = (select id from os_patent_simplefamily where type = 2 and patent_no = a.patentno) or a.inpadoc_family is null)
+                and (a.inpadoc_family = (select id from os_patent_simplefamily where type = 2 and patent_no =
+                a.patentno) or a.inpadoc_family is null)
             </if>
             <if test="params.queryPatSnapFamily == true">
-                and (a.patsnap_family = (select id from os_patent_simplefamily where type = 3 and patent_no = a.patentno) or a.patsnap_family is null)
+                and (a.patsnap_family = (select id from os_patent_simplefamily where type = 3 and patent_no =
+                a.patentno) or a.patsnap_family is null)
             </if>
             <if test="params.whereClassNumberIpc != null">
                 and q1.type = 1 and
@@ -293,7 +305,8 @@
             </if>
             <if test="params.whereApplicantOriginalStandard != null">
                 and h1.bname in
-                <foreach collection="params.whereApplicantOriginalStandard" item="item" separator="," open="(" close=")">
+                <foreach collection="params.whereApplicantOriginalStandard" item="item" separator="," open="("
+                         close=")">
                     #{item}
                 </foreach>
             </if>
@@ -305,28 +318,28 @@
             </if>
             <if test="params.whereApplicantOriginalMerge != null">
                 and (
-                    j.mergeid in
-                    <foreach collection="params.whereApplicantOriginalMerge" item="item" separator="," open="(" close=")">
-                        #{item}
-                    </foreach>
-                    or
-                    e.applicantid in
-                    <foreach collection="params.whereApplicantOriginalMerge" item="item" separator="," open="(" close=")">
-                        #{item}
-                    </foreach>
+                j.mergeid in
+                <foreach collection="params.whereApplicantOriginalMerge" item="item" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+                or
+                e.applicantid in
+                <foreach collection="params.whereApplicantOriginalMerge" item="item" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
                 )
             </if>
             <if test="params.whereApplicantCurrentMerge != null">
                 and (
-                    k.mergeid in
-                    <foreach collection="params.whereApplicantCurrentMerge" item="item" separator="," open="(" close=")">
-                        #{item}
-                    </foreach>
-                    or
-                    f.applicantid in
-                    <foreach collection="params.whereApplicantCurrentMerge" item="item" separator="," open="(" close=")">
-                        #{item}
-                    </foreach>
+                k.mergeid in
+                <foreach collection="params.whereApplicantCurrentMerge" item="item" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+                or
+                f.applicantid in
+                <foreach collection="params.whereApplicantCurrentMerge" item="item" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
                 )
             </if>
             <if test="params.whereBureau != null">
@@ -382,24 +395,24 @@
             </if>
             <if test="params.whereFieldMultiple != null">
                 and (
-                    a2.fid in
-                    <foreach collection="params.whereFieldMultiple" item="item" separator="," open="(" close=")">
-                        #{item}
-                    </foreach>
-                    <if test="params.whereFieldMultipleNull == true">
-                        or a2.id is null
-                    </if>
+                a2.fid in
+                <foreach collection="params.whereFieldMultiple" item="item" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+                <if test="params.whereFieldMultipleNull == true">
+                    or a2.id is null
+                </if>
                 )
             </if>
             <if test="params.whereFieldText != null">
                 and (
-                    a3.fid in
-                    <foreach collection="params.whereFieldText" item="item" separator="," open="(" close=")">
-                        #{item}
-                    </foreach>
-                    <if test="params.whereFieldTextNull == true">
-                        or a2.id is null
-                    </if>
+                a3.fid in
+                <foreach collection="params.whereFieldText" item="item" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+                <if test="params.whereFieldTextNull == true">
+                    or a2.id is null
+                </if>
                 )
             </if>
             <if test="params.whereTreeType0 != null">
@@ -429,7 +442,8 @@
         <if test="params.sort.prop == 'quotedNum'">a.quotedno</if>
         ${params.sort.order}
     </select>
-    <select id="getPatentQuerySourcePageList" parameterType="cn.cslg.pas.common.model.vo.PatentQueryFieldSourceVO" resultType="cn.cslg.pas.common.model.dto.PatentQueryFieldSourceDTO">
+    <select id="getPatentQuerySourcePageList" parameterType="cn.cslg.pas.common.model.vo.PatentQueryFieldSourceVO"
+            resultType="cn.cslg.pas.common.model.dto.PatentQueryFieldSourceDTO">
         <if test="params.key == '41-1'">
             <include refid="Patent_Query_Source_Base_Select">
                 <property name="label" value="a.publicno"/>
@@ -517,34 +531,34 @@
         </if>
         <if test="params.key == '20-1'">
             select temp.* from ((
-                <include refid="Patent_Query_Source_Base_Select">
-                    <property name="label" value="e.name"/>
-                    <property name="count" value="distinct d.pid"/>
-                    <property name="value" value="e.id"/>
-                </include>
-                left join os_patent_inventor_relation d on d.pid = a.id
-                left join os_patent_inventor e on e.id = d.fid
-                <include refid="Patent_Query_Source_Base_Where">
-                    <property name="label" value="e.name"/>
-                </include>
-                and e.name is not null
-                and e.id not in (select inventor_id from os_patent_inventor_merge where project_id = b.zid)
-                group by d.fid
+            <include refid="Patent_Query_Source_Base_Select">
+                <property name="label" value="e.name"/>
+                <property name="count" value="distinct d.pid"/>
+                <property name="value" value="e.id"/>
+            </include>
+            left join os_patent_inventor_relation d on d.pid = a.id
+            left join os_patent_inventor e on e.id = d.fid
+            <include refid="Patent_Query_Source_Base_Where">
+                <property name="label" value="e.name"/>
+            </include>
+            and e.name is not null
+            and e.id not in (select inventor_id from os_patent_inventor_merge where project_id = b.zid)
+            group by d.fid
             ) union all (
-                <include refid="Patent_Query_Source_Base_Select">
-                    <property name="label" value="e.name"/>
-                    <property name="count" value="distinct d.pid"/>
-                    <property name="value" value="e.id"/>
-                </include>
-                left join os_patent_inventor_relation d on d.pid = a.id
-                left join os_patent_inventor_merge e1 on e1.inventor_id = d.fid
-                left join os_patent_inventor e on e.id = e1.merge_id
-                <include refid="Patent_Query_Source_Base_Where">
-                    <property name="label" value="e.name"/>
-                </include>
-                and e.name is not null
-                and e.project_id = b.zid
-                group by e.id
+            <include refid="Patent_Query_Source_Base_Select">
+                <property name="label" value="e.name"/>
+                <property name="count" value="distinct d.pid"/>
+                <property name="value" value="e.id"/>
+            </include>
+            left join os_patent_inventor_relation d on d.pid = a.id
+            left join os_patent_inventor_merge e1 on e1.inventor_id = d.fid
+            left join os_patent_inventor e on e.id = e1.merge_id
+            <include refid="Patent_Query_Source_Base_Where">
+                <property name="label" value="e.name"/>
+            </include>
+            and e.name is not null
+            and e.project_id = b.zid
+            group by e.id
             )) as temp where 1 = 1 order by `count` desc, `value` asc
         </if>
         <if test="params.key == '21-0'">
@@ -582,38 +596,38 @@
         </if>
         <if test="params.key == '18-8' or params.key == '19-8' or params.key == '23-8' or params.key == '24-8'">
             select temp.* from ((
-                <include refid="Patent_Query_Source_Base_Select">
-                    <property name="label" value="e.name"/>
-                    <property name="count" value="distinct d.pid"/>
-                    <property name="value" value="e.id"/>
-                </include>
-                left join os_applicant_attr d on d.pid = a.id and d.type = #{params.applicantType}
-                left join os_patent_applicant e on e.id = d.applicantid
-                <include refid="Patent_Query_Source_Base_Where">
-                    <property name="label" value="e.name"/>
-                </include>
-                and e.id not in (select applicantid from os_associate_applicant where tid = b.zid) and e.name is not null
-                <if test="params.key == '23-8' or params.key == '24-8'">
-                    and d.order = 0
-                </if>
-                group by e.id
+            <include refid="Patent_Query_Source_Base_Select">
+                <property name="label" value="e.name"/>
+                <property name="count" value="distinct d.pid"/>
+                <property name="value" value="e.id"/>
+            </include>
+            left join os_applicant_attr d on d.pid = a.id and d.type = #{params.applicantType}
+            left join os_patent_applicant e on e.id = d.applicantid
+            <include refid="Patent_Query_Source_Base_Where">
+                <property name="label" value="e.name"/>
+            </include>
+            and e.id not in (select applicantid from os_associate_applicant where tid = b.zid) and e.name is not null
+            <if test="params.key == '23-8' or params.key == '24-8'">
+                and d.order = 0
+            </if>
+            group by e.id
             ) union all (
-                <include refid="Patent_Query_Source_Base_Select">
-                    <property name="label" value="e.name"/>
-                    <property name="count" value="distinct d.pid"/>
-                    <property name="value" value="e.id"/>
-                </include>
-                left join os_applicant_attr d on d.pid = a.id and d.type = #{params.applicantType}
-                left join os_associate_applicant f on f.applicantid = d.applicantid
-                left join os_patent_applicant e on e.id = f.mergeid
-                <include refid="Patent_Query_Source_Base_Where">
-                    <property name="label" value="e.name"/>
-                </include>
-                and e.name is not null and e.project_id = b.zid
-                <if test="params.key == '23-8' or params.key == '24-8'">
-                    and d.order = 0
-                </if>
-                group by e.id
+            <include refid="Patent_Query_Source_Base_Select">
+                <property name="label" value="e.name"/>
+                <property name="count" value="distinct d.pid"/>
+                <property name="value" value="e.id"/>
+            </include>
+            left join os_applicant_attr d on d.pid = a.id and d.type = #{params.applicantType}
+            left join os_associate_applicant f on f.applicantid = d.applicantid
+            left join os_patent_applicant e on e.id = f.mergeid
+            <include refid="Patent_Query_Source_Base_Where">
+                <property name="label" value="e.name"/>
+            </include>
+            and e.name is not null and e.project_id = b.zid
+            <if test="params.key == '23-8' or params.key == '24-8'">
+                and d.order = 0
+            </if>
+            group by e.id
             )) as temp where 1 = 1 order by `count` desc, `value` asc
         </if>
         <if test="params.key == '13-1'">
@@ -1158,48 +1172,50 @@
         </if>
         <if test="params.type != 'query'">
             select temp.* from ((
-                <include refid="Patent_Query_Source_Base_Select">
-                    <property name="label" value="null"/>
-                    <property name="count" value="a.id"/>
-                    <property name="value" value="null"/>
-                </include>
-                <include refid="Patent_Query_Source_Base_Where">
-                    <property name="label" value="null"/>
-                </include>
-                and a.id not in (select pid from os_patent_field_patent_link where cid = #{params.customFieldId})
+            <include refid="Patent_Query_Source_Base_Select">
+                <property name="label" value="null"/>
+                <property name="count" value="a.id"/>
+                <property name="value" value="null"/>
+            </include>
+            <include refid="Patent_Query_Source_Base_Where">
+                <property name="label" value="null"/>
+            </include>
+            and a.id not in (select pid from os_patent_field_patent_link where cid = #{params.customFieldId})
             ) union all (
-                <include refid="Patent_Query_Source_Base_Select">
-                    <property name="label" value="d.name"/>
-                    <property name="count" value="distinct e.pid"/>
-                    <property name="value" value="d.id"/>
-                </include>
-                left join os_patent_field_patent_link e on e.pid = b.pid
-                left join os_patent_field c1 on c1.id = e.cid
-                <if test="params.type == 6">
-                    left join os_patent_field_tree d on d.cid = e.cid
-                </if>
-                <if test="params.type == 0 or params.type == 1 or params.type == 2">
-                    left join os_patent_field_text d on d.cid = e.cid and d.name is not null and d.name != ''
-                </if>
-                <if test="params.type == 3 or params.type == 4 or params.type == 5">
-                    left join os_patent_field_multiple d on d.cid = e.cid
-                </if>
-                <include refid="Patent_Query_Source_Base_Where">
-                    <property name="label" value="d.name"/>
-                </include>
-                and c1.id = #{params.customFieldId}
-                <if test="params.customFieldTreeType == 0">
-                    and e.fid in (select id from os_patent_field_tree where cid = c1.id and find_in_set(d.id , replace(path , '/', ',')))
-                </if>
-                <if test="params.customFieldTreeType == null">
-                    and e.fid = d.id
-                </if>
-                group by d.id
+            <include refid="Patent_Query_Source_Base_Select">
+                <property name="label" value="d.name"/>
+                <property name="count" value="distinct e.pid"/>
+                <property name="value" value="d.id"/>
+            </include>
+            left join os_patent_field_patent_link e on e.pid = b.pid
+            left join os_patent_field c1 on c1.id = e.cid
+            <if test="params.type == 6">
+                left join os_patent_field_tree d on d.cid = e.cid
+            </if>
+            <if test="params.type == 0 or params.type == 1 or params.type == 2">
+                left join os_patent_field_text d on d.cid = e.cid and d.name is not null and d.name != ''
+            </if>
+            <if test="params.type == 3 or params.type == 4 or params.type == 5">
+                left join os_patent_field_multiple d on d.cid = e.cid
+            </if>
+            <include refid="Patent_Query_Source_Base_Where">
+                <property name="label" value="d.name"/>
+            </include>
+            and c1.id = #{params.customFieldId}
+            <if test="params.customFieldTreeType == 0">
+                and e.fid in (select id from os_patent_field_tree where cid = c1.id and find_in_set(d.id , replace(path
+                , '/', ',')))
+            </if>
+            <if test="params.customFieldTreeType == null">
+                and e.fid = d.id
+            </if>
+            group by d.id
             )) as temp where 1 = 1 order by `count` desc, `value` asc
         </if>
     </select>
     <sql id="Patent_Query_Source_Base_Select">
-        select ifnull(${label}, '未选择') as label, count(${count}) as `count`, ifnull(${value}, 'null') as `value`, group_concat(distinct a.id) as ids
+        select ifnull(${label}, '未选择') as label, count(${count}) as `count`, ifnull(${value}, 'null') as `value`,
+        group_concat(distinct a.id) as ids
         from os_patent a
         <if test="params.folder != null and params.folder != ''">
             left join os_portfolio_link b on b.pid = a.id
@@ -1228,7 +1244,89 @@
         </where>
     </sql>
     <sql id="Patent_Query_Source_Base_Group">
-        group by ${groupBy}
-        order by `${orderBy}` desc, `value` asc
+        group by
+        ${groupBy}
+        order
+        by
+        `${orderBy}`
+        desc,
+        `value`
+        asc
     </sql>
+
+    <select id="getListForRMS" resultType="java.lang.String">
+        select a.patentno as patent_no
+        from os_patent a
+        <where>
+            patentno="0"
+            <if test="params.projectId != null">
+                or a.id in (select pid from os_thematic_pid where zid = #{params.projectId})
+            </if>
+            <if test="params.importTaskId != null and params.importTaskId.size()!=0">
+                or a.id in
+                <foreach item="item" collection="params.importTaskId" 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.startNumber!=null and params.endNumber!=null">
+          limit #{params.startNumber} , #{params.endNumber}
+          </if>
+        </where>
+
+    </select>
+
+
+    <select id="getPageListForRMS" parameterType="cn.cslg.pas.common.model.vo.PatentVO"
+            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,
+        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
+        <where>
+            patentno="0"
+            <if test="params.projectId != null">
+                or  a.id in (select pid from os_thematic_pid where zid = #{params.projectId})
+                <if test="params.notInPatentNos != null">
+                     and patentno not in
+                    <foreach item="item" collection="params.notInPatentNos" index="index" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+
+            </if>
+            <if test="params.importTaskId != null and params.importTaskId.size()!=0">
+                or a.id in
+                <foreach item="item" collection="params.importTaskId" index="index" open="(" separator="," close=") ">
+                    #{item}
+                </foreach>
+
+                <if test="params.notInPatentNos != null">
+                    and patentno not in
+                    <foreach item="item" collection="params.notInPatentNos" index="index" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+            </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>
+        </where>
+
+    </select>
+
 </mapper>