删除cook_dishes_base
This commit is contained in:
parent
affb765dcf
commit
6c9aa332d6
|
|
@ -12,7 +12,7 @@ public class AppletDishesDetailDTO implements Serializable {
|
|||
@ApiModelProperty("菜谱详情id")
|
||||
private Long detailId;
|
||||
@ApiModelProperty("菜品id")
|
||||
private Long baseDishesId;
|
||||
private Long dishesId;
|
||||
@ApiModelProperty("是否删除(1删除,2未删除)")
|
||||
private Integer delFlag;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,14 +69,6 @@ public interface CookDishesMapper {
|
|||
*/
|
||||
public int checkDishIsExist(CookDishes cookDishes);
|
||||
|
||||
/**
|
||||
* 新增菜品信息
|
||||
*
|
||||
* @param cookDishes 菜品信息
|
||||
* @return 结果
|
||||
*/
|
||||
int insertDishesName(CookDishes cookDishes);
|
||||
|
||||
/**
|
||||
* 新增菜品信息
|
||||
*
|
||||
|
|
@ -85,13 +77,6 @@ public interface CookDishesMapper {
|
|||
*/
|
||||
void insertDishesMaterial(@Param("list") List<CookDishesMaterial> dishesMaterialList,@Param("dishesId") Long dishesId);
|
||||
|
||||
/**
|
||||
* 修改菜品信息
|
||||
*
|
||||
* @param cookDishes 菜品信息
|
||||
*/
|
||||
void updateDishesName(CookDishes cookDishes);
|
||||
|
||||
/**
|
||||
* 删除菜品信息
|
||||
*
|
||||
|
|
@ -174,11 +159,4 @@ public interface CookDishesMapper {
|
|||
* @return 菜品材料类型信息
|
||||
*/
|
||||
List<MapBean> getCookMaterialTypeMap();
|
||||
|
||||
/**
|
||||
* 删除菜品信息
|
||||
*
|
||||
* @param dishesIds 菜品id
|
||||
*/
|
||||
void deleteCookBaseDishesByDishesIds(Long[] dishesIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,8 +100,6 @@ public class CookDishesServiceImpl implements ICookDishesService {
|
|||
try {
|
||||
checkParam(cookDishes, false);
|
||||
//计算营养信息含量
|
||||
//新增菜品名称
|
||||
cookDishesMapper.insertDishesName(cookDishes);
|
||||
//添加菜品
|
||||
cookDishesMapper.insertCookDishes(cookDishes);
|
||||
//添加菜品-原料关联关系
|
||||
|
|
@ -128,8 +126,6 @@ public class CookDishesServiceImpl implements ICookDishesService {
|
|||
cookDishes.setUpdateTime(DateUtils.getNowDate());
|
||||
try {
|
||||
checkParam(cookDishes, true);
|
||||
//修改菜品名称
|
||||
cookDishesMapper.updateDishesName(cookDishes);
|
||||
//修改菜品
|
||||
cookDishesMapper.updateCookDishes(cookDishes);
|
||||
//删除菜品-原料关联关系
|
||||
|
|
@ -186,7 +182,6 @@ public class CookDishesServiceImpl implements ICookDishesService {
|
|||
if (detailIdList != null && !detailIdList.isEmpty()) {
|
||||
cookDishesMapper.deleteCookDishesByDishPlanDetailIds(detailIdList, dishesIds);
|
||||
}
|
||||
cookDishesMapper.deleteCookBaseDishesByDishesIds(dishesIds);
|
||||
return cookDishesMapper.deleteCookDishesByDishesIds(dishesIds);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -208,10 +208,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
<select id="selectDishesNameAndCanteenName" resultType="java.lang.String">
|
||||
SELECT
|
||||
concat_ws( '-', mdb.dishes_name, IFNULL(aa.area_name,'*'),IFNULL(ac.canteen_name,'*') , IFNULL( ass.stall_name,'*') )
|
||||
concat_ws( '-', md.dishes_name, IFNULL(aa.area_name,'*'),IFNULL(ac.canteen_name,'*') , IFNULL( ass.stall_name,'*') )
|
||||
FROM
|
||||
cook_dishes_base mdb
|
||||
LEFT JOIN cook_dishes md ON mdb.base_dishes_id = md.base_dishes_id
|
||||
cook_dishes md
|
||||
LEFT JOIN basic_area aa ON aa.area_id = md.area_id
|
||||
LEFT JOIN basic_canteen ac ON md.canteen_id = ac.canteen_id
|
||||
LEFT JOIN basic_stall ass ON ass.stall_id = md.shopstall_id
|
||||
|
|
@ -393,11 +392,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertDishesName" keyProperty="baseDishesId" useGeneratedKeys="true">
|
||||
insert into cook_dishes_base (dishes_name, create_by, create_time, update_by, update_time)
|
||||
values (#{dishesName}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime})
|
||||
|
||||
</insert>
|
||||
<insert id="insertDishesMaterial">
|
||||
insert into cook_dishes_material (dishes_id, material_id, weight,material_type, create_by, create_time, update_by, update_time)
|
||||
values
|
||||
|
|
@ -480,15 +475,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</trim>
|
||||
where dishes_id = #{dishesId}
|
||||
</update>
|
||||
<update id="updateDishesName">
|
||||
update cook_dishes_base
|
||||
<set>
|
||||
<if test="dishesName != null and dishesName != ''">dishes_name = #{dishesName},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</set>
|
||||
where base_dishes_id = #{baseDishesId}
|
||||
</update>
|
||||
|
||||
<update id="updateFinalNutrition">
|
||||
update cook_dishes
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
|
|
@ -536,13 +523,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{detailId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCookBaseDishesByDishesIds">
|
||||
delete from cook_dishes_base where base_dishes_id in
|
||||
(select base_dishes_id from cook_dishes where dishes_id in
|
||||
<foreach item="baseDishesId" collection="array" open="(" separator="," close=")">
|
||||
#{baseDishesId}
|
||||
</foreach>
|
||||
)
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -62,9 +62,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mrd.mealtime_type,
|
||||
if(md.meal_type = 2, 2, mdt.dishes_type_id) as type_id,
|
||||
if(md.meal_type = 2, '套餐', mdt.dishes_type_name) as type_name,
|
||||
mdb.base_dishes_id,
|
||||
md.dishes_id,
|
||||
mdb.dishes_name,
|
||||
md.dishes_name,
|
||||
md.dishes_name as real_dishes_name,
|
||||
md.image_url as dishes_img_url,
|
||||
mrd.recipe_detail_id,
|
||||
|
|
@ -89,7 +88,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and mdsr.sale_month = month(curdate())
|
||||
left join basic_canteen ac on mr.canteen_id = ac.canteen_id
|
||||
left join basic_stall ass on mr.stall_id = ass.stall_id
|
||||
left join cook_dishes_base mdb on md.base_dishes_id = mdb.base_dishes_id
|
||||
where
|
||||
mrd.apply_date = #{applyDate}
|
||||
|
||||
|
|
@ -232,9 +230,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mrd.mealtime_type,
|
||||
if(md.meal_type = 2, 2, mdt.dishes_type_id) as type_id,
|
||||
if(md.meal_type = 2, '套餐', mdt.dishes_type_name) as type_name,
|
||||
mdb.base_dishes_id,
|
||||
md.dishes_id,
|
||||
mdb.dishes_name,
|
||||
md.dishes_name,
|
||||
md.dishes_name as real_dishes_name,
|
||||
md.meal_type as detail_type,
|
||||
md.image_url as dishes_img_url,
|
||||
|
|
@ -252,7 +249,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
md.size_json,
|
||||
mdsr.monthly_sales,
|
||||
mdsr.good_probability,
|
||||
|
||||
md.dishes_id,
|
||||
md.initial_score,
|
||||
md.calories,
|
||||
|
|
@ -273,7 +269,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
md.magnesium,
|
||||
md.zinc,
|
||||
md.glycemic_index
|
||||
|
||||
from
|
||||
cook_recipe_detail mrd
|
||||
inner join cook_recipe_dishes m on mrd.recipe_detail_id = m.recipe_detail_id
|
||||
|
|
@ -287,7 +282,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and mdsr.sale_month = month(curdate())
|
||||
left join basic_canteen ac on mr.canteen_id = ac.canteen_id
|
||||
left join basic_stall ass on mr.stall_id = ass.stall_id
|
||||
left join cook_dishes_base mdb on md.base_dishes_id = mdb.base_dishes_id
|
||||
where
|
||||
mrd.apply_date = #{applyDate}
|
||||
and mr.recipe_id = #{recipeId}
|
||||
|
|
@ -383,11 +377,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="selectDishesDetailByDishesId" resultType="com.bonus.canteen.core.cook.vo.AppletDishesDetailVO">
|
||||
select
|
||||
mdb.base_dishes_id,
|
||||
md.dishes_id,
|
||||
md.meal_type,
|
||||
md.custom_id,
|
||||
mdb.dishes_name,
|
||||
md.dishes_name,
|
||||
md.dishes_name as real_dishes_name,
|
||||
md.alias_name,
|
||||
md.image_url,
|
||||
|
|
@ -409,11 +402,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
md.calcium,
|
||||
md.sodium
|
||||
from
|
||||
cook_dishes_base mdb
|
||||
left join cook_dishes md on mdb.base_dishes_id = md.base_dishes_id
|
||||
cook_dishes md
|
||||
left join cook_recipe_dishes mrd on md.dishes_id = mrd.dishes_id
|
||||
where
|
||||
mdb.base_dishes_id = #{baseDishesId}
|
||||
md.dishes_id = #{dishesId}
|
||||
and mrd.recipe_detail_id = #{detailId}
|
||||
<!-- and md.del_flag = #{delFlag}-->
|
||||
limit 1
|
||||
|
|
|
|||
|
|
@ -163,8 +163,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select crd.mealtime_type,
|
||||
crd.recipe_detail_id,
|
||||
cd.dishes_id,
|
||||
cdb.base_dishes_id,
|
||||
cdb.dishes_name,
|
||||
cd.dishes_name,
|
||||
crdd.id,
|
||||
crdd.price,
|
||||
crdd.size_type,
|
||||
|
|
@ -185,7 +184,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join cook_recipe_dishes crdd on crd.recipe_detail_id = crdd.recipe_detail_id
|
||||
left join cook_dishes cd on crdd.dishes_id = cd.dishes_id
|
||||
left join basic_canteen bc on cd.canteen_id = bc.canteen_id
|
||||
left join cook_dishes_base cdb on cd.base_dishes_id = cdb.base_dishes_id
|
||||
left join cook_dishes_type cdt on cd.type_id = cdt.dishes_type_id
|
||||
where crd.recipe_id = #{recipeId}
|
||||
and crd.apply_date = #{applyDate}
|
||||
|
|
@ -196,9 +194,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select DISTINCT
|
||||
mrd.mealtime_type,
|
||||
mrd.recipe_detail_id,
|
||||
mdb.base_dishes_id ,
|
||||
md.dishes_id,
|
||||
mdb.dishes_name,
|
||||
md.dishes_name,
|
||||
mrdd.id,
|
||||
mrdd.price,
|
||||
mrdd.size_type,
|
||||
|
|
@ -219,7 +216,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join cook_recipe_dishes mrdd on mrd.recipe_detail_id = mrdd.recipe_detail_id
|
||||
left join cook_dishes md on mrdd.dishes_id = md.dishes_id
|
||||
left join basic_canteen ac on md.canteen_id = ac.canteen_id
|
||||
left join cook_dishes_base mdb on md.base_dishes_id = mdb.base_dishes_id
|
||||
left join cook_dishes_type mdt on md.type_id = mdt.dishes_type_id
|
||||
where mrd.recipe_id = #{params.recipeId}
|
||||
<if test="params.applyWeek !=null and params.applyWeek != ''">
|
||||
|
|
@ -232,8 +228,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectTemplateDetailList" resultMap="cookRecipeDetailVO">
|
||||
select mrd.mealtime_type,
|
||||
mrd.recipe_detail_id,
|
||||
mdb.base_dishes_id as dishes_id,
|
||||
mdb.dishes_name,
|
||||
md.dishes_id,
|
||||
md.dishes_name,
|
||||
mrdd.id,
|
||||
mrdd.price,
|
||||
mrdd.size_type,
|
||||
|
|
@ -254,7 +250,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join cook_recipe_dishes mrdd on mrd.recipe_detail_id = mrdd.recipe_detail_id
|
||||
left join cook_dishes md on mrdd.dishes_id = md.dishes_id
|
||||
left join basic_canteen ac on md.canteen_id = ac.canteen_id
|
||||
left join cook_dishes_base mdb on md.base_dishes_id = mdb.base_dishes_id
|
||||
left join cook_dishes_type mdt on md.type_id = mdt.dishes_type_id
|
||||
where mrd.recipe_id = #{params.recipeId}
|
||||
<if test="params.applyWeek !=null ">
|
||||
|
|
@ -468,8 +463,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select mrd.mealtime_type,
|
||||
mrd.recipe_id,
|
||||
mrd.recipe_detail_id,
|
||||
mdb.base_dishes_id as dishes_id,
|
||||
mdb.dishes_name,
|
||||
md.dishes_id,
|
||||
md.dishes_name,
|
||||
mrdd.id,
|
||||
mrdd.price,
|
||||
mrdd.size_type,
|
||||
|
|
@ -490,7 +485,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join cook_recipe_dishes mrdd on mrd.recipe_detail_id = mrdd.recipe_detail_id
|
||||
left join cook_dishes md on mrdd.dishes_id = md.dishes_id
|
||||
left join basic_canteen ac on md.canteen_id = ac.canteen_id
|
||||
left join cook_dishes_base mdb on md.base_dishes_id = mdb.base_dishes_id
|
||||
left join cook_dishes_type mdt on md.type_id = mdt.dishes_type_id
|
||||
where 1=1
|
||||
<if test="recipeIds !=null and recipeIds.size() > 0">
|
||||
|
|
|
|||
Loading…
Reference in New Issue