-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathFood Mapper.java
31 lines (21 loc) · 973 Bytes
/
Food Mapper.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.food.foodweb.mapper;
import com.food.foodweb.model.Food;
import org.apache.ibatis.annotations.*;
import java.util.List;
@Mapper
public interface FoodMapper {
@Select("select * from tb_food where name=#{name}")
Food findByName(String name);
@Select("select * from tb_food where name like concat(\"%\",#{name},\"%\")")
List<Food>vagueFindByName(String name);
@Select("select*from tb_food")
List<Food> findAll();
@Insert("insert into tb_food values(#{name},#{img},#{time},#{type},#{pop},#{way},#{culture},#{step})")
boolean add(Food food);
@Delete("delete from tb_food where name=#{name}")
boolean del(String name);
@Update("update tb_food set name=#{name},img=#{img},time=#{time},type=#{type},pop=#{pop},way=#{way} where name=#{name}")
boolean edit(Food food);
@Update("update tb_food set name=#{name},img=#{img},culture=#{culture},step=#{step} where name=#{name}")
boolean editinfo(Food food);
}