导入商品浏览-未完成
This commit is contained in:
parent
d8b0a8a391
commit
573c1d8e3c
|
@ -63,5 +63,10 @@ public interface DishMapper {
|
|||
@AutoFill(value = OperationType.UPDATE)
|
||||
void update(Dish dish);
|
||||
|
||||
|
||||
/**
|
||||
* 条件查询菜品和口味
|
||||
* @param dish Dish
|
||||
* @return List<Dish>
|
||||
*/
|
||||
List<Dish> list(Dish dish);
|
||||
}
|
||||
|
|
|
@ -44,8 +44,8 @@ public interface DishService {
|
|||
|
||||
/**
|
||||
* 条件查询菜品和口味
|
||||
* @param dish
|
||||
* @return
|
||||
* @param dish Dish
|
||||
* @return List<DishVO>
|
||||
*/
|
||||
List<DishVO> listWithFlavor(Dish dish);
|
||||
}
|
||||
|
|
|
@ -13,15 +13,12 @@ import com.sky.mapper.DishFlavorMapper;
|
|||
import com.sky.mapper.DishMapper;
|
||||
import com.sky.mapper.SetMealDishMapper;
|
||||
import com.sky.result.PageResult;
|
||||
import com.sky.result.Result;
|
||||
import com.sky.service.DishService;
|
||||
import com.sky.vo.DishVO;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
|
@ -149,8 +146,8 @@ public class DishServiceImpl implements DishService {
|
|||
|
||||
/**
|
||||
* 条件查询菜品和口味
|
||||
* @param dish
|
||||
* @return
|
||||
* @param dish Dish
|
||||
* @return List<DishVO>
|
||||
*/
|
||||
public List<DishVO> listWithFlavor(Dish dish) {
|
||||
List<Dish> dishList = dishMapper.list(dish);
|
||||
|
|
|
@ -91,4 +91,21 @@
|
|||
from dish
|
||||
where id = #{id};
|
||||
</select>
|
||||
|
||||
<!-- 条件查询菜品和口味 -->
|
||||
<select id="list" resultType="com.sky.entity.Dish" parameterType="Dish">
|
||||
select * from dish
|
||||
<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>
|
||||
order by create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue