parent
8e7951b321
commit
dc80acc219
@ -0,0 +1,51 @@
|
||||
package com.sky.mapper;
|
||||
|
||||
import com.sky.entity.SetmealDish;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SetmealDishMapper {
|
||||
|
||||
/*
|
||||
* 根据菜品id查询对应套餐的id
|
||||
* 这个方法用于获取与给定菜品ID列表相关的所有套餐ID。
|
||||
* @param dishIds 菜品ID列表
|
||||
* @return 返回包含相关套餐ID的列表
|
||||
*/
|
||||
List<Long> getSetmealIdsByDishIds(List<Long> dishIds);
|
||||
|
||||
/*
|
||||
* 批量插入套餐和菜品的关联数据
|
||||
* 这个方法用于将一组套餐-菜品关系批量插入数据库中。
|
||||
* @param setmealDishes 套餐-菜品关系对象列表
|
||||
*/
|
||||
void insertBatch(List<SetmealDish> setmealDishes);
|
||||
|
||||
/*
|
||||
* 根据套餐id获取相应菜品的数据
|
||||
* 这个方法用于根据套餐ID获取与之关联的所有菜品信息。
|
||||
* @param setmealId 套餐ID
|
||||
* @return 返回包含套餐中所有菜品信息的列表
|
||||
*/
|
||||
@Select("select * from setmeal_dish where setmeal_id = #{setmealId}")
|
||||
List<SetmealDish> getBySetmealId(Long setmealId);
|
||||
|
||||
/*
|
||||
* 根据多个套餐id删除对应的套餐-菜品关系
|
||||
* 这个方法用于删除与给定套餐ID列表相关的所有套餐-菜品关系。
|
||||
* @param setmealIds 套餐ID列表
|
||||
*/
|
||||
void deleteBySetmealIds(List<Long> setmealIds);
|
||||
|
||||
/*
|
||||
* 根据单个套餐id删除对应的套餐-菜品关系
|
||||
* 这个方法用于删除与指定套餐ID相关的所有套餐-菜品关系。
|
||||
* @param setmealId 套餐ID
|
||||
*/
|
||||
@Delete("delete from setmeal_dish where setmeal_id = #{setmealId}")
|
||||
void deleteBySetmealId(Long setmealId);
|
||||
}
|
Loading…
Reference in new issue