新增套餐、套餐分页查询、根据分类id查询菜品
This commit is contained in:
21
sky-server/src/main/resources/mapper/SetmealMapper.xml
Normal file
21
sky-server/src/main/resources/mapper/SetmealMapper.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.sky.mapper.SetmealMapper">
|
||||
<insert id="insert">
|
||||
insert into setmeal(category_id, name, price, status, description, image, create_time, update_time, create_user,
|
||||
update_user)
|
||||
VALUES (#{categoryId}, #{name}, #{price}, #{status}, #{description}, #{image}, #{createTime}, #{updateTime},
|
||||
#{createUser}, #{updateUser})
|
||||
</insert>
|
||||
|
||||
<select id="pageQuery" resultType="com.sky.entity.Setmeal">
|
||||
select * from setmeal
|
||||
<where>
|
||||
<if test="name != null">and name like concat('%',name,'%')</if>
|
||||
<if test="categoryId != null">and category_id = #{categoryId}</if>
|
||||
<if test="status != null">and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user