@@ -29,6 +29,7 @@
and status=#{spu.status}
</if>
</where>
+ order by id desc
</select>
<insert id="insertSpu" parameterType="com.poyee.dto.SpuDTO">
insert into spu (category,sub_category,spu_name,num,main_image,carousel_image,status,create_time,create_by,properties)
@@ -40,6 +41,7 @@
update spu
<trim prefix="set" suffixOverrides=",">
<if test="category!=null and category!=''">category=#{category},</if>
+ <if test="subCategory!=null and subCategory!=''">sub_category=#{subCategory}</if>
<if test="spuName!=null and spuName!=''">spu_name=#{spuName},</if>
<if test="num!=null">num=#{num},</if>
<if test="mainImage!=null and mainImage!=''">main_image=#{mainImage},</if>