苍穹外卖--菜品管理-分页查询功能实现
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user