苍穹外卖--菜品管理-删除功能实现

This commit is contained in:
2025-11-11 14:29:45 +08:00
parent 6cf6f4ef41
commit 85cd67f345
9 changed files with 121 additions and 0 deletions

View File

@@ -10,4 +10,10 @@
(#{flavor.dishId},#{flavor.name},#{flavor.value})
</foreach>
</insert>
<delete id="deleteBath">
delete from dish_flavor where dish_id in
<foreach collection="ids" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -7,6 +7,7 @@
insert into dish (name, category_id, price, image, description, create_time, update_time, create_user, update_user,status)
values (#{name},#{categoryId},#{price},#{image},#{description},#{createTime},#{updateTime},#{createUser},#{updateUser},#{status})
</insert>
<select id="pageQuery" resultType="com.sky.vo.DishVO">
SELECT d.*,c.name categoryName FROM dish d LEFT JOIN category c ON d.category_id = c.id
<where>
@@ -23,4 +24,12 @@
ORDER BY d.create_time DESC
</select>
<delete id="deleteBath">
delete from dish where id in
<foreach collection="ids" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.sky.mapper.SetmealDishMapper">
<select id="getSetmealIdsByDishIds" resultType="java.lang.Long">
SELECT setmeal_id FROM setmeal_dish WHERE dish_id IN
<foreach collection="ids" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</select>
</mapper>