wanggaokun před 2 roky
rodič
revize
1e519c46c5

+ 2 - 3
PHM-admin/phm-manage/src/main/java/com/phm/manage/domain/Product.java

@@ -20,9 +20,9 @@ public class Product extends TreeEntity {
     private Long id;
 
     /**
-     * 名称
+     * 产品名称
      */
-    @Excel(name = "名称")
+    @Excel(name = "产品名称")
     private String name;
 
     /**
@@ -73,7 +73,6 @@ public class Product extends TreeEntity {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                 .append("id", getId())
                 .append("parentId", getParentId())
-                .append("parentName", getParentName())
                 .append("name", getName())
                 .append("snsId", getSnsId())
                 .append("isDelete", getIsDelete())

+ 2 - 8
PHM-admin/phm-manage/src/main/resources/mapper/manage/ProductMapper.xml

@@ -7,7 +7,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="Product" id="ProductResult">
         <result property="id"    column="id"    />
         <result property="parentId"    column="parent_id"    />
-        <result property="parentName"    column="parent_name"    />
         <result property="name"    column="name"    />
         <result property="snsId"    column="sns_id"    />
         <result property="isDelete"    column="is_delete"    />
@@ -18,15 +17,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectProductVo">
-        select id, parent_id,
-               (select t.name from phm_product t where t.id = parent_id and t.is_delete = 0 limit 1) as parent_name,
-               name, sns_id, is_delete, create_by, create_time, update_by, update_time from phm_product
+        select id, parent_id, name, sns_id, is_delete, create_by, create_time, update_by, update_time from phm_product
     </sql>
 
     <select id="selectProductList" parameterType="Product" resultMap="ProductResult">
         <include refid="selectProductVo"/>
         <where>  
-            <if test="parentName != null  and parentName != ''"> and parent_name like concat('%', #{parentName}, '%')</if>
+            <if test="parentId != null "> and parent_id = #{parentId}</if>
             <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
             <if test="snsId != null  and snsId != ''"> and sns_id = #{snsId}</if>
         </where>
@@ -41,7 +38,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         insert into phm_product
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="parentId != null">parent_id,</if>
-            <if test="parentName != null">parent_name,</if>
             <if test="name != null">name,</if>
             <if test="snsId != null">sns_id,</if>
             <if test="isDelete != null">is_delete,</if>
@@ -52,7 +48,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="parentId != null">#{parentId},</if>
-            <if test="parentName != null">#{parentName},</if>
             <if test="name != null">#{name},</if>
             <if test="snsId != null">#{snsId},</if>
             <if test="isDelete != null">#{isDelete},</if>
@@ -67,7 +62,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update phm_product
         <trim prefix="SET" suffixOverrides=",">
             <if test="parentId != null">parent_id = #{parentId},</if>
-            <if test="parentName != null">parent_name = #{parentName},</if>
             <if test="name != null">name = #{name},</if>
             <if test="snsId != null">sns_id = #{snsId},</if>
             <if test="isDelete != null">is_delete = #{isDelete},</if>