删除菜品收藏
This commit is contained in:
parent
ea74665d9f
commit
7c36b0e12a
|
|
@ -59,5 +59,5 @@ public interface MenuCollectionDishesMapper {
|
|||
* @param dishesIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMenuCollectionDishesByIds(String[] dishesIds);
|
||||
public int deleteMenuCollectionDishesByIds(@Param("userId") Long userId, @Param("dishesIds") String[] dishesIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,8 @@ public class MenuCollectionDishesServiceImpl implements IMenuCollectionDishesSer
|
|||
*/
|
||||
@Override
|
||||
public int deleteMenuCollectionDishesByIds(String[] ids) {
|
||||
return menuCollectionDishesMapper.deleteMenuCollectionDishesByIds(ids);
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
return menuCollectionDishesMapper.deleteMenuCollectionDishesByIds(userId, ids);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -95,9 +95,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
delete from menu_collection_dishes where dishes_id = #{dishesId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMenuCollectionDishesByIds" parameterType="String">
|
||||
delete from menu_collection_dishes where dishes_id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
<delete id="deleteMenuCollectionDishesByIds">
|
||||
delete from menu_collection_dishes
|
||||
where user_id = #{userId} and dishes_id in
|
||||
<foreach item="dishesId" collection="dishesIds" open="(" separator="," close=")">
|
||||
#{dishesId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
|
|
|||
Loading…
Reference in New Issue