chendayu 2 years ago
parent
commit
fda4b0ef7a

+ 2 - 2
PAS/src/main/java/cn/cslg/pas/common/model/vo/ProductVO.java

@@ -60,9 +60,9 @@ public class ProductVO implements Serializable {
     /**
      * 产品的相关专利和该产品所有架构的相关专利
      */
-    private List<String> relativePatents;
+    //private List<String> relativePatents;
     /**
-     * 相关专利数量
+     * 产品相关专利数量
      */
     private Integer patentNum;
     /**

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

@@ -256,13 +256,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) {
-                    List<String> relativePatents = product.getRelativePatents();
-                    product.setPatentNum(relativePatents.size());
-                }
-            }
             return JsonPage.restPage(new PageInfo<>(productGroupVOS));
         }
 
@@ -271,11 +264,6 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
             PageHelper.startPage(current, size);
         }
         List<ProductVO> productVOs = productMapper.query(productQueryPageDTO);
-        //遍历产品数据,获得每一个产品的相关专利数量,赋值给patentNum
-        for (ProductVO productVO : productVOs) {
-            List<String> relativePatents = productVO.getRelativePatents();
-            productVO.setPatentNum(relativePatents.size());
-        }
         return JsonPage.restPage(new PageInfo<>(productVOs));
 
     }

+ 3 - 3
PAS/src/main/resources/mapper/AssoProductPatentMapper.xml

@@ -52,7 +52,7 @@
         <where>
 
             <if test="params.productId !=null">
-              and  i.product_id =#{params.productId}
+                and i.product_id =#{params.productId}
             </if>
             <if test="params.applicationName !=null and params.applicationName !=''  ">
                 and c.name REGEXP #{params.applicationName}
@@ -82,7 +82,7 @@
                 and a.`name` like concat("%", #{params.patentName}, "%")
             </if>
             <if test="params.structureId !=null and params.structureId !=''">
-                and t.structure_id = #{params.structureId}
+                and find_in_set(#{params.structureId}, t.path)
             </if>
             <if test="params.orderItem!=null and params.orderItem!='SysOrder'">
                 order by #{params.orderItem}
@@ -143,7 +143,7 @@
                 and h.code like concat("%", #{params.numberUpc}, "%")
             </if>
             <if test="params.patentNo !=null and params.patentNo !=''">
-                and a.patentNo REGEXP  #{params.patentNo}
+                and a.patentNo REGEXP #{params.patentNo}
             </if>
             <if test="params.applicationNo !=null and params.applicationNo !=''">
                 and a.applicationNo like concat("%", #{params.applicationNo}, "%")

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

@@ -153,7 +153,7 @@
         <collection property="pictures" ofType="cn.cslg.pas.common.model.vo.ProductPictureVO"
                     select="query2" column="{p_id=p_id}">
         </collection>
-        <collection property="relativePatents" ofType="string"
+        <collection property="patentNum" ofType="Integer"
                     select="query3" column="{p_id=p_id}">
         </collection>
         <collection property="productCategory" ofType="cn.cslg.pas.common.model.vo.ProductCategoryVO"
@@ -175,8 +175,8 @@
         <result column="url" property="url"/>
     </resultMap>
 
-    <select id="query3" resultType="string">
-        select distinct patent_no
+    <select id="query3" resultType="Integer">
+        select count(distinct patent_no)
         from asso_product_patent
         where product_id = #{p_id}
     </select>

+ 3 - 3
PAS/src/main/resources/mapper/StructureMapper.xml

@@ -5,9 +5,9 @@
     <!--插入数据-->
     <!--int insert(Structure structure);-->
     <insert id="insert" useGeneratedKeys="true" keyProperty="id">
-        insert into structure (parent_id, structure_name, path, remark, product_id, tenant_id, create_person_id,
+        insert into structure (parent_id, structure_name, path, remark, product_id, create_person_id,
                                create_person_name)
-        values (#{parentId}, #{structureName}, #{path}, #{remark}, #{productId}, #{tenantId}, #{createPersonId},
+        values (#{parentId}, #{structureName}, #{path}, #{remark}, #{productId}, #{createPersonId},
                 #{createPersonName});
     </insert>
 
@@ -56,7 +56,7 @@
     </update>
 
     <!--根据父级id和名称和架构id统计数量-->
-    <!--int countByparentIdAndStructureName(Integer parentId, String structureName, Integer structureId, Integer tenantId);-->
+    <!--int countByparentIdAndStructureName(Integer parentId, String structureName, Integer structureId);-->
     <select id="countByparentIdAndStructureName" resultType="int">
         select count(*)
         from structure