调试了一下发现是updataProduct方法的问题更新不了,而且控制台没有报错图片描述
我到这里又去了dao层做ut 更新,发现也是在这个方法上出了问题,

,难道是mapper里 的sql语句有问题?但是也没有报该方面的错误,调试了好几次了.
贴一下我updataProduct方法
<update id="updateProduct" parameterType="com.entity.Product"
keyProperty="product_id" useGeneratedKeys="true">
UPDATE tb_product
<set>
<if test="productName != null">product_name=#{productName},</if>
<if test="productDesc != null">product_desc=#{productDesc},</if>
<if test="imgAddr != null">img_addr=#{imgAddr},</if>
<if test="normalPrice != null">normal_price=#{normalPrice},</if>
<if test="promotionPrice != null">promotion_price=#{promotionPrice},</if>
<if test="priority != null">priority=#{priority},</if>
<if test="lastEditTime != null">last_edit_time=#{lastEditTime},</if>
<if test="enableStatus != null">enable_status=#{enableStatus},</if>
<if
test="productCategory != null
and productCategory.productCategoryId != null">
product_category_id=#{productCategory.productCategoryId}
</if>
</set>
WHERE product_id = #{productId}
AND shop_id=#{shop.shopId}
</update>
.
SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需
了解课程