删除菜谱
This commit is contained in:
parent
c7496379ef
commit
a63c4aac32
|
|
@ -58,5 +58,7 @@ public interface CookRecipeDetailMapper {
|
|||
*/
|
||||
public int deleteCookRecipeDetailByRecipeDetailIds(Long[] recipeDetailIds);
|
||||
|
||||
public List<Long> getAllCookRecipeDetailIds(Long[] recipeIds);
|
||||
|
||||
public List<Long> getToDeleteCookRecipeDetailIds(Long recipeId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -228,10 +228,10 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
|
|||
*/
|
||||
@Override
|
||||
public int deleteCookRecipeByRecipeIds(Long[] recipeIds) {
|
||||
//TODO 删除菜谱之菜品详情
|
||||
|
||||
//TODO 删除菜谱之执行计划
|
||||
|
||||
List<Long> cookRecipeDetailIds = cookRecipeDetailMapper.getAllCookRecipeDetailIds(recipeIds);
|
||||
Long[] cookRecipeDetailArray = cookRecipeDetailIds.stream().toArray(Long[]::new);
|
||||
cookRecipeDishesMapper.deleteCookRecipeDishesByCookRecipeDetailIds(cookRecipeDetailArray);
|
||||
cookRecipeDetailMapper.deleteCookRecipeDetailByRecipeDetailIds(cookRecipeDetailArray);
|
||||
return cookRecipeMapper.deleteCookRecipeByRecipeIds(recipeIds);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,6 +99,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getAllCookRecipeDetailIds" parameterType="String" resultType="Long">
|
||||
SELECT distinct(recipe_detail_id)
|
||||
from cook_recipe_detail where recipe_id in
|
||||
<foreach item="recipeId" collection="array" open="(" separator="," close=")">
|
||||
#{recipeId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="getToDeleteCookRecipeDetailIds" parameterType="Long" resultType="Long">
|
||||
SELECT distinct(crd.recipe_detail_id)
|
||||
FROM cook_recipe_detail crd
|
||||
|
|
|
|||
Loading…
Reference in New Issue