/**
* 根据菜品id查询对应的口味数据
* @param dishId
* @return
*/@Select("select * from dish_flavor where dish_id = #{dishId}")List<DishFlavor>getByDishId(Long dishId);
分页条件查找
<select id="pageQuery" resultType="com.sky.vo.DishVO">
select d.* , c.name as categoryName from dish d left outer join category c on d.category_id = c.id
<where><if test="name != null">
and d.name like concat('%',#{name},'%')</if><if test="categoryId != null">
and d.category_id = #{categoryId}</if><if test="status != null">
and d.status = #{status}</if></where>
order by d.create_time desc
</select>
删除
/**
* 根据主键删除菜品数据
*
* @param id
*/@Delete("delete from dish where id = #{id}")voiddeleteById(Long id);