修改菜品

This commit is contained in:
slhaf
2024-09-12 18:23:55 +08:00
parent 22e629b6e1
commit 5419e321c8
7 changed files with 143 additions and 4 deletions

View File

@@ -10,6 +10,26 @@
values (#{name}, #{categoryId}, #{price}, #{image}, #{description}, #{status}, #{createTime}, #{updateTime},
#{createUser}, #{updateUser})
</insert>
<update id="update">
update dish
<set>
<if test="name != null">name = #{name},</if>
<if test="categoryId != null">category_id = #{categoryId},</if>
<if test="price != null">price = #{price},</if>
<if test="image != null">image = #{image},</if>
<if test="description != null">description = #{description},</if>
<if test="status != null">status = #{status},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateUser != null">update_user = #{updateUser},</if>
</set>
where id = #{id}
</update>
<delete id="deleteByIds">
delete from dish where id in
<foreach collection="ids" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</delete>
<select id="pageQuery" resultType="com.sky.vo.DishVO">
select dish.*, category.name as categoryName
from dish