shop--6.店铺注册
在ShopDao接口中添加对于shop实体类的信息
在ShopDao.xml中对shop数据表进行修改
动态生成SQL语句
注:在mybatis中对sql语句使用条件判断,注意在最后一个if判断语句中,最后是没有逗号的,其他的都有,是要对sql语句进行拼接
<update id="updateShop" parameterType="com.shop.bean.Shop" > UPDATE shop <set> <if test="shopName != null">shop_name=#{shopName},</if> <if test="shopDesc != null">shop_desc=#{shopDesc},</if> <if test="shopAddr != null">shop_addr=#{shopAddr},</if> <if test="shopImg != null">shop_img=#{shopImg},</if> <if test="priority != null">priority=#{priority},</if> <if test="lastEditTime != null">last_edit_time=#{lastEditTime},</if> <if test="status != null">status=#{status},</if> <if test="advice != null">advice=#{advice},</if> <if test="area != null">area_id=#{area.areaId},</if> <if test="shopCategory != null">shop_category_id=#{shopCategory.shopCategoryId}</if> </set> WHERE shop_id=#{shopId} </update>
shop--6.店铺注册--使用thumbnailator进行图片处理