您的位置:首页 > 教育 > 锐评 > 弄个本科学历需要多少钱_团支部智慧团建网站_软文经典案例_线上推广营销

弄个本科学历需要多少钱_团支部智慧团建网站_软文经典案例_线上推广营销

2025/5/16 6:37:40 来源:https://blog.csdn.net/Aishangyuwen/article/details/143277103  浏览:    关键词:弄个本科学历需要多少钱_团支部智慧团建网站_软文经典案例_线上推广营销
弄个本科学历需要多少钱_团支部智慧团建网站_软文经典案例_线上推广营销

        SetmealController

/*** 更新套餐信息** @param setmealDTO* @return*/@PutMapping@ApiOperation("更新套餐信息")public Result update(@RequestBody SetmealDTO setmealDTO) {log.info("更新套餐信息:{}", setmealDTO);setMealService.update(setmealDTO);return Result.success();}

        SetmealService

/*** 更新套餐信息** @param setmealDTO*/void update(SetmealDTO setmealDTO);
/*** 更新套餐信息** @param setmealDTO*/@Overridepublic void update(SetmealDTO setmealDTO) {// 将SetmealDTO对象封装为对应的Setmeal对象Setmeal setmeal = new Setmeal();BeanUtils.copyProperties(setmealDTO, setmeal);// 修改setmeal表,修改套餐信息setMealMapper.update(setmeal);// 获取当前套餐idLong setmealId = setmealDTO.getId();// 删除原来的套餐和菜品的关联,操作setmeal_dish表中的delete方法setmealDishMapper.deleteBySetmealID(setmealId);// 获得当前的setmeal下所有的菜品List<SetmealDish> setmealDishes = setmealDTO.getSetmealDishes();setmealDishes.forEach(new Consumer<SetmealDish>() {@Overridepublic void accept(SetmealDish setmealDish) {// 将当前菜品和当前套餐产生关联System.out.println(setmealId);setmealDish.setSetmealId(setmealId);}});// 重新插入套餐和菜品的关系setmealDishMapper.insertBatch(setmealDishes);}

        SetmealMapper

/*** 修改套餐信息** @param setmeal*/// 添加注解,完成自动补充属性@AutoFill(value = OperationType.UPDATE)void update(Setmeal setmeal);

        XML配置

<update id="update" useGeneratedKeys="true" keyProperty="id">update setmeal<set><if test="categoryId != null">category_id = #{categoryId},</if><if test="description != null">description = #{description},</if><if test="image != null">image = #{image},</if><if test="name != null and name != ''">name = #{name},</if><if test="price != null">price = #{price},</if><if test="status != null">status = #{status},</if><if test="updateTime != null">update_time = #{updateTime},</if><if test="updateUser != null">update_user = #{updateUser},</if></set>where id = #{id}</update>

 

 

 

 

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com