菜品查询、修改、删除
This commit is contained in:
parent
8d6d145dff
commit
0fa9bb8baa
|
|
@ -18,6 +18,17 @@ public class MenuDishesAddMaterialDTO {
|
|||
message = "{menu_material_type_null}"
|
||||
) Integer materialType;
|
||||
|
||||
@ApiModelProperty("食材名称")
|
||||
private String materialName;
|
||||
|
||||
public String getMaterialName() {
|
||||
return materialName;
|
||||
}
|
||||
|
||||
public void setMaterialName(String materialName) {
|
||||
this.materialName = materialName;
|
||||
}
|
||||
|
||||
public Long getMaterialId() {
|
||||
return this.materialId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,7 +128,8 @@ public class MenuDishesServiceImpl implements IMenuDishesService {
|
|||
return menuDishesMapper.addFinalNutrition(nutritionEntity,Long.parseLong(menuDishesDTO.getDishesId()));
|
||||
}
|
||||
|
||||
|
||||
//添加菜品和材料关系表
|
||||
menuDishesMapper.addMenuMaterialDishes(Long.parseLong(menuDishesDTO.getDishesId()),materialList);
|
||||
return menuDishesMapper.editMenuDishes(menuDishesDTO);
|
||||
// } catch (Exception e) {
|
||||
// throw new ServiceException(e.toString());
|
||||
|
|
|
|||
|
|
@ -529,8 +529,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</update>
|
||||
|
||||
<insert id="addMenuMaterialDishes" parameterType="java.util.List">
|
||||
delete from menu_material_dishes where dishes_id = #{dishesId};
|
||||
insert into menu_material_dishes(dishes_id,material_id,weight,material_type)
|
||||
|
||||
values
|
||||
<foreach collection="materialList" item="item" separator=",">
|
||||
(#{dishesId}, #{item.materialId}, #{item.weight}, #{item.materialType})
|
||||
|
|
@ -538,7 +538,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</insert>
|
||||
|
||||
<select id="getMenuMaterialDishes" resultType="com.bonus.canteen.core.menu.dto.MenuDishesAddMaterialDTO">
|
||||
select material_id as materialId,weight,material_type as materialType from menu_material_dishes where dishes_id = #{dishesId}
|
||||
select mmd.material_id as materialId,mmd.weight,mmd.material_type as materialType,mm.material_name as materialName
|
||||
from menu_material_dishes mmd
|
||||
LEFT JOIN menu_material mm on mm.material_id = mmd.material_id
|
||||
where mmd.dishes_id = #{dishesId}
|
||||
</select>
|
||||
|
||||
<select id="getDishMessageByDishesId" resultType="com.bonus.canteen.core.menu.domain.MenuDishes">
|
||||
|
|
|
|||
Loading…
Reference in New Issue