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