lwhhszx 2 лет назад
Родитель
Сommit
d6ca47f544

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

@@ -8,7 +8,6 @@ import cn.cslg.pas.common.model.vo.TaskVO;
 import cn.cslg.pas.common.utils.Response;
 import cn.cslg.pas.common.utils.StringUtils;
 import cn.cslg.pas.common.utils.auth.checkAuth;
-import cn.cslg.pas.domain.Task;
 import cn.cslg.pas.service.ProjectService;
 import cn.cslg.pas.service.TaskService;
 import cn.cslg.pas.service.UploadPatentBatchService;

+ 10 - 10
PAS/src/main/java/cn/cslg/pas/service/asso/AssoProductPatentService.java

@@ -128,16 +128,16 @@ public class AssoProductPatentService extends ServiceImpl<AssoProductPatentMappe
     public IPage<PatentDTO> getPageList(QueryPatentVO params) {
         IPage<PatentDTO> pageList = new Page<>();
         //当产品Id为null
-        if (params.getProductId() == null) {
-            //当架构id不为null时
-            if (params.getStructureId() != null) {
-                Structure structure = structureService.getById(params.getStructureId());
-                params.setProductId(structure.getProductId());
-            } else {
-                return pageList;
-            }
-
-        }
+//        if (params.getProductId() == null) {
+//            //当架构id不为null时
+//            if (params.getStructureId() != null) {
+//                Structure structure = structureService.getById(params.getStructureId());
+//                params.setProductId(structure.getProductId());
+//            } else {
+//                return pageList;
+//            }
+//
+//        }
         IPage<Patent> dataPage = baseMapper.getPageList(new Page<>(params.getCurrent(), params.getSize()), params);
 
         List<PatentDTO> records = new ArrayList<>();

+ 0 - 1
PAS/src/main/java/cn/cslg/pas/service/impl/ProductServiceImpl.java

@@ -255,7 +255,6 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
             } else {
                 productGroupVOS = productMapper.queryByGroupCompanyName(productQueryPageDTO);
             }
-
             for (ProductGroupVO productGroupVO : productGroupVOS) {
                 List<ProductVO> products = productGroupVO.getProducts();
                 for (ProductVO product : products) {

+ 8 - 4
PAS/src/main/resources/mapper/AssoProductPatentMapper.xml

@@ -25,8 +25,10 @@
         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
-        left join asso_product_patent i on i.patent_no=a.patentno
-        left join asso_structure_patent t on t.patent_no =a.patentno
+        <if test="params.productId !=null">
+            left join asso_product_patent i on i.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
@@ -45,8 +47,10 @@
             left join os_patent_typeno h on h.pid =a.id and h.type =3
         </if>
         <where>
-            ( i.product_id =#{params.productId}
-            or t.product_id =#{params.productId} )
+
+            <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>

+ 3 - 15
PAS/src/main/resources/mapper/PatentMarkerDataMapper.xml

@@ -16,11 +16,7 @@
             CAST(sum(custom_license_rate * sale_money) AS DECIMAL (19, 2)) AS custom_license_money
         FROM  product_market_data
         WHERE product_id IN
-                (SELECT product_id FROM asso_structure_patent WHERE patent_no IN
-                <foreach collection="patentNoList" item="patentNo" index="index" open="(" close=")" separator=",">
-                    #{patentNo}
-                </foreach>
-                UNION
+                (
                 SELECT product_id FROM asso_product_patent WHERE patent_no IN
                 <foreach collection="patentNoList" item="patentNo" index="index" open="(" close=")" separator=",">
                     #{patentNo}
@@ -39,11 +35,7 @@
             CAST(sum(custom_license_rate * sale_money) AS DECIMAL (19, 2)) AS custom_license_money
         FROM  product_market_data
         WHERE product_id IN
-                (SELECT product_id FROM asso_structure_patent WHERE patent_no IN
-                <foreach collection="patentNoList" item="patentNo" index="index" open="(" close=")" separator=",">
-                    #{patentNo}
-                </foreach>
-                UNION
+                (
                 SELECT product_id FROM asso_product_patent WHERE patent_no IN
                 <foreach collection="patentNoList" item="patentNo" index="index" open="(" close=")" separator=",">
                     #{patentNo}
@@ -62,11 +54,7 @@
             CAST(sum(custom_license_rate * sale_money) AS DECIMAL (19, 2)) AS custom_license_money
         FROM product_market_data
         WHERE product_id IN
-                (SELECT product_id FROM asso_structure_patent WHERE patent_no IN
-                <foreach collection="patentNoList" item="patentNo" index="index" open="(" close=")" separator=",">
-                    #{patentNo}
-                </foreach>
-                UNION
+                (
                 SELECT product_id FROM asso_product_patent WHERE patent_no IN
                 <foreach collection="patentNoList" item="patentNo" index="index" open="(" close=")" separator=",">
                     #{patentNo}

+ 3 - 13
PAS/src/main/resources/mapper/ProductMapper.xml

@@ -113,11 +113,7 @@
             </if>
             <if test="patentNo != null and patentNo != ''">
                 and p.id in
-                (select product_id from asso_product_patent where patent_no = #{patentNo}
-                union select product_id from asso_structure_patent where patent_no = #{patentNo})
-            </if>
-            <if test="productCategoryId != null and productCategoryId != ''">
-                and product_category_id = #{productCategoryId}
+                (select product_id from asso_product_patent where patent_no = #{patentNo})
             </if>
             <if test="productCategoryName != null and productCategoryName != ''">
                 and product_category_id in (select id from product_category where product_category_name like
@@ -177,10 +173,6 @@
         select patent_no
         from asso_product_patent
         where product_id = #{p_id}
-        union
-        select patent_no
-        from asso_structure_patent
-        where product_id = #{p_id}
     </select>
 
     <select id="query4" resultMap="query4Map">
@@ -242,8 +234,7 @@
             </if>
             <if test="patentNo != null and patentNo != ''">
                 and p.id in
-                (select product_id from asso_product_patent where patent_no = #{patentNo}
-                union select product_id from asso_structure_patent where patent_no = #{patentNo})
+                (select product_id from asso_product_patent where patent_no = #{patentNo})
             </if>
             <if test="productCategoryId != null and productCategoryId != ''">
                 and product_category_id = #{productCategoryId}
@@ -342,8 +333,7 @@
             </if>
             <if test="patentNo != null and patentNo != ''">
                 and id in
-                (select product_id from asso_product_patent where patent_no = #{patentNo}
-                union select product_id from asso_structure_patent where patent_no = #{patentNo})
+                (select product_id from asso_product_patent where patent_no = #{patentNo})
             </if>
             <if test="productCategoryId != null and productCategoryId != ''">
                 and product_category_id = #{productCategoryId}