苍穹外卖--菜品管理-分页查询功能实现

This commit is contained in:
2025-11-11 11:46:50 +08:00
parent 9fcb79991e
commit 6cf6f4ef41
5 changed files with 66 additions and 4 deletions

View File

@@ -7,4 +7,20 @@
insert into dish (name, category_id, price, image, description, create_time, update_time, create_user, update_user,status)
values (#{name},#{categoryId},#{price},#{image},#{description},#{createTime},#{updateTime},#{createUser},#{updateUser},#{status})
</insert>
<select id="pageQuery" resultType="com.sky.vo.DishVO">
SELECT d.*,c.name categoryName FROM dish d LEFT JOIN category c ON d.category_id = c.id
<where>
<if test="name != null and name != ''">
and d.name like concat('%',#{name},'%')
</if>
<if test="categoryId != null">
and d.category_id = #{categoryId}
</if>
<if test="status != null">
and d.status = #{status}
</if>
</where>
ORDER BY d.create_time DESC
</select>
</mapper>