瀏覽代碼

商品分类查询sql修改

linhui.li 1 周之前
父節點
當前提交
9d06cc55d6

+ 2 - 2
py-goods/src/main/resources/mapper/SpuCategoryMapper.xml

@@ -5,7 +5,7 @@
 <mapper namespace="com.poyee.mapper.SpuCategoryMapper">
 
     <sql id="spuCategoryQuery">
-        select id,category_name categoryName,is_cascade isCascade, sub_label subLabel,sort,parent_id parentId from sys_material_category
+        select id,category_name categoryName,is_cascade isCascade, sub_label subLabel,sort,parent_id parentId from spu_category
     </sql>
     <select id="querySpuCategory" resultType="spuCategoryDto">
         <include refid="spuCategoryQuery"></include>
@@ -22,7 +22,7 @@
     </insert>
 
     <update id="updateCategory">
-        update sys_material_category
+        update spu_category
         <trim prefix="set" suffixOverrides=",">
             <if test="categoryName!=null and categoryName!=''">
                 category_name=#{categoryName},

+ 1 - 1
py-goods/src/main/resources/mapper/SpuMapper.xml

@@ -23,7 +23,7 @@
         select id,category,sub_category,spu_name,num,main_image,carousel_image,status,create_time,create_by,properties from spu
         <where>
             <if test="spu.name!=null and spu.name!=''">
-                name like concat('%'+#{spu.name}+'%')
+                name like concat('%',#{spu.name},'%')
             </if>
             <if test="spu.status!=null">
                 status=#{spu.status}